Menu

#470 Incorrect CAPS SHIFT state when pressing multiple host cursor keys simultaneously

future
open
nobody
5
2020-08-08
2020-08-08
lvd
No

There is a problem in keeping correct CAPS SHIFT state for the emulated machine when using host cursor keys.
A quick way to reproduce this issue: boot emulated machine into 48k basic, then press cursor-left on host, not releasing it, press cursor-down, then release cursor-left while keeping cursor-down pressed. The emulated machine then will type a lot of "6".

Another test for this issue is the following 48k BASIC program:
1 PRINT AT 0,0;IN 65278:GOTO 1
which continuosly prints the state of the keyboard row where CAPS LOCK is situated (0xFEFE): 191 when CAPS LOCK is released and 190 when not.

A quick fix for that is attached. The idea behind that is to keep counter array (keyboard_count_values[] in keyboard.c) for every ZX key which increments as key press comes and decrements as key release comes. Final bitmap is built from that counter array (if counter is non-zero, ZX key is pressed). Another idea is to filter out host keyboard autorepeat, which can only autorepeat the last host keypress (was_keypress and was_keysym in input.c).

1 Attachments

Discussion


Log in to post a comment.