Sway: annoying Ctrl+F# instead of Alt+Ctrl+F# virtual console switching in sway with wayland

Created on 15 Dec 2020  路  4Comments  路  Source: swaywm/sway

When I press Ctrl+F# (any of the F1 to F12 keys) the display switches to the coresponding virtual console, i.e. this renders Ctrl+F# keys used in many applications unusable. Using Alt+Ctrl+F# also works.

I cannot understand why Ctrl+F# switches to a virtual console.
I tried removing all Console bindings with something like:

sudo dumpkeys | grep -vE 'Console_5[^0-9]'  | sudo loadkeys

but it does not have an effect in sway/wayland.

I also tried srvkeys:none

setxkbmap -layout us -variant dvorak-alt-intl -option srvkeys:none

but it has no effect either.

It doesn't matter if I start sway from gdm or from the shell. (however in a gnome session all is fine)

Please give me a hint, how to find out where the virtual console swithing keybinding is handled! Is it in sway, or is it something else?
Is there a workaround I can try?

Please fill out the following:

asked also at https://unix.stackexchange.com/questions/623873

bug

Most helpful comment

setxkbmap -layout us -variant dvorak-alt-intl -option srvkeys:none

This does not work within sway, since we are not running within an X server. You need to configure your keyboard layout using an input directive in the sway configuration file.

input "*" {
  xkb_options 'srvkeys:none'
}

should be worth a try. man sway-input has more information on the input configuration.

All 4 comments

setxkbmap -layout us -variant dvorak-alt-intl -option srvkeys:none

This does not work within sway, since we are not running within an X server. You need to configure your keyboard layout using an input directive in the sway configuration file.

input "*" {
  xkb_options 'srvkeys:none'
}

should be worth a try. man sway-input has more information on the input configuration.

@Emantor - thanks, this solves my problem. (I was absolutely sure, that I've already tried having a srvkeys:none in the sway config, but it seemed to have no effect; now that it's there, all works fine):

input "type:keyboard" {
  xkb_layout us,de
  xkb_variant dvorak-alt-intl,
  xkb_options 'grp:shifts_toggle,srvkeys:none'
}

@Emantor - there seems to be a bug after all - using grp:alts_toggle together with srvkeys:none leads to the above annoying behaviour, I have to use grp:shifts_toggle,srvkeys:none to make things work as expected.

@Emantor - there seems to be a bug after all - using grp:alts_toggle together with srvkeys:none leads to the above annoying behaviour, I have to use grp:shifts_toggle,srvkeys:none to make things work as expected.

This indeed sounds like a bug, if it doesn't reproduce in X11.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ddevault picture ddevault  路  3Comments

WhyNotHugo picture WhyNotHugo  路  3Comments

Olie440 picture Olie440  路  4Comments

ghost picture ghost  路  4Comments

dnkl picture dnkl  路  4Comments