Some keybindings don't work sometimes (Programmer Dvorak, Plasma 5) #2753

Open
vozhyk- opened this Issue Apr 27, 2017 · 11 comments

Comments

Projects
None yet
5 participants
@vozhyk-

vozhyk- commented Apr 27, 2017

Output of i3 --moreversion 2>&- || i3 --version:

Binary i3 version:  4.13 (2016-11-08) © 2009 Michael Stapelberg and contributors
Running i3 version: 4.13 (2016-11-08) (pid 3520)o abort…)
Loaded i3 config: /home/vozhyk/.i3/config (Last modified: Thu 27 Apr 2017 06:20:11 PM CEST, 31 seconds ago)

The i3 binary you just called: /usr/bin/i3
The i3 binary you are running: i3

URL to a logfile as per http://i3wm.org/docs/debugging.html:

http://logs.i3wm.org/logs/5638916786880512.bz2

What I did:

I'm pressing Hyper-& (Hyper-ampersand).

What I saw:

i3 didn't switch to desktop number 1. This is xev's output when pressing the keys with it focused:

KeyPress event, serial 33, synthetic NO, window 0x3000001,
    root 0xf5, subw 0x0, time 107093982, (-364,235), root:(1966,291),
    state 0x10, keycode 66 (keysym 0xffed, Hyper_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

FocusOut event, serial 34, synthetic NO, window 0x3000001,
    mode NotifyGrab, detail NotifyAncestor

FocusIn event, serial 34, synthetic NO, window 0x3000001,
    mode NotifyUngrab, detail NotifyAncestor

KeymapNotify event, serial 34, synthetic NO, window 0x0,
    keys:  0   4   0   0   0   0   0   0   4   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   

KeyRelease event, serial 34, synthetic NO, window 0x3000001,
    root 0xf5, subw 0x0, time 107096462, (-364,235), root:(1966,291),
    state 0x50, keycode 10 (keysym 0x26, ampersand), same_screen YES,
    XLookupString gives 1 bytes: (26) "&"
    XFilterEvent returns: False

KeyRelease event, serial 34, synthetic NO, window 0x3000001,
    root 0xf5, subw 0x0, time 107103614, (-364,235), root:(1966,291),
    state 0x50, keycode 66 (keysym 0xffed, Hyper_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

This happens only occasionally - I can reproduce it right now, but I won't be able to if I e.g. relogin.

What I expected instead:
i3 should switch to workspace number 1.

Additional details:

I'm using the Programmer Dvorak keyboard layout and Plasma 5 (with the window manager set to i3) (but I've killed kded5, kded4, kdeinit4, plasmashell for this test (the result was KDE global shortcuts stopping to work)). I've also killed compton before restarting i3 for the test. I haven't tried to reproduce it with a clean i3 session (as it also doesn't happen with Plasma most of the time).

I've used i3-msg 'debuglog on; shmlog on; reload' to enable debug logging just before pressing the keys, so the reload in the log isn't relevant.

The Hyper-Shift-& keybinding works, however. Other similar keybindings (which I've removed from the config for the test):

  • that don't work:
$mod+bracketleft
$mod+braceleft
$mod+braceright
$mod+equal
$mod+parenright
Control+Mod1+q
  • that work:
$mod+parenleft
$mod+asterisk
$mod+plus
$mod+bracketright
$mod+exclam

@i3bot i3bot added the 4.13 label Apr 27, 2017

@vozhyk- vozhyk- changed the title from Some keybindings don't work sometimes to Some keybindings don't work sometimes (Programmer Dvorak, Plasma 5) Apr 27, 2017

@Airblader Airblader added the bug label Apr 28, 2017

@Airblader

This comment has been minimized.

Show comment
Hide comment
@Airblader

Airblader Apr 28, 2017

Member

Can you see any pattern in when it does or doesn't work? What's your key repeat rate? Does it only happen for workspace switching bindings or also when you bind it to something else?

Member

Airblader commented Apr 28, 2017

Can you see any pattern in when it does or doesn't work? What's your key repeat rate? Does it only happen for workspace switching bindings or also when you bind it to something else?

@vozhyk-

This comment has been minimized.

Show comment
Hide comment
@vozhyk-

vozhyk- Apr 28, 2017

Can you see any pattern in when it does or doesn't work?

There's another intermittent problem I have that might be related (however, last time the problem with i3 happened it continued to happen even once the other one stopped to (I haven't noticed whether they've started happening at the same time)).

Plasma sometimes hangs for a while (or until a reboot) (the panel doesn't update the time shown on it and doesn't respond to clicks on it; pressing the (KDE) volume control shortcuts has no effect (but kcmshell5 kcm_pulseaudio works)). Most of the times it happens is when resuming from sleep. Sometimes it also causes a high load average (about 6 on a 4-thread system) and at the same time makes me unable to run sudo (it just hangs and can't be killed with ^C or ^\). When it stops happening, the volume suddenly changes according to the previously-pressed shortcuts. dbus-monitor doesn't seem to show anything special at first glance - it just shows many messages (probably, queued ones) once it stops happening.

I also thought it could be Plasma capturing the shortcuts, but it seems I've killed the relevant processes and the problem didn't go away.

What's your key repeat rate?

It's set in KDE as "25 repeats/s" with a delay of "600 ms".

Does it only happen for workspace switching bindings or also when you bind it to something else?

It happens at least for a kill binding (Control+Mod1+q) in addition to workspace switching. Another kill binding ($mod+Shift+colon) works.

vozhyk- commented Apr 28, 2017

Can you see any pattern in when it does or doesn't work?

There's another intermittent problem I have that might be related (however, last time the problem with i3 happened it continued to happen even once the other one stopped to (I haven't noticed whether they've started happening at the same time)).

Plasma sometimes hangs for a while (or until a reboot) (the panel doesn't update the time shown on it and doesn't respond to clicks on it; pressing the (KDE) volume control shortcuts has no effect (but kcmshell5 kcm_pulseaudio works)). Most of the times it happens is when resuming from sleep. Sometimes it also causes a high load average (about 6 on a 4-thread system) and at the same time makes me unable to run sudo (it just hangs and can't be killed with ^C or ^\). When it stops happening, the volume suddenly changes according to the previously-pressed shortcuts. dbus-monitor doesn't seem to show anything special at first glance - it just shows many messages (probably, queued ones) once it stops happening.

I also thought it could be Plasma capturing the shortcuts, but it seems I've killed the relevant processes and the problem didn't go away.

What's your key repeat rate?

It's set in KDE as "25 repeats/s" with a delay of "600 ms".

Does it only happen for workspace switching bindings or also when you bind it to something else?

It happens at least for a kill binding (Control+Mod1+q) in addition to workspace switching. Another kill binding ($mod+Shift+colon) works.

@Airblader

This comment has been minimized.

Show comment
Hide comment
@Airblader

Airblader Apr 30, 2017

Member

Thanks for the input. This rules out one trivial source of error I was thinking of. I don't have time at the moment to dive deeper into this myself, though, sorry. Maybe someone has a good idea. :-)

Member

Airblader commented Apr 30, 2017

Thanks for the input. This rules out one trivial source of error I was thinking of. I don't have time at the moment to dive deeper into this myself, though, sorry. Maybe someone has a good idea. :-)

@jli

This comment has been minimized.

Show comment
Hide comment
@jli

jli May 2, 2017

I notice you're using a Hyper key. I am too, and I had an issue where some of my keybindings were getting interpreted as various "dead keys". Maybe you're having the same issue?

For example, Hyper+bracketright is mapped to dead_tilde, so if I type Hyper+bracketright and then a, I get ã (and i3 never gets the Hyper+bracketright).

You can see the mapping with xmodmap:

$ xmodmap -pk | grep bracketright
     21         0x005d (bracketright)   0x007d (braceright)     0x005d (bracketright)   0x007d (braceright)     0xfe53 (dead_tilde)     0x0000 (NoSymbol)       0xfe53 (dead_tilde)     

I fixed this resetting the broken keys w/ xmodmap:

keysym apostrophe = apostrophe quotedbl
keysym comma = comma less comma less
keysym period = period greater period greater
keysym 6 = 6 asciicircum  6 asciicircum
keysym 9 = 9 parenleft 9 parenleft

jli commented May 2, 2017

I notice you're using a Hyper key. I am too, and I had an issue where some of my keybindings were getting interpreted as various "dead keys". Maybe you're having the same issue?

For example, Hyper+bracketright is mapped to dead_tilde, so if I type Hyper+bracketright and then a, I get ã (and i3 never gets the Hyper+bracketright).

You can see the mapping with xmodmap:

$ xmodmap -pk | grep bracketright
     21         0x005d (bracketright)   0x007d (braceright)     0x005d (bracketright)   0x007d (braceright)     0xfe53 (dead_tilde)     0x0000 (NoSymbol)       0xfe53 (dead_tilde)     

I fixed this resetting the broken keys w/ xmodmap:

keysym apostrophe = apostrophe quotedbl
keysym comma = comma less comma less
keysym period = period greater period greater
keysym 6 = 6 asciicircum  6 asciicircum
keysym 9 = 9 parenleft 9 parenleft
@vozhyk-

This comment has been minimized.

Show comment
Hide comment
@vozhyk-

vozhyk- May 2, 2017

Thanks for the tip! I'll see what it shows when it happens again. Currently (when all the keybindings are working), it shows this [Edit: changed to bracketleft, because this was the problematic key for me]:

% xmodmap -pk | grep bracketleft
     11         0x005b (bracketleft)    0x0037 (7)      0x005b (bracketleft)    0x0037 (7)      0x00a4 (currency)       0x0000 (NoSymbol)     0x00a4 (currency)

Maybe your Hyper is Mod5? Mine is Mod4 (and, AFAIK, I don't have special key types that have different symbols based on Mod4 state), so it shouldn't normally happen. It's possible that the config gets changed somehow, though.

vozhyk- commented May 2, 2017

Thanks for the tip! I'll see what it shows when it happens again. Currently (when all the keybindings are working), it shows this [Edit: changed to bracketleft, because this was the problematic key for me]:

% xmodmap -pk | grep bracketleft
     11         0x005b (bracketleft)    0x0037 (7)      0x005b (bracketleft)    0x0037 (7)      0x00a4 (currency)       0x0000 (NoSymbol)     0x00a4 (currency)

Maybe your Hyper is Mod5? Mine is Mod4 (and, AFAIK, I don't have special key types that have different symbols based on Mod4 state), so it shouldn't normally happen. It's possible that the config gets changed somehow, though.

@vozhyk-

This comment has been minimized.

Show comment
Hide comment
@vozhyk-

vozhyk- May 24, 2017

This has happened again.

% xmodmap -pk | grep bracketleft
     11         0x005b (bracketleft)    0x0037 (7)      0x005b (bracketleft)    0x0037 (7)      0x00a4 (currency)       0x0000 (NoSymbol)       0x00a4 (currency)       0x0000 (NoSymbol)       0x0032 (2)      0x0040 (at)     0x0032 (2)      0x0022 (quotedbl)
     34         0x002f (slash)  0x003f (question)       0x002f (slash)  0x003f (question)       0x00bf (questiondown)   0x100203d (U203D)       0x00bf (questiondown)   0x100203d (U203D)       0x005b (bracketleft)    0x007b (braceleft)      0x06c8 (Cyrillic_ha)    0x06e8 (Cyrillic_HA)

Doesn't seem different aside from having more layouts.

vozhyk- commented May 24, 2017

This has happened again.

% xmodmap -pk | grep bracketleft
     11         0x005b (bracketleft)    0x0037 (7)      0x005b (bracketleft)    0x0037 (7)      0x00a4 (currency)       0x0000 (NoSymbol)       0x00a4 (currency)       0x0000 (NoSymbol)       0x0032 (2)      0x0040 (at)     0x0032 (2)      0x0022 (quotedbl)
     34         0x002f (slash)  0x003f (question)       0x002f (slash)  0x003f (question)       0x00bf (questiondown)   0x100203d (U203D)       0x00bf (questiondown)   0x100203d (U203D)       0x005b (bracketleft)    0x007b (braceleft)      0x06c8 (Cyrillic_ha)    0x06e8 (Cyrillic_HA)

Doesn't seem different aside from having more layouts.

@stapelberg

This comment has been minimized.

Show comment
Hide comment
@stapelberg

stapelberg Aug 19, 2017

Member

We’ve had a bunch of keyboard-related commits since the 4.13 release. Can you reproduce this issue with an i3 version from the next branch?

Member

stapelberg commented Aug 19, 2017

We’ve had a bunch of keyboard-related commits since the 4.13 release. Can you reproduce this issue with an i3 version from the next branch?

@vozhyk-

This comment has been minimized.

Show comment
Hide comment
@vozhyk-

vozhyk- Aug 27, 2017

This happens quite rarely (with 4.13) - I don't remember it happening more than 3 times since the last time I wrote here, so it won't be easy to reproduce.

vozhyk- commented Aug 27, 2017

This happens quite rarely (with 4.13) - I don't remember it happening more than 3 times since the last time I wrote here, so it won't be easy to reproduce.

@Airblader

This comment has been minimized.

Show comment
Hide comment
@Airblader

Airblader Nov 5, 2017

Member

@vozhyk- Since some time has passed – did you encounter this again?

Member

Airblader commented Nov 5, 2017

@vozhyk- Since some time has passed – did you encounter this again?

@vozhyk-

This comment has been minimized.

Show comment
Hide comment
@vozhyk-

vozhyk- Nov 11, 2017

I did once or twice. At least one of the times I was using https://github.com/vozhyk-/ergoemacs-xkb.

I can trigger it intermittently now:

% cat ~/.Xkeymap
xkb_keymap {
        xkb_keycodes  { include "evdev+aliases(qwerty)" };
        xkb_types     {
                include "complete"
                include "navigation"
        };
        xkb_compat    { include "complete"      };
        xkb_symbols   {
                include "pc+us(dvp)+pl(dvp):2+us:3+ru:4+inet(evdev)+altwin(ctrl_win)+capslock(hyper)+shift(both_capslock)+navigation+compose(menu)+group(rctrl_rshift_toggle)"
        };
        xkb_geometry  { include "pc(pc104)"     };
};
2017-11-11 16:12:56 vozhyk@vozhx-thinkpad ~ % xkbcomp ~/.Xkeymap $DISPLAY &>/dev/null

The same keybindings are {not,} working, except $mod+ampersand it is working now.

vozhyk- commented Nov 11, 2017

I did once or twice. At least one of the times I was using https://github.com/vozhyk-/ergoemacs-xkb.

I can trigger it intermittently now:

% cat ~/.Xkeymap
xkb_keymap {
        xkb_keycodes  { include "evdev+aliases(qwerty)" };
        xkb_types     {
                include "complete"
                include "navigation"
        };
        xkb_compat    { include "complete"      };
        xkb_symbols   {
                include "pc+us(dvp)+pl(dvp):2+us:3+ru:4+inet(evdev)+altwin(ctrl_win)+capslock(hyper)+shift(both_capslock)+navigation+compose(menu)+group(rctrl_rshift_toggle)"
        };
        xkb_geometry  { include "pc(pc104)"     };
};
2017-11-11 16:12:56 vozhyk@vozhx-thinkpad ~ % xkbcomp ~/.Xkeymap $DISPLAY &>/dev/null

The same keybindings are {not,} working, except $mod+ampersand it is working now.

@vozhyk-

This comment has been minimized.

Show comment
Hide comment
@vozhyk-

vozhyk- Nov 11, 2017

Running xkbcomp ~/.Xkeymap $DISPLAY &>/dev/null again makes the set of {non-,}working keybindings different. Sometimes it makes only $mod+equal, $mod+parenright and Control+Mod1+q not work, and most of the time it makes all the keybindings work.

Output of i3 --moreversion 2>&- || i3 --version:

Binary i3 version:  4.14 (2017-09-04) © 2009 Michael Stapelberg and contributors
Running i3 version: 4.14 (2017-09-04) (pid 11836) abort…)
Loaded i3 config: /home/vozhyk/.i3/config (Last modified: Tue 03 Oct 2017 09:24:28 AM CEST, 3399191 seconds ago)

The i3 binary you just called: /usr/bin/i3
The i3 binary you are running: i3

A log from when only $mod+equal, $mod+parenright and Control+Mod1+q don't work: https://logs.i3wm.org/logs/5725202142986240.bz2 - I've restarted i3 with debug logging on, pressed Hyper-= (Hyper-equal) and captured the log.

vozhyk- commented Nov 11, 2017

Running xkbcomp ~/.Xkeymap $DISPLAY &>/dev/null again makes the set of {non-,}working keybindings different. Sometimes it makes only $mod+equal, $mod+parenright and Control+Mod1+q not work, and most of the time it makes all the keybindings work.

Output of i3 --moreversion 2>&- || i3 --version:

Binary i3 version:  4.14 (2017-09-04) © 2009 Michael Stapelberg and contributors
Running i3 version: 4.14 (2017-09-04) (pid 11836) abort…)
Loaded i3 config: /home/vozhyk/.i3/config (Last modified: Tue 03 Oct 2017 09:24:28 AM CEST, 3399191 seconds ago)

The i3 binary you just called: /usr/bin/i3
The i3 binary you are running: i3

A log from when only $mod+equal, $mod+parenright and Control+Mod1+q don't work: https://logs.i3wm.org/logs/5725202142986240.bz2 - I've restarted i3 with debug logging on, pressed Hyper-= (Hyper-equal) and captured the log.

@Airblader Airblader added 4.14 and removed needs info 4.13 labels Dec 25, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment