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

Hyper as Modifier key broken from 1.9 -> 1.10 #8443

Open
hughobrien opened this issue Nov 10, 2024 · 12 comments
Open

Hyper as Modifier key broken from 1.9 -> 1.10 #8443

hughobrien opened this issue Nov 10, 2024 · 12 comments
Labels
bug Not working as intended

Comments

@hughobrien
Copy link

hughobrien commented Nov 10, 2024

Prior to 1.10 I had:

set $mod Mod4

input type:keyboard {
  xkb_options caps:hyper
}

This allowed me to use the caps lock as the modifier key. This broke on 1.10 possibly related to this PR.

Workaround was simple:

set $mod Super

input type:keyboard {
  xkb_options caps:super
}

I don't see any indication that this was an intentional breaking change. Feel free to close if it was.

@hughobrien hughobrien added the bug Not working as intended label Nov 10, 2024
@emersion
Copy link
Member

I don't understand how that commit could've affected your config. That commit should only add a new alias for Mod4, without any other consequences for config files which don't use that name…

@markstos
Copy link
Contributor

After upgrading from 1.9 to 1.10, I could no longer launch Fuzzel with Super+D. It would appear, and then immediately disappear. If I launch Fuzzel from the CLI, it opens fine.

Super alone used to bring up swaybar. I don't use Hyper in my config at all and the only xkb_options I have set was xkb_options ctrl:nocaps.

My bar mode was set to hide:

bar {
   mode hide

   font "pango:Hack 28"
   gaps 15
   icon_theme "Papirus-Dark"

   tray_bindsym BTN_LEFT  Activate
   tray_bindsym BTN_RIGHT ContextMenu

  status_command i3status-rs  ~/.config/sway/i3status-rust.toml
}

This was a show-stopper. I've switched to SwayFx for now.

@emersion
Copy link
Member

Your issue seems unrelated.

@hughobrien
Copy link
Author

I'm trying to bisect and see where the actual change was introduced, but while I do may I ask, should the first example have ever worked? Because I can definitely reproduce it not-working.

@emersion
Copy link
Member

I'm not super sure, I guess it depends on the keyboard layout. "Hyper" is a different key from "Super", and in Sway 1.10 "Super" has the same meaning as "Mod4", and /usr/share/X11/xkb/symbols/pc has this:

    key <SUPR> {[  NoSymbol, Super_L  ]};
    modifier_map Mod4  { <SUPR> };

    key <HYPR> {[  NoSymbol, Hyper_L  ]};
    modifier_map Mod3  { <HYPR> };

@kennylevinsen
Copy link
Member

set $mod Mod4

input type:keyboard {
  xkb_options caps:hyper
}

Sway's intepretation of super and hyper is irrelevant here, as caps:hyper is a named option in your layout as interpreted by libxkbcommon. See /usr/share/X11/xkb/rules/evdev.lst and /usr/share/X11/xkb/rules/evdev.

set $mod Mod4 just sets a variable, it has no effect unless you use said variable.

@hughobrien
Copy link
Author

hughobrien commented Nov 11, 2024

With caps:hyper set wev shows caps as Hyper_L, which seems unchanged from the previous 1.9-ish behaviour.

What seems perhaps to have changed is that Hyper is no longer equivalent to Mod4.

(Edited from previous which mistakenly said Super instead of Hyper)

@emersion
Copy link
Member

What seems perhaps to have changed is that Super is no longer equivalent tot Mod4.

I'm confused. Before Sway 1.10, Super used in a keybind was not recognized. After Sway 1.10, Super used in a keybind is an alias for Mod4.

@hughobrien
Copy link
Author

Apologies I should have said Hyper. Let me update the comment.

@emersion
Copy link
Member

Hyper was never equivalent to Mod4 in Sway config I think. Hyper is not a valid modifier for keybind.

@hughobrien
Copy link
Author

Well for some reason it did work that way for me until the recent change, but if that was UB and now I'm doing things the right way then it's for the best I guess? Happy to close out if there's nothing interesting here.

@hughobrien
Copy link
Author

hughobrien commented Nov 11, 2024

https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/commit/aa709f2f45e7b6164dd583389489043cf92c5b1c

symbols: map Hyper to Mod3 by default
Since Super is more conventional than Hyper, it seems safer to not
change its mappings to Mod4, as it may have been hard-coded in some
apps. Instead, we now default Hyper mapping to Mod3, as it was before
in some options.

And indeed if use caps:hyper and set $mod Mod3 then the old behaviour returns (I'll stick with super).

Thank you everyone for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Not working as intended
Development

No branches or pull requests

4 participants