Page MenuHome

X11: Fallback to keycode lookup for unknown keysyms
Needs ReviewPublic

Authored by matc (matc) on Fri, Aug 30, 8:32 PM.

Details

Summary

This patch adds more keycode lookups to GHOST_SystemX11. Keycodes are only evaluated when the produced keysym fails to match any ghost key.

Keys that are not usable:

French master: <:!ù*^$)
French patch: ^

German master: <^ä#ü+ß´^  ('ö' maps to 'M')
German patch: ´^ ('ö' maps to ';')

Spanish master: <´ç` ('ñ' maps to 'M')
Spanish patch: ´` ('ñ' maps to ';')

The remapping of ö and ñ is a side effect of XLookupString and XLookupKeysym returning different keysyms for some keycodes. This is part of the shifted number key workaround. The code causing the remapping is part of the default case, where the number workaround was not required and a lookup of keycode and keysym no longer fails.

The IDs used in this patch were produced using an English (US) keyboard layout. I hope they are consistent across multiple configurations.

Using a diacritic key (with and without this patch) will cause the next key press to be ignored.

Diacritic keys are still not recognized properly, but produce key up events without a matching key down event. I don't know whether this will cause problems.

Diacritic key on master (German (Swizterland): '^' ):

ghost_key_from_keysym: unknown key: 65106 / 0xfe52
ghost_key_from_keycode unhandled keycode: AE12
ghost_key_from_keysym: unknown key: 65106 / 0xfe52

GHOST_EventPrinter::processEvent, time: 7425, type: GHOST_kEventKeyUp, key: unknown

//second press

ghost_key_from_keysym: unknown key: 0 / 0x0
ghost_key_from_keysym: unknown key: 0 / 0x0

GHOST_EventPrinter::processEvent, time: 12103, type: GHOST_kEventKeyDown, key: unknown
ghost_key_from_keysym: unknown key: 65106 / 0xfe52
ghost_key_from_keycode unhandled keycode: AE12
ghost_key_from_keysym: unknown key: 65106 / 0xfe52

GHOST_EventPrinter::processEvent, time: 12211, type: GHOST_kEventKeyUp, key: unknown

Diacritic key with this patch (German (Swizterland): '^' ):

ghost_key_from_keysym: unknown key: 65105 / 0xfe51

GHOST_EventPrinter::processEvent, time: 17277, type: GHOST_kEventKeyUp, key: =

//second press

ghost_key_from_keysym: unknown key: 0 / 0x0
ghost_key_from_keysym: unknown key: 0 / 0x0

GHOST_EventPrinter::processEvent, time: 18639, type: GHOST_kEventKeyDown, key: unknown
ghost_key_from_keysym: unknown key: 65105 / 0xfe51

GHOST_EventPrinter::processEvent, time: 18724, type: GHOST_kEventKeyUp, key: =

Diff Detail

Event Timeline

matc (matc) created this revision.Fri, Aug 30, 8:32 PM