First of all - THANK YOU for getting the job done and resurrecting this great piece of code
but...
PLEASE... I get the point of your added 'keyboard shortcuts' and french ppl on WIN/Linux probably love them... but it is driving me (and probably other OSX users) furious because of the different keyboard layout and keyCodes... on OSX you use for majority of shortcuts CMD key instead of CTRL... so your piece of code is useless for OSX users...
Just imagine pressing CMD+C ("ctrl+c") and the barracks popping up your screen instantly
Please add an ON/OFF option to the settings for that or provide a guide for turning it off (I'm a webDev and managed to comment it out in no time but a lot of players are not that fortunate)
As I said - I get your intention but it's useless for OSX ppl
To provide more tech details - you need to find a workaround or some GIST for cmd/ctrl handling - you can NOT rely on keyCodes as the layouts may differ across platforms. For OSX the CMD has the keyCode 91 which is on other platforms the 'left window key' (the ctrl is the same as on other platforms - 17). As an alternative solution you can add to the condition the
MouseEvent.metaKey but as the MSDN states
Note: On Macintosh keyboards, this key is the command key (⌘). On Windows keyboards, this key is the Windows key (⊞).
so I would consider this as a hot-fix and not a permanent solution... but to sum it up - the keyboard handling across all platforms and devices is tricky and you should always provide the users the ability to adjust keyboard related features.
And also these shortkeys should be localised because in english worlds C makes no sense for Barracks, G makes no sense for Hide, P makes no sense for Docks etc... And I'm not even speaking about other European Languages...
Thanks once again, great job!