Skip to content

Added multi keyboard support.#92

Open
SamuelFontes wants to merge 1 commit intodonniebreve:mainfrom
SamuelFontes:main
Open

Added multi keyboard support.#92
SamuelFontes wants to merge 1 commit intodonniebreve:mainfrom
SamuelFontes:main

Conversation

@SamuelFontes
Copy link

This change make it supports multiple keyboards at the same time, as before it was a nightmare to use in a laptop when switching between my dock station and the couch. This makes it possible to use an external keyboard and the laptop keyboard without having to change the keyboard order manually every time.
Not sure this will be useful as it requires a lot of changes, I made this change for myself and think it might be useful for people that have the same problem.

This change make it supports multiple keyboards at the same time, as before it was a nightmare to use it in a docked laptop.
This makes it possible to use an external keyboard and the laptop keyboard without having to change the keyboard order manually every time.
@donniebreve
Copy link
Owner

Thanks for your PR @SamuelFontes! I would like a little bit of time to look at this because the way you're treating all the captured keyboards as one makes me think you're going to have strange edge cases with pressed keys or modes. I'm guessing, but is it possible with this change to press and hold Space on the external keyboard and then use the layer keys on the laptop keyboard?

This makes it possible to use an external keyboard and the laptop keyboard without having to change the keyboard order manually every time.

Could you describe this a little more? If you put the external keyboard first in the list, it should pick that up when docked and then pick up the laptop keyboard when not docked.

I think it was planned to detect keyboard plug/unplug and then reload captured devices. Do you think that might be an acceptable solution to your problem?

@SamuelFontes
Copy link
Author

Thanks for your PR @SamuelFontes! I would like a little bit of time to look at this because the way you're treating all the captured keyboards as one makes me think you're going to have strange edge cases with pressed keys or modes. I'm guessing, but is it possible with this change to press and hold Space on the external keyboard and then use the layer keys on the laptop keyboard?

With the changes I've made, they are all really treated as the same keyboard, meaning holding space on my external keyboard activates the shortcuts on my laptop also as a side effect.
I'm not sure what use cases people really use this for, so I'm not aware of what this might break. I only use it for activating global vim like keybinds to use HJKL as my arrow keys everywhere.

Could you describe this a little more? If you put the external keyboard first in the list, it should pick that up when docked and then pick up the laptop keyboard when not docked.

I had no idea this was a feature. I've tested it, and it really works if my external keyboard is at the top of the list.

Maybe this could be better explained in the Readme, as if I knew this was a feature I wouldn't have gone through the trouble of adding multiple keyboard support.

Although this requires restarting the service for the changes to apply.

I think it was planned to detect keyboard plug/unplug and then reload captured devices. Do you think that might be an acceptable solution to your problem?

That would definitely solve the problem, and it would not require changing everything like I did.

Thanks for taking a look at it, if it can detect the keyboard was unplugged, that would solve my problem and I can stop using my hacky fork.

@auouymous
Copy link
Contributor

treating all the captured keyboards as one

The service should capture all keyboards and emit events to a single output. It can then track modifier presses across keyboards and only emit once, and only emit a release after the last is released.

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

Successfully merging this pull request may close these issues.

3 participants