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

A{Any} and two keyboards #207

Closed
marek-g opened this issue Dec 14, 2024 · 10 comments
Closed

A{Any} and two keyboards #207

marek-g opened this issue Dec 14, 2024 · 10 comments

Comments

@marek-g
Copy link

marek-g commented Dec 14, 2024

Thx for this great app!!!

I'm playing with two physical keyboards as a poor man's split keyboard. One keyboard for left hand, other keyboard for right hand.

When I use this config:

Space{Any} >> Shift{Any}

It works as expected on a single keyboard:

  • When I press and release Space it works like a space.
  • When I press Space + press a - it works like Shift + A.

But when I:

  • press Space on the first keyboard
  • press A on the second keyboard
  • release A
  • release Space

I receive sequence of:

  • press A
  • release A
  • press Space
  • release Space

where last two are unexpected.

If I use this config:

Space >> Shift

Space works correctly as shift with letters on both keyboards, but I cannot use it as a space.

I'm using keymapperd v4.9.1 for Linux.

@ristomatti
Copy link
Contributor

Great experiment! Does it help if you explicitly release Space, e.g.:

Space{Any} >> !Space Shift{Any}

@marek-g
Copy link
Author

marek-g commented Dec 19, 2024

Thx! I have crazy ideas sometimes. My left hand keyboard is a cheap half-keyboard (Redragon K585 wired for $32). Right hand is normal keyboard, but if I put my forefinger on letter A I have a thumb cluster made of Ctrl, LWin, Alt & Space :) More than enough to test how it is like to use split-keyboard.

Unfortunately, this:

Space{Any} >> !Space Shift{Any}

behaves exactly the same. Doesn't block Space. I tried also this with the same effect:

Space{Any} >> !Space Shift{Any} ^ !Space

But please treat it as a low priority. I may be the only person using it like this. And I don't know yet which layout will work for me finally. There are so many possibilities.... Fortunately, standard modifiers (like Space >> ControlLeft) works between 2 keyboards and that's the most important! That means that I will be able to setup something useful.

@ristomatti
Copy link
Contributor

How about the "inverse" method? E.g.

Space{!200ms} >> Space
Space         >> !Space Shift

@marek-g
Copy link
Author

marek-g commented Dec 21, 2024

An interesting approach. I like that after 200 ms the space bar is not a space anymore. I can change my mind and release the key without any consequences.

Yes. This "inverse" method is a good workaround. It resolves the problem in practice.

In practice, because the bug is still there. It is just that now additional "shift" instead of "space" is pressed and released at the end. Only when mixing the keyboards. But for modifiers it doesn't matter in normal usage. Thank you very much!

@marek-g marek-g closed this as completed Dec 21, 2024
@marek-g
Copy link
Author

marek-g commented Dec 21, 2024

FYI. If I do the same with "AltRight" instead of "Shift" (I'm using "AltRight" with letters to get Polish letters) and mix keyboards it inserts 0xA0 character before Polish letter. [EDIT: so it's not so invisible as with a space].

But I'm not reopening it yet as I don't know if I need that working :) In the worst case I can try to debug it myself to not take your time on such very unusual use case. Thanks for help!

EDIT: 0xA0 is Alt + Space, hitting SPACE (on keyboard 1) + A (on keyboard 2) can generate something strange as: Alt down, Space down, Space up, A down, A up, Alt up.

Space{!200ms} >> Space
Space         >> !Space AltRight

@ristomatti
Copy link
Contributor

Happy to hear it worked. Interesting findings!

@marek-g
Copy link
Author

marek-g commented Dec 22, 2024

Final solution: mapping tap/hold keys to Virtual Keys first solves all problems with using them with 2-keyboards!

@ristomatti
Copy link
Contributor

That's what I would've suggested next. 🙂

@houmain
Copy link
Owner

houmain commented Dec 23, 2024

Thanks for reporting! I finally found the time to investigate this.
The problem is, that the first keyboard, where the Space is hold, keeps sending key-repeat events, even after keys on the second one were pressed.
With the latest commit your initial configuration should also work.

@marek-g
Copy link
Author

marek-g commented Dec 24, 2024

Thanks for fixing @houmain! Key-repeat events - that explains that strange behavior.

I'm very happy (even without the fix) as using Virtual Keys + stages also solved the problem. But I'll try it with the next release.

And it's amazing, because I don't know about any other key mapping tool that's so versatile (or even does half of what keymapper does). It has a simple but powerful syntax (no need to draw ascii art keyboards), can execute commands, works on multiple OSes, with multiple input devices (!), is application aware (!!), has convenient tray icon (!!!). This is so good. Thx!

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

No branches or pull requests

3 participants