[Gllug] Switching keyboard layouts when changing keyboards

Dylan dylan at dylan.me.uk
Mon Jul 28 15:40:21 UTC 2008


On Monday 28 July 2008, Justin Perreault wrote:
>
> Now the two above are still manual as opposed to automagical. If you
> want to get into the layout switching when you start typing on the other
> my guess is that the hal daemon and some good script-fu will sort it
> out. I would suggest reading up on hal.

I hadn't thought of HAL - will check to see if I can find anything, and since 
you mention that I'll look in the system-wide as well as KDE setting!

>
> Out of interest, do the two keyboards report as the same when pressing a
> key?

No, they don't. This is the same key from each keyboard as reported by xev:

================================

KeyPress event, serial 40, synthetic NO, window 0x1a00001,
    root 0x44, subw 0x0, time 1783557304, (74,127), root:(256,634),
    state 0x2000, keycode 38 (keysym 0x61, a), same_screen YES,
    XLookupString gives 1 bytes: (61) "a"
    XmbLookupString gives 1 bytes: (61) "a"
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0x1a00001,
    root 0x44, subw 0x0, time 1783557376, (74,127), root:(256,634),
    state 0x2000, keycode 38 (keysym 0x61, a), same_screen YES,
    XLookupString gives 1 bytes: (61) "a"
    XFilterEvent returns: False

KeymapNotify event, serial 40, synthetic NO, window 0x0,
    keys:  2   0   0   0   0   0   0   0   0   0   0   4294967168 0   0   0   
0 
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0

MappingNotify event, serial 40, synthetic NO, window 0x0,
    request MappingKeyboard, first_keycode 8, count 248

KeyRelease event, serial 41, synthetic NO, window 0x1a00001,
    root 0x44, subw 0x0, time 1783559250, (74,127), root:(256,634),
    state 0x2000, keycode 95 (keysym 0xffc8, F11), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyPress event, serial 41, synthetic NO, window 0x1a00001,
    root 0x44, subw 0x0, time 1783560674, (74,127), root:(256,634),
    state 0x2000, keycode 38 (keysym 0x6c6, Cyrillic_ef), same_screen YES,
    XLookupString gives 2 bytes: (d1 84) "ф"
    XmbLookupString gives 2 bytes: (d1 84) "ф"
    XFilterEvent returns: False

KeyRelease event, serial 41, synthetic NO, window 0x1a00001,
    root 0x44, subw 0x0, time 1783560768, (74,127), root:(256,634),
    state 0x2000, keycode 38 (keysym 0x6c6, Cyrillic_ef), same_screen YES,
    XLookupString gives 2 bytes: (d1 84) "ф"
    XFilterEvent returns: False

================================================

Having looked at that more closely now, it seems I'll need to find a way to 
trigger the KeymapNotify even ...

Dylan
-- 
“ ‘... but there is so much else behind what I say. It makes itself known to 
me so slowly, so incompletely! ...’ ”
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug


More information about the GLLUG mailing list