On Mac OS X, the command key doesn’t trigger an event. Thankfully, I was able to fix this by adding a only few lines to GLFW’s source. My problem now is that both the left-side and right-side modifier keys cause GLFW to trigger events for left-side modifiers.
My game really needs to be able to differentiate between the modifiers on each side of the keyboard, but GLFW doesn’t seem to support that on Mac OS X.
Would it be possible to add support for this in a future release?
Well, there are no constants for command keys in GLFW. They could be added, of course, or the keys could be mapped to existing constants. Sounds like a useful addition. I’ll see if it can be added (I’m only the OS X developer).
It would be great if you could email me a patch with your changes, as a reference.
Simply add this line to the _glfwHandleMacModifierChange function:
_glfwTestModifier( cmdKey, GLFW_KEY_LCMD );
and add a GLFW_KEY_LCMD constant to glfw.h
Carbon provides only a "cmdKey" constant, no constant for the right-side version like it has for the other mods.
The problem with right mod keys registering as left mod keys (both left and right shift keys trigger LSHIFT, for example) might just be a problem with Carbon or my OS, because it is clear that your code is written properly in _glfwHandleMacModifierChange.
You may decide not to use my additions, but I’m sure you’d be interested in seeing them. Unfortunately, I haven’t a clue how to do a patch thingy, so what do you suggest?
I’m going to add a dependency to the HID Manager for joystick support, but I’d really rather not depend on code outside the regular OS and Developer Tools. I’d still be interested in your code, since I’ll have to duplicate parts of the HID Utilities functionality anyway.
If your copy of GLFW comes from CVS, then you can produce a suitable diff with `cvs duff -u`. Otherwise, download a fresh copy of the sources and do `diff -ru clean-glfw-dir your-glfw-dir`.
Thank you for working on this. It may be the thing to finally get me to add HID support to GLFW. Please don’t hesitate to bug me via email