Some fixes already: r12628 + r12626 + r12624. See also #1172.
Looks like there aren't virtual keycodes for most of the keys, so we will have to use something like this How to convert ASCII character to CGKeyCode.
Here are some of the missing keys: exclam quotedbl sterling dollar percent asciicircum ampersand asterisk parenleft parenright braceleft braceright underscore colon at numbersign asciitilde comma period slash less greater question notsign bar 'fr' layout: eacute egrave ccedilla agrave dead_circumflex one_superior two_superior section percent mu dead_diaresis degree currency horizconnector periodcentered dead_belowdot exclamdown oneeighth threeeights fiveeights seveneights trademark plusminus degree questiondown
Related ticket: OSX client keyboard layout detection #1444
Maybe we should also set the modifier flags on key events using CGEventSetFlags
Text_Input_Sources, of particular interest:
kTISPropertyInputSourceLanguages
kTISNotifySelectedKeyboardInputSourceChanged
: '
TISSelectInputSource
: to set a particular layout. See for example LayoutTracker.
More links:
Don't have time, but this looks like it would help: https://github.com/jonathanlurie/PyUserInputGen/blob/master/pykeyboard/mac.py (has a keymap for AZERTY)
this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/1171