Index: src/gui/sdl_mapper.cpp
===================================================================
--- src/gui/sdl_mapper.cpp (Revision 3688)
+++ src/gui/sdl_mapper.cpp (Revision 3689)
if (!MAPPER_LoadBinds()) CreateDefaultBinds();
if (SDL_GetModState()&KMOD_CAPS) {
for (CBindList_it bit=caps_lock_event->bindlist.begin();bit!=caps_lock_event->bindlist.end();bit++) {
- (*bit)->ActivateBind(32767,true,true);
#if SDL_VERSION_ATLEAST(1, 2, 14)
+ (*bit)->ActivateBind(32767,true,false);
(*bit)->DeActivateBind(false);
+ (*bit)->ActivateBind(32767,true,true); //Skip the action itself as bios_keyboard.cpp handles the startup state.
if (SDL_GetModState()&KMOD_NUM) {
for (CBindList_it bit=num_lock_event->bindlist.begin();bit!=num_lock_event->bindlist.end();bit++) {
- (*bit)->ActivateBind(32767,true,true);
#if SDL_VERSION_ATLEAST(1, 2, 14)
+ (*bit)->ActivateBind(32767,true,false);
(*bit)->DeActivateBind(false);
+ (*bit)->ActivateBind(32767,true,true);
Index: src/gui/sdlmain.cpp
===================================================================
--- src/gui/sdlmain.cpp (Revision 3688)
+++ src/gui/sdlmain.cpp (Revision 3689)
#if SDL_VERSION_ATLEAST(1, 2, 14)
+ /* Or debian/ubuntu with older libsdl version as they have done this themselves, but then differently.
+ * with this variable they will work correctly. I've only tested the 1.2.14 behaviour against the windows version
putenv(const_cast<char*>("SDL_DISABLE_LOCK_KEYS=1"));
if ( SDL_Init( SDL_INIT_AUDIO|SDL_INIT_VIDEO|SDL_INIT_TIMER|SDL_INIT_CDROM
Index: src/ints/bios_keyboard.cpp
===================================================================
--- src/ints/bios_keyboard.cpp (Revision 3688)
+++ src/ints/bios_keyboard.cpp (Revision 3689)
* Define the following if this is the case */
#if SDL_VERSION_ATLEAST(1, 2, 14)
+/* For lower versions of SDL we also use a slight hack to get the startup states of numclock and capslock right.
+ * The proper way is in the mapper, but the repeating key is an unwanted side effect for lower versions of SDL */
static Bitu call_int16,call_irq1,call_irq6;
mem_writew(BIOS_KEYBOARD_BUFFER_TAIL,0x1e);
Bit8u leds = 16; /* Ack recieved */
-//MAPPER_Init takes care of this now ?
-// if(startup_state_capslock) { flag1|=0x40; leds|=0x04;}
-// if(startup_state_numlock){ flag1|=0x20; leds|=0x02;}
+#if SDL_VERSION_ATLEAST(1, 2, 14)
+//Nothing, mapper handles all.
+ if (startup_state_capslock) { flag1|=0x40; leds|=0x04;}
+ if (startup_state_numlock) { flag1|=0x20; leds|=0x02;}
mem_writeb(BIOS_KEYBOARD_FLAGS1,flag1);
mem_writeb(BIOS_KEYBOARD_FLAGS2,0);
mem_writeb(BIOS_KEYBOARD_FLAGS3,16); /* Enhanced keyboard installed */