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

Custom shortcut for KEY_EURO and KEY_DOLLAR not working #762

Closed
sebastian-ruiz opened this issue Oct 19, 2022 · 3 comments
Closed

Custom shortcut for KEY_EURO and KEY_DOLLAR not working #762

sebastian-ruiz opened this issue Oct 19, 2022 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@sebastian-ruiz
Copy link

Describe the bug
I have a Dutch Apple Magic keyboard
With this layout I want to type the euro symbol (€) with alt + shift+2
I add this to kinto.py:

K('Alt-Shift-KEY_2'):K('KEY_EURO')

When I try and use my shortcut, nothing happens. Also nothing happens if I try KEY_DOLLAR.

For debugging I try:
K('Alt-Shift-KEY_2'):K('w')
and I get the letter w when I type alt + shift + 2.

So I think something is wrong with KEY_EURO and KEY_DOLLAR.

Thanks for your help!

Install Type: Bare Metal
Distro: Ubuntu 20.04
DE: Gnome
Branch: master
Commit: version: 1.2-13 build e106710

@sebastian-ruiz sebastian-ruiz added the bug Something isn't working label Oct 19, 2022
@RedBearAK
Copy link
Contributor

@sebastian-ruiz

Unfortunately the Python module that actually "types" the remapped output keystrokes (evdev) doesn't have any knowledge of the keyboard layout. So it always acts like it's typing on a US keyboard layout. The KEY_EURO and KEY_DOLLAR key codes are probably not what you should be trying to use.

If you disable Kinto and then type a Euro character as you normally would on that physical keyboard, which physical keys do you use? If you then map onto those keys as the output from your Alt+Shift+Key_2 input, it should result in the Euro character, exactly the same as when you pressed those keys yourself without Kinto running.

@sebastian-ruiz
Copy link
Author

Thank you, this helped me fix the problem!

My config is like this:

K('Alt-Shift-KEY_2'):K('RAlt-Shift-KEY_2'), # map EURO (€) key for NL/EU keyboard
K('Alt-Shift-KEY_3'):K('RAlt-KEY_3'), # map Pound (£) key for NL/EU keyboard

@RedBearAK
Copy link
Contributor

RedBearAK commented Oct 24, 2022

@sebastian-ruiz

As I suspected, this has something to do with the "Alt_Gr" key, which is the key needed to access the special 3rd and 4th characters on some of the keys on international keyboards, and is usually designated to be the "Right Alt" key. Kinto has a feature that allows leaving the Alt key on the right side un-remapped so that it can still be the Alt_Gr key, rather than becoming another Cmd key. But that would only allow these characters to be accessed with the Alt key on the right of the space bar, while these remaps allow either Alt key to be used.

FWIW, the remaps that you've implemented correspond (kind of) to what I call Apple's "Option-key special character entry scheme" where they have a bunch of special characters available on all the letter/number/punctuation keyboard keys when you add Option or Shift+Option. I've documented all of the available characters in this scheme here:

https://github.com/RedBearAK/optspecialchars

I've also implemented this Option-key scheme for the US layout and the "ABC Extended" layout, and it should be available as part of the default config in a future release of Kinto. But for now using this new config requires the user to be knowledgeable enough to switch from using xkeysnail to keyszer as the Kinto key remapper. (And using it while using a non-US keyboard layout may be problematic if any of the letter or number keys are not in the usual QWERTY locations. Some of the special characters may not work correctly because of the way this scheme uses the Linux Unicode character entry technique to produce the characters.)

#750

I will need to look into whether the Option-key scheme has all the special characters in the same locations on real Macs while using international layouts. If so, that would be very interesting.

EDIT: Nope. Switching to "ABC - AZERTY" or "Dutch (Belgian)" seems to have the special characters in very different locations. Choosing "Dutch (Dutch)" yields similar results to the US layout, but not quite the same. Unfortunately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants