question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't use key combinations such as `Ctrl+Alt+F2` to switch to a different virtual console

See original GitHub issue

On other wayland compositors (e.g. river, sway) and X11 window managers, I can use key combinations such as Ctrl+Alt+F2 to switch to a different virtual console. In Qtile, this key combination has no effect. I have verified that the problem occurs with the default configuration. Perhaps Qtile is somehow “grabbing” certain keys.

$ qtile -v
0.18.1

To investigate this issue, I launched wev from within Sway and pressed Ctrl+Alt+F2. Note that wev only reports the Ctrl and Alt press and release (at which point I was switched to virtual console 2).

[14:     wl_keyboard] key: serial: 602; time: 93610128; key: 37; state: 1 (pressed)
                      sym: Control_L    (65507), utf8: ''
[14:     wl_keyboard] modifiers: serial: 0; group: 0
                      depressed: 00000004: Control
                      latched: 00000000
                      locked: 00000000
[14:     wl_keyboard] key: serial: 604; time: 93610376; key: 64; state: 1 (pressed)
                      sym: Alt_L        (65513), utf8: ''
[14:     wl_keyboard] modifiers: serial: 0; group: 0
                      depressed: 0000000C: Control Mod1
                      latched: 00000000
                      locked: 00000000
[14:     wl_keyboard] key: serial: 606; time: 93610740; key: 37; state: 0 (released)
                      sym: Control_L    (65507), utf8: ''
[14:     wl_keyboard] modifiers: serial: 0; group: 0
                      depressed: 00000008: Mod1
                      latched: 00000000
                      locked: 00000000
[14:     wl_keyboard] key: serial: 608; time: 93610740; key: 64; state: 0 (released)
                      sym: Alt_L        (65513), utf8: ''
[14:     wl_keyboard] modifiers: serial: 0; group: 0
                      depressed: 00000000
                      latched: 00000000
                      locked: 00000000

Now compare this with what happens when I launched wev from within Qtile and pressed Ctrl+Alt+F2. Note that all three key press and release events are reported.

14:     wl_keyboard] key: serial: 144; time: 93748304; key: 37; state: 1 (pressed)
                      sym: Control_L    (65507), utf8: ''
[14:     wl_keyboard] modifiers: serial: 0; group: 0
                      depressed: 00000004: Control
                      latched: 00000000
                      locked: 00000000
[14:     wl_keyboard] key: serial: 146; time: 93748695; key: 64; state: 1 (pressed)
                      sym: Alt_L        (65513), utf8: ''
[14:     wl_keyboard] modifiers: serial: 0; group: 0
                      depressed: 0000000C: Control Mod1
                      latched: 00000000
                      locked: 00000000
[14:     wl_keyboard] key: serial: 148; time: 93749077; key: 68; state: 1 (pressed)
                      sym: XF86Switch_VT_2 (269024770), utf8: ''
[14:     wl_keyboard] key: serial: 149; time: 93749184; key: 68; state: 0 (released)
                      sym: XF86Switch_VT_2 (269024770), utf8: ''
[14:     wl_keyboard] key: serial: 150; time: 93749504; key: 64; state: 0 (released)
                      sym: Alt_L        (65513), utf8: ''
[14:     wl_keyboard] modifiers: serial: 0; group: 0
                      depressed: 00000004: Control
                      latched: 00000000
                      locked: 00000000
[14:     wl_keyboard] key: serial: 152; time: 93749552; key: 37; state: 0 (released)
                      sym: Control_L    (65507), utf8: ''
[14:     wl_keyboard] modifiers: serial: 0; group: 0
                      depressed: 00000000
                      latched: 00000000
                      locked: 00000000

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mhwombatcommented, Nov 27, 2021
0reactions
mhwombatcommented, Nov 27, 2021

It works! Thank you so much for the assistance. For the record, here’s the relevant snippet from the working configuration:

    Key(["mod1", "control"], "F1", lazy.change_vt(1), desc="Go to virtual console 1"),
    Key(["mod1", "control"], "F2", lazy.change_vt(2), desc="Go to virtual console 2"),
    Key(["mod1", "control"], "F3", lazy.change_vt(3), desc="Go to virtual console 3"),
    Key(["mod1", "control"], "F4", lazy.change_vt(4), desc="Go to virtual console 4"),
    Key(["mod1", "control"], "F5", lazy.change_vt(5), desc="Go to virtual console 5"),
    Key(["mod1", "control"], "F6", lazy.change_vt(6), desc="Go to virtual console 6"),
    Key(["mod1", "control"], "F7", lazy.change_vt(7), desc="Go to virtual console 7"),
    Key(["mod1", "control"], "F8", lazy.change_vt(8), desc="Go to virtual console 8"),
    Key(["mod1", "control"], "F9", lazy.change_vt(9), desc="Go to virtual console 9"),

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I get to a terminal or virtual console when Ctrl-Alt-F2 ...
Another thing you can try is the magic SysRq key: press Alt + SysRq + R to switch the keyboard away from raw...
Read more >
Cannot switch to virtual consoles with Ctrl Alt Fx - Ask Ubuntu
I cannot switch from the GUI to any virtual console using Ctrl + Alt + Fx for any x=1,2,... (or any key combination...
Read more >
CTRL ALT F2 once and for all!! - VMware Communities
I need to somehow change the key bindings in vSphere client ... rather than use the client to view the VM's console.
Read more >
Display corruption when switching virtual terminals in Linux
For example, if I was watching a youtube video in VT1 and press CTRL-ALT-F2 to switch to VT2, where I am logged in...
Read more >
[Solved] Switching virtual consoles and some keys stop ...
I also can't switch between virtual consoles with the keyboard ... and was unable to change to another tty using the alt+F* key...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found