Hyprland icon indicating copy to clipboard operation
Hyprland copied to clipboard

[Feature]: Binding keys to specific devices

Open Euro20179 opened this issue 2 years ago • 1 comments

It would be cool if each device could have binds specifically for that device. In the config file it would look something like this:

device:some-device {
    bind=SUPER,w,exec,notify-send "pressed w with <some-device>"
}

Another solution, would be to be able to interact with key presses in a script. maybe hyprland can write keypresses (with the device that caused it) to the event socket, or a special one specifically for key presses.

Euro20179 avatar Jan 26 '23 22:01 Euro20179

Another solution, would be to be able to interact with key presses in a script. maybe hyprland can write keypresses (with the device that caused it) to the event socket, or a special one specifically for key presses.

no, cuz keyloggers.

vaxerski avatar Jan 26 '23 22:01 vaxerski

I am also very interested in the addition of device-specific binds.

This would allow me to forgo input-remapper completely, and make my Razer Naga side buttons actually functional by default.

trm109 avatar Apr 08 '23 01:04 trm109

~~Upon some digging around, I think its already implemented, see~~ https://wiki.hyprland.org/Configuring/Keywords/#per-device-input-configs

Edit: It does not work.

device: razer-naga-pro {
    bind=SUPER,mouse:272,exec, notify-send "test"
}

This bind will activate with both the touchpad and my Razer device.

trm109 avatar Apr 08 '23 01:04 trm109

I have another use case, unless there is a solution for that: I have two keyboards: one that only does qwerty, so I set it's keymap to colemak in software (hyprland here), and one that outputs colemak, so I configure a us or eurkey key for this device.

Now, when I try SUPER+d from one keyboard, it open wofi, but on the colemak one I end up having to use SUPER+g which ends up being a key at a different position than the D on colemak.

Is there any way to make that work?

abondis avatar Apr 16 '23 18:04 abondis

Would also love to see this functionality natively in hyprland. If the devs aren't interested or as a stop gap the mention of tools such as input-remaper on the wiki would be greatly appreciated.

Bug23451 avatar May 23 '23 06:05 Bug23451

If the devs aren't interested

hah, devs, lol, I wish there were multiple of me.

It's not "not interested", it's "not a priority and I have 294 other open issues"

If you feel the wiki could use a mention, make a pr to it.

If you feel hl could use a feature, make a pr to it.

vaxerski avatar May 23 '23 12:05 vaxerski