Open donniebreve opened 1 year ago
Detect if new keyboard was unplugged/plugged in, change the selected device in config file based on actively used keyboard
I have a working patch set (about three dozen patches) that closes most issues, except for this one. It adds support for multiple simultaneous active keyboards, fixing #12 and #51, which sounds like what @1999shaswat is asking here. I'll post it once I finish cleaning and documenting, hopefully in the next week or two.
This issue sounds like detecting keyboards that are not in the config and then modifying the configuration file. That would need to be optional as some might not want the service to be running on a certain keyboard. My patches also add layer support with various action binds. It is mostly fully compatible with existing config files.
[Bindings]
M="μ"
[a-device]
(device "its name")
SPACE=(overload Bindings)
[another-device]
(device "its name")
[Remap]
CAPSLOCK=ESC
ESC=(overload CTRL timeout=750)
# capslock is ctrl or esc
That makes it complicated to detect new keyboards and automatically add them to the config. But maybe it could append a commented section to the config to make the user's job a little easier.
#[new-device-{id}]
# (device "its name")
@auouymous I was testing out your code. First of all, thanks a lot for your contribution :)
My Setup
Working
Issue
You need to send a HUP signal to touchcursor when connecting devices. Use kill or pkill and -HUP
. This is also needed after making changes to the conf file if you have disable-automatic-reload enabled in it.
Can I do it automatically when a keyboard is connected? If yes, can you please guide me?
Work on the keyboard detection logic and attempt to detect the keyboard on installation. If a keyboard is found, add it to the default configuration file.
TODO: Add more details here