The new code in darwinEvents.c to differentiate between left and right modifiers does not build on anything except Mac OS X 10.3. It uses new device dependent codes from <IOKit/hidsystem/ IOLLEvent.h> and the build fails with: darwinEvents.c: In function `DarwinUpdateModifiers': darwinEvents.c:113: `NX_DEVICELCMDKEYMASK' undeclared (first use in this function) darwinEvents.c:113: (Each undeclared identifier is reported only once darwinEvents.c:113: for each function it appears in.) darwinEvents.c:113: `NX_DEVICERCMDKEYMASK' undeclared (first use in this function) darwinEvents.c:117: `NX_DEVICELCTLKEYMASK' undeclared (first use in this function) darwinEvents.c:117: `NX_DEVICERCTLKEYMASK' undeclared (first use in this function) darwinEvents.c:121: `NX_DEVICELALTKEYMASK' undeclared (first use in this function) darwinEvents.c:121: `NX_DEVICERALTKEYMASK' undeclared (first use in this function) darwinEvents.c:125: `NX_DEVICELSHIFTKEYMASK' undeclared (first use in this function) darwinEvents.c:125: `NX_DEVICERSHIFTKEYMASK' undeclared (first use in this function) make[5]: *** [darwinEvents.o] Error 1 Older versions of this file defined NX_NEXT* macros with the same values except NX_*RCMDKEYMASK is missing. I'm not sure how well older kernels supported these masks. CVSWeb showing the revisions of this file can be found at <http://cvs.opendarwin.org/index.cgi/ src/IOHIDFamily/IOHIDSystem/IOKit/hidsystem/IOLLEvent.h>.
If you look at the IOLLEvent.h that's on Mac OS 10.2.x (i.e. darwin 6.2) you'll see that those NX_NEXT* #defines are commented out. (Silly Apple for using C++ style comments in a C header file.)
Yes, I was not paying attention when I read over IOLLEvent.h last night. It looks like there is no way to get right modifier support on anything earlier then Mac OS X 10.3. We need to #ifdef out the patch covered by bug #240 for earlier versions. One might worry about hardware that does not support differentiating left from right modifier keys. I skimmed the kernel code in IOHIKeyboardMapper.cpp and it looks like the right thing happens if right modifiers are not supported. Ie. if NX_SHIFTMASK is on, then NX_DEVICELSHIFTKEYMASK will be on if there is no distinction between left and right.
1.1.2.8 +2 -0 xc/Attic/CHANGELOG-RELEASE-1-TM 1.1.4.1.6.1.4.2 +27 -8 xc/programs/Xserver/hw/darwin/darwinEvents.c 1.1.4.1.6.1.4.2 +32 -1 xc/programs/Xserver/hw/darwin/darwinKeyboard.c 1.1.2.37 +3 -1 xc/Attic/CHANGELOG-RELEASE-1 1.1.4.1.6.3 +27 -8 xc/programs/Xserver/hw/darwin/darwinEvents.c 1.1.4.1.6.3 +32 -1 xc/programs/Xserver/hw/darwin/darwinKeyboard.c 1.1.2.25 +3 -1 xc/Attic/CHANGELOG-CURRENT 1.1.4.4 +27 -8 xc/programs/Xserver/hw/darwin/darwinEvents.c 1.1.4.4 +32 -1 xc/programs/Xserver/hw/darwin/darwinKeyboard.c
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.