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

Mapping simultaneous letter keys to modifier #1

Closed
wshanks opened this issue Jan 28, 2014 · 3 comments
Closed

Mapping simultaneous letter keys to modifier #1

wshanks opened this issue Jan 28, 2014 · 3 comments
Labels

Comments

@wshanks
Copy link

wshanks commented Jan 28, 2014

I wanted to follow up on the discussion in alols/xcape/alols#28 but since alols did not seem interested in the issue I am asking you here instead. I am interested in doing something like what is discussed in this issue. I posted a question on a similar topic on stackexchange. Basically, I want something like Simultaneous Vi Mode of KeyRemap4MacBook, if you are familiar with that.

What did you mean in your xcape example about mapping both s and l to AltGr? In the discussion of the xcape issue, you wrote that the example was a modification of what you use. What do you actually use and does it work well?

@joetw
Copy link
Owner

joetw commented Jan 29, 2014

When I chimed in in the discussion over there, I didn't take into account that xcape does not replace or suppress key events, but merely appends fake events to the real ones. I.e. in the default Ctrl_L/Esc behavior, if you hit Ctrl_L on its own, the application will seeCtrl_L pressed and released, then Esc pressed and released. You can check that with the tool xev. The app will ignore Ctrl_L simply because a lone modifier does not mean anything to most applications. Therefore modifying xcape for your needs seems to be much harder; I don't know how to do it.

What did you mean in your xcape example about mapping both s and l to AltGr? In the discussion of the xcape issue, you wrote that the example was a modification of what you use. What do you actually use and does it work well?

What I actually do is unfortunately technically rather unrelated, it's just similar in effect: I find that the most convenient modifiers on my keyboard (Super_L and _R) are the ones I never use at all. So I simply set both of them to AltGr with Xmodmap. Now I can touch-type fairly well using the logical AltGr, even if it's still far from the home row.

The s and l example moves AltGr up to the home row: Xmodmap changes both s and l to AltGr; plus xcape then needs to restore the ordinary s and l functions.

XKB seems the way to go for you, but I know nearly nothing about it. The archlinux wiki page on XKB seems like a good introduction.

I suspect what you describe on Stack Exchange, no matter what tool you use, will need to take some kind of timeout into account. How else could s+d+l be distinguished from quickly typing "sdl"? At a glance, I saw timing functionality in XKB's accessibility functions. Maybe you could use those and activate them selectively.

@joetw joetw closed this as completed Jan 29, 2014
@wshanks
Copy link
Author

wshanks commented Jan 29, 2014

Thanks for the reply. Yes, there has to be some timing element to this functionality. Hitting s or d needs to open a time window in which pressing the other activates a modifier and captures subsequent s or d events until either key is released. If that time window ends without both s and d pressed or another key is pressed, the window needs to close and the s or d key event be sent.

I was thinking I would probably need to make a new program like xcape to get this functionality (if I can't find one already written; however, I might just get a keyboard with more modifier keys like yours if this is too hard to do). In general, it seems people only use xkb to map individual keys (plus some number of modifiers) to other keys plus modifiers. Do you know where you saw the discussion of xkb and accessibility? I don't see that on the Arch Wiki or in the other documentation it links to.

@joetw
Copy link
Owner

joetw commented Jan 29, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants