changeset 37:ac52753bacfc

Enable capslock by default and keep it on reset
author William Astle <lost@l-w.ca>
date Mon, 21 Nov 2022 22:54:25 -0700
parents c786c1dd4632
children ef961e1c30cb
files src/lwbasic.s
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lwbasic.s	Mon Nov 21 22:38:01 2022 -0700
+++ b/src/lwbasic.s	Mon Nov 21 22:54:25 2022 -0700
@@ -466,6 +466,8 @@
                 stx vartabstring                ; put start of string variables after that
                 stx objecttab                   ; also put the start of large objects there
                 stx freestart                   ; mark the start of free memory
+                lda #keyb_caps                  ; enable caps lock but disable all other shift states
+                sta keyb_flags
                 ldx #warmstart                  ; set up warm start handler
                 stx RSTVEC
                 lda #0x55                       ; activate warm start handler
@@ -560,7 +562,9 @@
 keyb_reset      ldx #keyb_buff                  ; point to start of keyboard ring buffer
                 stx keyb_buffw                  ; set write point there
                 stx keyb_buffr                  ; set read point there (pointers equal means empty buffer)
-                clr keyb_flags                  ; reset keyboard state flags
+                lda keyb_flags                  ; reset keyboard state flags but keep capslock
+                anda #keyb_caps
+                sta keyb_flags
                 clr keyb_joystate               ; clear joystick button state
                 clr keyb_curscan                ; stop any keyboard repeating
                 ldx #0xffff                     ; mark all key state as "unpressed"