a500kbd

diff src/amigakb.c @ 3:31a1f0b53d98

- scroll lock now acts as caps lock - the scroll-lock light indicates drive activity
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 18 Oct 2017 08:20:58 +0300
parents a4fd9c5a6655
children
line diff
     1.1 --- a/src/amigakb.c	Tue Oct 17 15:25:33 2017 +0300
     1.2 +++ b/src/amigakb.c	Wed Oct 18 08:20:58 2017 +0300
     1.3 @@ -14,6 +14,17 @@
     1.4  {
     1.5  	int i;
     1.6  	static unsigned char prev_keycode = 0xff;
     1.7 +	static unsigned char capslk;
     1.8 +
     1.9 +	if(keycode == 0x62) {
    1.10 +		/* caps lock doesn't get a key release event when the key is released
    1.11 +		 * but rather when the caps lock is toggled off again
    1.12 +		 */
    1.13 +		if(!press) return;
    1.14 +
    1.15 +		capslk = ~capslk;
    1.16 +		press = capslk;
    1.17 +	}
    1.18  
    1.19  	/* keycode bit transfer order: 6 5 4 3 2 1 0 7 (7 is pressed flag) */
    1.20  	keycode = (keycode << 1) | (~press & 1);