Hi. I noticed that on some platforms the caps-lock state can affect how key chords are interpreted. It is currently inconsistent across platforms. The behavior that feels correct to me is that caps-lock should affect the case of letters as they are typed, and NOTHING else. On gtk, if caps-lock is ON then Control+s produces C-S-s and Control+Shift+s produces C-s; this is backwards from what I think it should do. On OSX it looks like with caps-lock, both shifted and non-shifted presses produce C-s, which is 50% wrong regardless of how one thinks this SHOULD work. On Windows it does the right thing. In a console on Debian it looks like Control+Shift+s produces C-s regardless of caps-lock, but I suspect this has a deeper cause than what this patch touches. I have tested this patch on gtk (fixes it) and the console (doesn't change anything). Hopefully it makes osx work properly while letting windows builds keep working.