How to lock a HID device to a specific window or screen?
On kde/wayland
i want to lock a keyboard and controller so they are only seen by one window, as in inputs only go that window and it cant move elsewhere.
Also using nixos.
It’s sort of possible, but you’d need to build an accessibility extension for KDE to do so.
Can you be more specific about what you’re trying to do?
My use case is an expo, we have a game people can play on display and I’m doing things on my main screen, ideally I can continue doing work while people try the game but at the bare minimum I would like the keyboard to he restricted to that app.
Ah, then you probably want KDE’s kiosk mode for a second screen with a second user that you can set the defined activity for. Should be quick and easy that way versus trying to split a session and window input.
There’s a kiosk-style compositor called
cagethat would work, at least for your main concern.Then maybe use waypipe over ssh to do your work in the background. Alternatively, you can research setting up a multi-seat display manager, but I think you would need at least 2 GPUs to implement that properly.
Don’t know if this is possible. What’s your endgoal? Maybe there’s a workaround.
One way of running multiple monitors used to be that you’d actually run two X sessions. Maybe you could do something similar where you assigned the devices to different X sessions. Of course that wouldn’t fit your Wayland requirement.
My use case is an expo, we have a game people can play on display and I’m doing things on my main screen, ideally I can continue doing work while people try the game but at the bare minimum I would like the keyboard to he restricted to that app.
I wouldn’t entrust such an important display to some hacky solution a bunch of Lemmy users can come up with. Set up a normal kiosk environment and do your work on a second machine. You can ssh or even Sunshine/Moonlight into the gaming machine if you have to do something there.
But you don’t want something a potential customer does on the game to crash your work or vice versa. Or even worse something goes wrong and the customers can suddenly see your work on their screen. Best to separate those things as much as possible.
Stupid idea I just had. Maybe you could try restricting the respective devices to a single user or group and run that application as a different user. No idea if that would work or how Wayland reacts to apps started as a different user.


