Best way to determine correct /dev/input/eventX ?

39 views
Skip to first unread message

Joe Skerratt

unread,
Oct 15, 2015, 10:28:16 AM10/15/15
to android-porting
I've been doing some prototype work with a bespoke Android development project that is going on. I am sending scancodes directly to one of the evdev (/dev/input/event11 in this case) to achieve certain functionality which works fine for the most part. The problem is, plug in a few USB keyboards or mice and the whole thing falls apart because the way Linux enumerates the event drivers differently I guess.

So what's the best way of exposing event codes programatically, so that I can determine the correct /dev/input/eventx to send my scancodes too when more than a few devices are connected? I cannot be the only person who has experienced this problem and surely there's a reasonably efficient way of working out which eventX to send my scancodes too? I've been looking at the getevent code. I only need to check to see if the compatible codes are there, then I can reasonably assume it's the correct event handler.

Any help would be great.

Cheers

Leo You

unread,
Oct 31, 2015, 11:56:48 AM10/31/15
to android-porting
Maybe you could use "uinput".


在 2015年10月15日星期四 UTC+8下午10:28:16,Joe Skerratt写道:
Reply all
Reply to author
Forward
0 new messages