Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meh and Hyper not working in ordinary keymap #772

Closed
DenJohX opened this issue Sep 21, 2016 · 1 comment · Fixed by #776
Closed

Meh and Hyper not working in ordinary keymap #772

DenJohX opened this issue Sep 21, 2016 · 1 comment · Fixed by #776

Comments

@DenJohX
Copy link

DenJohX commented Sep 21, 2016

Using xev, it shows there is a problem with the Meh and Hyper keys using the ordinary keymap.

trying to do a Meh + t (something I use to open the terminal)

KeyPress event, serial 50, synthetic NO, window 0x6800001,
    root 0x29b, subw 0x0, time 12299924, (92,61), root:(2277,392),
    state 0x10, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 50, synthetic NO, window 0x6800001,
    root 0x29b, subw 0x0, time 12299924, (92,61), root:(2277,392),
    state 0x14, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 50, synthetic NO, window 0x6800001,
    root 0x29b, subw 0x0, time 12299924, (92,61), root:(2277,392),
    state 0x15, keycode 64 (keysym 0xffe7, Meta_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 50, synthetic NO, window 0x6800001,
    root 0x29b, subw 0x0, time 12300372, (92,61), root:(2277,392),
    state 0x1d, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 50, synthetic NO, window 0x6800001,
    root 0x29b, subw 0x0, time 12300372, (92,61), root:(2277,392),
    state 0x19, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 50, synthetic NO, window 0x6800001,
    root 0x29b, subw 0x0, time 12300372, (92,61), root:(2277,392),
    state 0x18, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 50, synthetic NO, window 0x6800001,
    root 0x29b, subw 0x0, time 12300372, (92,61), root:(2277,392),
    state 0x10, keycode 28 (keysym 0x74, t), same_screen YES,
    XLookupString gives 1 bytes: (74) "t"
    XmbLookupString gives 1 bytes: (74) "t"
    XFilterEvent returns: False

KeyRelease event, serial 50, synthetic NO, window 0x6800001,
    root 0x29b, subw 0x0, time 12300516, (92,61), root:(2277,392),
    state 0x10, keycode 28 (keysym 0x74, t), same_screen YES,
    XLookupString gives 1 bytes: (74) "t"
    XFilterEvent returns: False

All shift, ctrl, and meta should release after the T, not before.

@DidierLoiseau
Copy link
Contributor

I confirm the behaviour (not specifically on the ordinary keymap). Looks like a residue of the fix for #156 which was not fixed by #239!

The problem is that the check for whether the key is only a mod key does not work when all mods are "weak" and action.key.code = KC_NO. The consequence is that KC_MEH and KC_HYPR are not considered as pure "mod keys" and their mods are registered as weak and removed on the next keypress.

2 possible fixes:

  • change the definition of KC_MEH
    from

    #define KC_MEH  MEH(KC_NO)

    to

    #define KC_MEH  LCTL(LSFT(KC_LALT))

    (and similarly KC_HYPR); or

  • change the check for pure mod keys to

    if (IS_MOD(action.key.code) || action.key.code == KC_NO) {

I think the second option is better as it is more generic and will work for other use cases too (e.g. if people define their own KC_MEH-like key).

I have already checked that it works, I can make a PR with this tomorrow.

DidierLoiseau added a commit to DidierLoiseau/qmk_firmware that referenced this issue Sep 22, 2016
jackhumbert added a commit that referenced this issue Sep 23, 2016
Fix issue #772 Meh and Hyper not working
@DenJohX DenJohX changed the title Meh and Hyper not working in ordynary keymap Meh and Hyper not working in ordinary keymap Sep 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants