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

How does your Hyper modifier work? #167

Open
RedBearAK opened this issue Sep 11, 2024 · 2 comments
Open

How does your Hyper modifier work? #167

RedBearAK opened this issue Sep 11, 2024 · 2 comments
Labels
enhancement New feature or request request Feature request

Comments

@RedBearAK
Copy link
Contributor

@joshgoebel

I've got someone asking how to implement a Hyper key modifier with keyszer. I know you talked about having a Hyper key in your configuration. Would you mind spilling the secrets on how you did that? Did you modify modifier.py or implement it entirely within your config file?

One catch is that they want the Hyper key to become a combination of Ctrl+Alt+Super (leaving Shift out for optional further combinations). If I understand the current code for modmapping in keyszer, it only supports changing one key into another single key. So what does your Hyper modifier actually send out from the virtual keyboard, and how do you make that do useful things?

@RedBearAK RedBearAK added enhancement New feature or request request Feature request labels Sep 11, 2024
@joshgoebel
Copy link
Owner

https://github.com/joshgoebel/keyszer/wiki/Hyper

@RedBearAK
Copy link
Contributor Author

RedBearAK commented Sep 12, 2024

Oh, thanks. I should have checked the Wiki.

The part that confuses me most is F24 (the key I'm reusing) is 194 to the kernel (and key.py BUT xmodmap seems to assign it keycode 202 (confirmed by using xev_... There seems to be this offset in what both are calling the "keycode" for a lot of keys that I don't understand.

I think this is the offset (+8) between the kernel value and the evdev key value that is actually defined in keymaps. As in the real keymaps that the input system uses to translate the raw key codes into evdev values and then symbols according to the chosen keyboard layout. I ran into that offset when attempting to dump keymaps (with xkbcommon) and match the key codes to symbols, while I was investigating the possibility of getting the keymapper to work better with non-US keyboard layouts.

So you're using .Xmodmap as part of your setup, to just be able to refer to it as "Hyper_L" in your WM config more conventiently, I guess. I suppose you haven't tried to step into the Wayland space yet.

I was trying to use F19 instead of F24, because it's been useful for other purposes, due to nothing generally being assigned to it naturally. I've only been able to get the resulting Hyper modifier working from a modmap(), but it won't work from a multipurpose_modmap(). The user wants it to be on CapsLock, with Escape as the "tapped" key, and Hyper as the "held" key.

Well, actually I just figured something out, but I didn't think the multi-modmaps worked like this. If I set the multipurpose timeout to something shorter like 0.15 seconds, I can reasonably "tap" and use the key as a "held" modifier. I thought the "held" part was supposed to activate when the key is combined with another key, even if the timeout hasn't elapsed yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request request Feature request
Projects
None yet
Development

No branches or pull requests

2 participants