Fix SHIFT + Fx reporting in GEM. Contributed by Miro Kropacek SDL-1.2
authorPatrice Mandin <patmandin@gmail.com>
Wed, 22 May 2019 23:16:54 +0200
branchSDL-1.2
changeset 12749af9681b14e85
parent 12748 99db0741486d
child 12772 8546f12c2834
Fix SHIFT + Fx reporting in GEM. Contributed by Miro Kropacek
src/video/ataricommon/SDL_atarievents.c
src/video/ataricommon/SDL_atarikeys.h
     1.1 --- a/src/video/ataricommon/SDL_atarievents.c	Wed May 22 23:10:33 2019 +0200
     1.2 +++ b/src/video/ataricommon/SDL_atarievents.c	Wed May 22 23:16:54 2019 +0200
     1.3 @@ -140,8 +140,11 @@
     1.4  		keymap[i] = SDLK_UNKNOWN;
     1.5  
     1.6  	/* Functions keys */
     1.7 -	for ( i = 0; i<10; i++ )
     1.8 +	for ( i = 0; i<10; i++ ) {
     1.9  		keymap[SCANCODE_F1 + i] = SDLK_F1+i;
    1.10 +		/* Shift state is handled separately */
    1.11 +		keymap[SCANCODE_SHIFT_F1 + i] = SDLK_F1+i;
    1.12 +	}
    1.13  
    1.14  	/* Cursor keypad */
    1.15  	keymap[SCANCODE_HELP] = SDLK_HELP;
    1.16 @@ -229,7 +232,7 @@
    1.17  	keysym->unicode = 0;
    1.18  
    1.19  	if (keysym->sym == SDLK_UNKNOWN) {
    1.20 -		keysym->sym = asciicode = keytab_normal[scancode];		
    1.21 +		keysym->sym = asciicode = keytab_normal[scancode];
    1.22  	}
    1.23  
    1.24  	if (SDL_TranslateUNICODE && pressed) {
     2.1 --- a/src/video/ataricommon/SDL_atarikeys.h	Wed May 22 23:10:33 2019 +0200
     2.2 +++ b/src/video/ataricommon/SDL_atarikeys.h	Wed May 22 23:16:54 2019 +0200
     2.3 @@ -27,7 +27,7 @@
     2.4   */
     2.5  
     2.6  #ifndef _SDL_ATARIKEYS_H_
     2.7 -#define _SDL_ATARIKEYS_H_ 
     2.8 +#define _SDL_ATARIKEYS_H_
     2.9  
    2.10  /* --- Keyboard scancodes --- */
    2.11  /* taken from svgalib/vgakeyboard.h */
    2.12 @@ -107,6 +107,17 @@
    2.13  #define SCANCODE_F9		0x43
    2.14  #define SCANCODE_F10	0x44
    2.15  
    2.16 +#define SCANCODE_SHIFT_F1	0x54
    2.17 +#define SCANCODE_SHIFT_F2	0x55
    2.18 +#define SCANCODE_SHIFT_F3	0x56
    2.19 +#define SCANCODE_SHIFT_F4	0x57
    2.20 +#define SCANCODE_SHIFT_F5	0x58
    2.21 +#define SCANCODE_SHIFT_F6	0x59
    2.22 +#define SCANCODE_SHIFT_F7	0x5a
    2.23 +#define SCANCODE_SHIFT_F8	0x5b
    2.24 +#define SCANCODE_SHIFT_F9	0x5c
    2.25 +#define SCANCODE_SHIFT_F10	0x5d
    2.26 +
    2.27  /* Numeric keypad */
    2.28  #define SCANCODE_KP0			0x70
    2.29  #define SCANCODE_KP1			0x6d