Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] Ctrl+z does not work in Xorg
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
hrnick
Guru
Guru


Joined: 31 Aug 2002
Posts: 425
Location: Sweden

PostPosted: Sat Nov 07, 2020 10:39 pm    Post subject: [Solved] Ctrl+z does not work in Xorg Reply with quote

Earlier this year I installed a brand new Gentoo system. Ever since I haven't been able to use ctrl+z in xorg and by now it's more than a minor annoyance...

Other keyboard shortcuts work like expected, if I have LibreOffice open I can use Ctrl+x, Ctrl+c, Ctrl+v, Ctrl+p, Ctrl+a, Ctrl+s etc. but not Ctrl+z. I can't even seem to generate Ctrl+z using xdotool. It's like if something else grabs the key

Sending a running process to the background in bash in a virtual console using Ctrl+z but not in a bash shell in xorg.

I've also tried two different keyboards with the same result and they both work fine on a Window system so hardware error could most likely be ruled out.

Pressing z alone:
Code:
$ xev -event keyboard

[...]

KeyPress event, serial 28, synthetic NO, window 0x2400001,
    root 0x1e1, subw 0x0, time 1837572, (3409,1892), root:(3409,1892),
    state 0x10, keycode 52 (keysym 0x7a, z), same_screen YES,
    XLookupString gives 1 bytes: (7a) "z"
    XmbLookupString gives 1 bytes: (7a) "z"
    XFilterEvent returns: False

KeyRelease event, serial 28, synthetic NO, window 0x2400001,
    root 0x1e1, subw 0x0, time 1837692, (3409,1892), root:(3409,1892),
    state 0x10, keycode 52 (keysym 0x7a, z), same_screen YES,
    XLookupString gives 1 bytes: (7a) "z"
    XFilterEvent returns: False


Pressing Ctrl+z:
Code:
$ xev -event keyboard

[...]

KeyPress event, serial 28, synthetic NO, window 0x2200001,
    root 0x1e1, subw 0x0, time 1589012, (312,228), root:(352,308),
    state 0x10, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeymapNotify event, serial 28, synthetic NO, window 0x0,
    keys:  4294967265 0   0   0   32  0   0   0   0   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 28, synthetic NO, window 0x2200001,
    root 0x1e1, subw 0x0, time 1589900, (312,228), root:(352,308),
    state 0x14, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False


Pressing Ctrl+x:
Code:
$ xev -event keyboard

[...]

KeyPress event, serial 28, synthetic NO, window 0x2400001,
    root 0x1e1, subw 0x0, time 2201892, (717,1617), root:(777,1737),
    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 28, synthetic NO, window 0x2400001,
    root 0x1e1, subw 0x0, time 2201972, (717,1617), root:(777,1737),
    state 0x14, keycode 53 (keysym 0x78, x), same_screen YES,
    XLookupString gives 1 bytes: (18) ""
    XmbLookupString gives 1 bytes: (18) ""
    XFilterEvent returns: False

KeyRelease event, serial 28, synthetic NO, window 0x2400001,
    root 0x1e1, subw 0x0, time 2202060, (717,1617), root:(777,1737),
    state 0x14, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 28, synthetic NO, window 0x2400001,
    root 0x1e1, subw 0x0, time 2202076, (717,1617), root:(777,1737),
    state 0x10, keycode 53 (keysym 0x78, x), same_screen YES,
    XLookupString gives 1 bytes: (78) "x"
    XFilterEvent returns: False


I don't even know where to start looking. Any ideas?


Last edited by hrnick on Sun Nov 08, 2020 8:41 am; edited 1 time in total
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4438
Location: Frankfurt, Germany

PostPosted: Sat Nov 07, 2020 11:16 pm    Post subject: Reply with quote

Do you use X11? Or Wayland?

Please show us the output of
Code:
egrep "(xkb_|KEYBOARD)" /var/log/Xorg.0.log
Back to top
View user's profile Send private message
hrnick
Guru
Guru


Joined: 31 Aug 2002
Posts: 425
Location: Sweden

PostPosted: Sat Nov 07, 2020 11:21 pm    Post subject: Reply with quote

Sorry, that's of course relevant nowadays. I'm using X11.

Code:
$ egrep "(xkb_|KEYBOARD)" /var/log/Xorg.0.log
[916255.012] (II) Initializing extension XKEYBOARD
[916255.036] (II) XINPUT: Adding extended input device "Power Button" (type: KEYBOARD, id 6)
[916255.036] (**) Option "xkb_layout" "se"
[916255.053] (II) XINPUT: Adding extended input device "Power Button" (type: KEYBOARD, id 7)
[916255.053] (**) Option "xkb_layout" "se"
[916255.062] (II) XINPUT: Adding extended input device "Sleep Button" (type: KEYBOARD, id 8)
[916255.062] (**) Option "xkb_layout" "se"
[916255.078] (II) XINPUT: Adding extended input device "Logitech USB Keyboard" (type: KEYBOARD, id 9)
[916255.078] (**) Option "xkb_layout" "se"
[916255.105] (II) XINPUT: Adding extended input device "Logitech USB Keyboard System Control" (type: KEYBOARD, id 11)
[916255.105] (**) Option "xkb_layout" "se"
[916255.250] (II) XINPUT: Adding extended input device "flirc.tv flirc Keyboard" (type: KEYBOARD, id 13)
[916255.250] (**) Option "xkb_layout" "se"
[916255.282] (II) XINPUT: Adding extended input device "flirc.tv flirc System Control" (type: KEYBOARD, id 15)
[916255.282] (**) Option "xkb_layout" "se"
[916255.293] (II) XINPUT: Adding extended input device "Logitech USB Keyboard Consumer Control" (type: KEYBOARD, id 16)
[916255.293] (**) Option "xkb_layout" "se"
[916255.293] (II) XINPUT: Adding extended input device "flirc.tv flirc Consumer Control" (type: KEYBOARD, id 17)
[916255.293] (**) Option "xkb_layout" "se"
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 21709

PostPosted: Sun Nov 08, 2020 12:38 am    Post subject: Reply with quote

What window manager do you use, and how did you configure it? Some window managers, when configured to use a key sequence as a shortcut, will inhibit that key sequence from reaching the main X applications. Perhaps your window manager is intercepting Ctrl+Z, but whatever handling it does produces no noticeable results, so the key appears dead, rather than repurposed.
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Sun Nov 08, 2020 4:38 am    Post subject: Reply with quote

Does it detect all the keys in a raw console? `showkey -k` should print separate key down/up events for Control_L(29)/Control_R(97)/Z(44). `showkey -s` will print out more detail but it's harder to read.
Back to top
View user's profile Send private message
hrnick
Guru
Guru


Joined: 31 Aug 2002
Posts: 425
Location: Sweden

PostPosted: Sun Nov 08, 2020 8:41 am    Post subject: Reply with quote

Hu wrote:
What window manager do you use, and how did you configure it? Some window managers, when configured to use a key sequence as a shortcut, will inhibit that key sequence from reaching the main X applications. Perhaps your window manager is intercepting Ctrl+Z, but whatever handling it does produces no noticeable results, so the key appears dead, rather than repurposed.

Thanks Hu, that's great detective work! It turns out that there was an error in om 10+ year FVWM config. I have no idea how that happened but a missing M made it trigger on Ctrl+z instead of Ctrl+Alt+z and a broken script did that nothing ever executed. It feels like I should have figured this one out myself but thanks for pointing me in the right direction!
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 21709

PostPosted: Sun Nov 08, 2020 5:33 pm    Post subject: Reply with quote

Well done tracking it down. As an interesting quirk, you can abuse this behavior to intentionally inhibit certain keys being passed to applications. For example, if you use a Push-To-Talk VoIP application that always monitors a particular key, even when it is not in focus, you may wish to prevent that key being passed to the focused application, if it would otherwise react badly to it (such as by taking some action that you do not need/want). You can define an FVWM Key binding for that key, with a target of Nop, to inhibit it being passed to applications. (Most applications that monitor the keyboard while not in focus use an alternate input method that can still see the key.)
Back to top
View user's profile Send private message
hrnick
Guru
Guru


Joined: 31 Aug 2002
Posts: 425
Location: Sweden

PostPosted: Sun Nov 08, 2020 8:00 pm    Post subject: Reply with quote

Hu wrote:
Well done tracking it down. As an interesting quirk, you can abuse this behavior to intentionally inhibit certain keys being passed to applications. For example, if you use a Push-To-Talk VoIP application that always monitors a particular key, even when it is not in focus, you may wish to prevent that key being passed to the focused application, if it would otherwise react badly to it (such as by taking some action that you do not need/want). You can define an FVWM Key binding for that key, with a target of Nop, to inhibit it being passed to applications. (Most applications that monitor the keyboard while not in focus use an alternate input method that can still see the key.)

You did the tracking really. Thanks again! :)

That's a nifty trick that could come in handy!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum