The Mac port could do with additional selectable keyboard layouts for the 4 current physical Apple layouts (don't believe they've changed since 2007):
In addition the Keyboard Event mapping tables could do with a bit of a tidy up, as the Event names are slightly inconsistent between the DispKbd.c and the keyboard.h files e.g.
{VK_DASH,1,11}, // X(minus, 1, 11)
{VK_BACK,1,14}, // X(backspase, 1, 14)
{VK_BRACKETLEFT,3,1}, // X(bracket_l, 1, 11)
{VK_BRACKETRIGHT,3,2}, // X(bracket_r, 3, 2)
{VK_CAPITAL,5,13}, // X(caps_lock, 5, 13)
{VK_APOSTROPHY,4,6}, // X(apostrophe, 4, 6)
{VK_BACKTICK,1,0}, // X(grave, 1, 0)
{VK_LCONTROL,3,11}, // X(control_l, 3, 11)
{VK_RSHIFT,5,8}, // X(shift_r, 5, 8)
Wondering what to do with the: ISO_KEY / ISO_Section (0x0A) key.
Note: The lack of a numeric key keypad on the majority of current Macs makes capturing the mouse a real pain.
My keyboard on a PC has no numeric keyboard so I added an environment variable to override the key long ago for X on Unix. Perhaps something similar can be done for Mac OS X? See http://arcem.cvs.sourceforge.net/viewvc/arcem/arcem/X/DispKbd.c?revision=1.82&view=markup#l358
THe ARCEMXMOUSEKEY environment variable logic will work on all Unix( BSD / Linux / OS X) flavours, but I've been having a bit of a dig for a more elegant / programmatic solution, and so far have failed. I've been trying to find some mechanism to determine whether an attached keyboard has a numeric keypad, which seems a bit of obvious functionality, but can't find any standard libraries that offer this (can obviously detect key presses / events but too late), and so far have only found a few frigs to determine whether there is a numeric keypad e.g.
http://stackoverflow.com/questions/12549614/detecting-the-presence-absence-of-a-numeric-keypad
Or assuming all non internal keyboards will have a keypad you could add a simple wrapper to the exec e.g.
(ioreg -Src IOUSBDevice | grep "USB Product Name" | grep "Keyboard" | egrep -v "Hub|Internal")>/dev/null || export ARCEMXMOUSEKEY="§"; ./arcem
OR:
(system_profiler SPUSBDataType | grep "Keyboard" | egrep -v "Hub|Internal")>/dev/null || export ARCEMXMOUSEKEY="§"; ./arcem
OR:
(lsusb | grep "Keyboard" | egrep -v "Hub|Internal")>/dev/null || export ARCEMXMOUSEKEY="§"; ./arcem
Last edit: Andrew Roberts 2014-03-25