use correct KeySyms for runes < 0x100

This commit is contained in:
Unrud 2018-08-23 17:12:36 +02:00
parent ed74ab60e4
commit 33c9b815b0
5 changed files with 374 additions and 3 deletions

View file

@ -117,9 +117,12 @@ keycodes:
C.XFlush(p.display)
}()
for _, runeValue := range text {
keysym := C.KeySym(0x01000000 + runeValue)
keysym, err := runeToKeysym(runeValue)
if err != nil {
return err
}
for i := range keycodeMapping {
keycodeMapping[i] = keysym
keycodeMapping[i] = C.KeySym(keysym)
}
C.XChangeKeyboardMapping(p.display, C.int(emptyKeycode), keysymsPerKeycode,
(*C.KeySym)(unsafe.Pointer(&keycodeMapping[0])), 1)