uinput device doesn't show in gamepad/joystick list

Coşku Baş cosku.bas at gmail.com
Tue Oct 13 12:27:52 PDT 2015


Strangely, setting ID_INPUT_JOYSTICK with an udev rule worked for the 
virtual gamepad but not for the virtual mouse or keyboard.

Right now this is how my custom udev rule looks like:

KERNEL=="uinput", GROUP="wheel", MODE="0660"
SUBSYSTEMS=="input", ATTRS{name}=="Virt Gamepad", 
ENV{ID_INPUT_JOYSTICK}="1"
SUBSYSTEMS=="input", ATTRS{name}=="Virt Keyboard", 
ENV{ID_INPUT_KEYBOARD}="1"
SUBSYSTEMS=="input", ATTRS{name}=="Virt Mouse", ENV{ID_INPUT_MOUSE}="1"

So now evtest successfully recognizes the gamepad but not the mouse nor 
the keyboard.
(Keyboard enables EV_KEY and mouse enables EV_KEY and EV_REL)

Any light to shed?

On Sun, 11 Oct, 2015 at 8:02 AM, Peter Hutterer 
<peter.hutterer at who-t.net> wrote:
> On Sat, Oct 10, 2015 at 06:39:23PM +0300, Coşku Baş wrote:
>>  Hi there,
>> 
>>  I have created a virtual gamepad that mimics the events received 
>> from a
>>  physical gamepad over a network connection.
>> 
>>  To test if the system works I have run evtest and surely the 
>> virtual device
>>  emits the correct events.
>> 
>>  The problem is I can't seem to get any game recognize the virtual 
>> gamepad.
>>  Most of the games I tried use SDL2 so I have run sdl2-jstest 
>> application
>>  and expectedly the virtual device was not listed. Is it possible to
>>  advertise my uinput device as a real gamepad so that games can make 
>> use of
>>  it?
>> 
>>  As a side note, evtest only lists the device if it's ran as root. 
>> Running
>>  sdl2-jstest as root did not made a difference though.
>> 
>>  Any help would be appreciated.
>>  Thanks.
> 
> first guess here is that the ID_INPUT_JOYSTICK or some other tag isn't
> applied by udev, so the rest of the system doesn't identify it 
> correctly.
> that could lead to e.g. the X server not initializing it. Usually the
> solution to that is to either add a specific set of axes/buttons to 
> trigger
> the tag, or assign the tag manually with a custom rule.
> 
> What's the evemu-describe output of the device?
> 
> Cheers,
>    Peter


More information about the Input-tools mailing list