Skip to content

[Issue] Modifier does not work for other G-Keys #15

@braoult

Description

@braoult

Hi,

I want to use G5 a an "Hyper" Key, and all other keys G-keys defined as F-key (F13...F21). My main point is that I prefer to manage G-keys at application-level.
Note: Below was tested on XUbuntu 18.04.

I added in char_uinput_mapper.py :

        # japanese keys
        "muhenkan": click(uinput.KEY_MUHENKAN),
        "zenkakuhankaku": click(uinput.KEY_ZENKAKUHANKAKU),
        "katakana": click(uinput.KEY_KATAKANA),
        "hiragana": click(uinput.KEY_HIRAGANA),
        "henkan": click(uinput.KEY_HENKAN),
        "katakanahiragana": click(uinput.KEY_KATAKANAHIRAGANA),
        'F19': click(uinput.KEY_F19),
        'F20': click(uinput.KEY_F20),
        'F21': click(uinput.KEY_F21),
        'F22': click(uinput.KEY_F22),
        'F23': click(uinput.KEY_F23),
        'F24': click(uinput.KEY_F24),

My /etc/g910-gkeys/config.json contains the mapping of G1-G9 to F13-F21 (please see the comment for G8) :

{
    "__comment": "following hotkey types are supported: nothing, typeout, shortcut and run; only en and si keyboard mappings are currently supported",
    "keyboard_mapping": "en",
    "g1": {
        "hotkey_type": "shortcut",
        "do": "F13"
    },
    "g2": {
        "hotkey_type": "shortcut",
        "do": "F14"
    },
    "g3": {
        "hotkey_type": "shortcut",
        "do": "F15"
    },
    "g4": {
        "hotkey_type": "shortcut",
        "do": "F16"
    },
    "g5": {
        "hotkey_type": "shortcut",
        "do": "F17"
    },
    "g6": {
        "hotkey_type": "shortcut",
        "do": "F18"
    },
    "g7": {
        "hotkey_type": "shortcut",
        "do": "F19"
    },
   "__comment": "I am in fact unable to use F20 : even xev does not show the keycode. It just mutes/unmutes sound, same as the G910's <mute> button - until understood, F21&F22 look a better choice below",
    "g8": {
        "hotkey_type": "shortcut",
        "do": "F20"
    },
    "g9": {
        "hotkey_type": "shortcut",
        "do": "F21"
    }
}

I have added in my ~.Xmodmap :

! Map "Windows right" to Meta_R and "Menu right" to Super_R
keycode 134 = Meta_R NoSymbol Meta_R
keycode 135 = Super_R NoSymbol Super_R
! and G5 (F17) becomes Hyper_L
keycode 195 = Hyper_L NoSymbol Hyper_L

! necessary on my system, for some reason original modifier for mod4 contains already Hyper_L:
! mod4        Super_L (0x85),  Meta_R (0x86),  Super_L (0xce),  Hyper_L (0xcf)
clear mod4
add mod4 = Super_L Super_R

! now we define G5 as Hyper_L
clear mod3
add mod3 = Hyper_L

!!!!!!!!!!!!!! Logitech G910 keyboard
! original F13, F14, etc... mapping
! F13 = keycode 191 = XF86Toolks NoSymbol XF86Tools
! F14 = keycode 192 = XF86Launch5 NoSymbol XF86Launch5
! F15 = keycode 193 = XF86Launch6 NoSymbol XF86Launch6
! F16 = keycode 194 = XF86Launch7 NoSymbol XF86kLaunch7
! F17 = keycode 195 = XF86Launch8 NoSymbol XF86Launch8
! F18 = keycode 196 = XF86Launch9 NoSymbol XF86Launch9
! F19 = keycode 197 = (nothing)
! F20 = keycode 198 = XF86AudioMicMute NoSymbol XF86AudioMicMute
! F21 = keycode 199 = XF86TouchpadToggle NoSymbol XF86TouchpadToggle
! F22 = keycode 200 = XF86TouchpadOn NoSymbol XF86TouchpadOn

! map the Gkeys to F13-F22, and not XF86Tools, etc...
! Except G5, that became Hyper_L above
! Keycodes are from 191 (G1/F13) to 199 (G9/F21)
keycode 191 = F13 F13 F13
keycode 192 = F14 F14 F14
keycode 193 = F15 F15 F15
keycode 194 = F16 F16 F16
! G5 - skipped
! keycode 195 = F17  F17 F17
keycode 196 = F18 F18 F18
keycode 197 = F19 F19 F19
keycode 198 = F20 F20 F20
keycode 199 = F21 F21 F21

So far so good, the hyper modifier works (tested under Emacs):
G5-c is seen as Hyper-c, etc...
G5+CTRL+Windows+ALT+SHIFT-f is seen as ctrl-meta-super-hyper-shift-f.

For other g-keys (except G8/F20), I can also use ctrl-g1, shift-g1, meta-g1, ctrl+super+g1 etc, who return the correct codes (ctrl-F13, etc...).

The issue is for the "hyper" modifier (G5), when used with another G-KEY.
G5-G1 should return "Hyper-F13". It returns nothing.
More interesting: When used with another modifier (let say control), nothing is returned too:
ctrl-G5-G1, shift-G5-G1 etc... do not work.

Hope this will help,

br.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions