=== modified file 'sdl.c' --- sdl.c 2010-02-26 16:26:00 +0000 +++ sdl.c 2010-11-18 22:47:20 +0000 @@ -390,10 +390,13 @@ break; case 0x45: /* num lock */ case 0x3a: /* caps lock */ - /* SDL does not send the key up event, so we generate it */ - kbd_put_keycode(keycode); - kbd_put_keycode(keycode | 0x80); - return; + /* SDL does not send the key up event for real caps lock, so we generate it */ + if (ev->keysym.sym == 0x12d) { + kbd_put_keycode(keycode); + kbd_put_keycode(keycode | 0x80); + return; + } + break; } /* now send the key code */