joystick as a scanner keystroke source

Asked by Alexander

I try to use onboard as an input system for a disabled person with partial one-hand activity. It's quite convenient for him to use 4 button + trigger on the typical gamepad.

However I can't use game-pad as scanner keystroke source, neither directly, nor with qjoypad.

1. Is there a way to make it work? Probably someone has an experimental branch with this feature?
Can someone give me an estimate how difficult it is to code this (I'm advanced C++ programmer, but never used python for large projects)?

2. Probably there are gamepads that present themselves as HID device (as a mouse)? Has someone seen anything like this?

OS: Kubuntu 16.04
App: onboard 1.1.2-0ubuntu1 and onboard 1.3
Joystick: Logitech F710

Question information

Language:
English Edit question
Status:
Solved
For:
Onboard Edit question
Assignee:
No assignee Edit question
Solved by:
marmuta
Solved:
Last query:
Last reply:
Revision history for this message
Best marmuta (marmuta) said :
#1

Right, Onboard looks for xinput devices only and it seems that gamepads are usually only visible at the evdev level.
Basically we would need to get your gampad listed by this command:
$ xinput

> 1. Is there a way to make it work?

xserver-xorg-input-joystick might do that:
sudo apt-get install xserver-xorg-input-joystick
I'm not sure if it has to be configured, or just works out of the box. This question suggests no configuration necessary:
https://askubuntu.com/questions/33672/joystick-acts-as-mouse-wont-stop

Alternatively, try qjoypad
http://qjoypad.sourceforge.net/
sudo apt-get install qjoypad

or rejoystick
http://rejoystick.sourceforge.net/

to map button presses to mouse button presses. IIRC, mapping to key strokes wouldn't work with Onboard, because it internally blacklists the XTest keyboard device.

>2. Probably there are gamepads that present themselves as HID device (as a mouse)?
> Has someone seen anything like this?
As I understand it, as long a particular gampad is supported by the linux kernel, you should get one or more evdev device files /dev/input/event* for it. You can use
$ sudo evtest
to test a particular device file.
If this exists, then it should be possible to create an xinput device from that, one way or another, see above. I would try xserver-xorg-input-joystick first.

Revision history for this message
Alexander (calvrack) said :
#2

Thanks marmuta, that solved my question.