Redirect /dev/input/js0 to a program or window.

None Oyabusiness linuxhooligan at
Sat May 18 17:42:43 UTC 2024

Is it possible to redirect /dev/input/js0 to a running program or
window regardless of focus of said window?

Use Case:

1) I am programming in Lisp + emacs + slime.  The dev loop is really
short and there are a lot of places where I make a change to a form,
compile a form and just want to pick up the joystick to test the
results without leaving my ide in order to focus the window in order
for the js0 events to be sent to that window.

The ideal configuration would be to stay in my ide  with the window
focus remaining on the ide window and the open game render engine
window open and receiving input from the joystick.  This would allow
me to code, C-c, pick up joystick to test, code, C-c, pick up joystick
... repeat ... etc.

2) I use an array of window managers including Stumpwm and none of
them seem to have the ability to do this making me suspect that this
has to be handled at the level of Xorg if it can be done at all.

3) Different window managers have different quality of life features
including Stumpwm which allows me to do certain things to get closer
to the ideal use case interactive state above.  However, the reality
is that all window managers see to set the focus of the window based
on some cursor or key event forcing me out of the ide.  It would be
lovely if I can keep all device input follow the expected focus policy
and manually setup redirection of input for the joystick and assign it
to an arbitrary window or running program (whatever might the
appropriate term for the target).

Is this possible?  If so, how?  What do I need to read, what do I need
to learn about?

Thank you kindly!


More information about the xorg mailing list