ChristopherHGreen · 2022-03-03 16:58
Is there any way to separately define bindings for when the right alt/ctrl keys are used as qualifiers (ie treat them differently than the left ones)? google didn't provide an obvious answer.
I never use those keys. I would like to define at least one of them with a whole lot of bindings for entering unicode symbols (for instance, right-alt-A as the "alpha" symbol). I assume I'd want to set them up to act as "super" or "hyper" in emacs lingo.
This is under windows, but I'm also interested in doing the same thing when I'm running emacs on an AWS linux box (via XMinG under windows).
​
Thanks!
ieure · 2022-03-03 17:27
I have no idea about Windows.
If you want to enter accented characters, you can either use Emacs' built-in [input methods](https://www.gnu.org/software/emacs/manual/html_node/emacs/Input-Methods.html), which work out of the box on every OS. IMO, they're a nice fallback, but rather harder to use than OS-native input mechanisms.
Or, you can use xkb/xmodmap to remap one of your keys to be the [`Multi_key` (aka "compose")](https://wiki.debian.org/XCompose), which lets you enter accented characters consistently in every X11 client.
The Windows key on your keyboard is usually mapped to Super already. There is no mapping for Hyper, but you can use xkb/xmodmap to change one of your keys to one. These are normal modifiers and don't automatically let you enter accented characters, unless you set up explicit bindings which use them that do so.
ChristopherHGreen · 2022-03-03 17:46
I enter a lot of unicode. I know the existing ways to do it in emacs but want a single qualified key (not a prefixed key, -I can't type those as fast, and I'd need to find an unused key for the prefix) for the ones I use the most often.
The windows key isn't an option I think because some of the keys can't be prevented from going to the OS, and I don't want to accidentally hit them and steal focus from my editor :-(.
ieure · 2022-03-03 18:49
Then you either want the Compose key, or to set up Hyper and use your own keymap.
I like the Compose mechanism a lot and use it regularly.
ChristopherHGreen · 2022-03-03 19:12
Are you saying it is possible to map "hyper" to the right alt key under windows? that is my question.
ieure · 2022-03-03 20:13
Like I said:
> I have no idea about Windows.
If you're using X11 you can change any physical key to emit the Hyper keycode.
zenshinji · 2022-03-03 20:50
I did something like this several years ago when I was still a Windows user. I needed to get the right and left side keys to send separate key codes to differentiate them. I /think/ Microsoft had a Windows 7 keymap editor that still worked on Windows 10. I found a list of key codes somewhere that had distinct entries for each side (might have been a Linux reference).
It was super kludgy. I ended up finding a JIS (Japanese layout) physical keyboard that sent distinct codes for the left and right modifiers. If you have the means I suggest finding a physical keyboard that will do what you want without messing with Windows.
ChristopherHGreen · 2022-03-03 21:07
I was able to use the windows powertools keyboard remapper to remap r-ctl to a different virtual keycode, but view-lossage showed it as "unknown", so I don't think I'd be able to bind it to hyper. Also it's a global remap so it would mess up other things that use that key.
It's a shame emacs doesn't just let you bind it (?), it's easy to treat them separately in a program.
eli-zaretskii · 2022-03-04 08:22
Why waste your time on Google when you have the Emacs manual right at your fingertips?
Please read the "Windows Keyboard" node in the Emacs user manual, it should answer your questions. In particular, it explains how to set up the Apps or the Windows key to serve as Super or Hyper modifiers, which AFAIU is what you want.
[deleted] · 2022-03-04 08:46
[deleted]
ChristopherHGreen · 2022-03-04 09:06
I did read all of that. I was just hoping the answer it gave to my question of can I use right-alt or right-ctrl as a qualifier key under windows ( "no" ) was wrong :-).
thanks everyone. I wish you could bind whatever key you wanted to hyper. Seems out of character for emacs to not just allow binding whatever keycode you want.