Linux mouse problems

Hi all
I have some questions about jinput on linux, I have searched this board extensively with no luck, is there no place with some docs on jinput?
Anyway, I have a 2.6.6 kernel and a usb mouse and keyboard, when I start my jinput-testapp it correctly identifies all my devices (my mouse is named “USB Keyboard” but the type is mouse) but when i try to poll data from it, it registers nothing. The same code works in windows XP btw. I have rwx permission on my /dev/input/* and if I do a “cat /dev/input/mice” and move the mouse I get garbage in the console. Do I need to specify some special device or protocol in my XF86Config file? I use /dev/input/mice and ImPS/2 now and it works for everrything X related.

Thanks in advance
// Gregof

Hi
There needs to to be a /dev/input/event? device for it. I’m unsure why it comes up as a keyboard though, do you have a scroll wheel on your keyboard?

whats the output on the console when you run readtest or texttest test applications?

Cheers

Endolf

Hi
I do have a couple of /dev/input/event* entries, I dont have the specifics since i’m at work right now, I do not have a scrollwheel on my keyboard either. When I get home I will test the readtest and texttest apps (I guess they are part of the jinput package or in cvs?), and post the output as soon as I can.

Thanks //
Gregof

Any JInput app should be dumping some output to the console, which will include the controller list. texttest will also list all the axis on all the controllers it finds. I think it’s included in the distribution jar, it’s certainly in CVS.

Thanks

Endolf

Hi again
This is the content of my /dev/input dir:
magnus@kit:/dev/input$ ls -l
total 0
crw-rw-rwx 1 root root 13, 64 Apr 30 02:28 event0
crw-rw-rwx 1 root root 13, 65 Apr 30 02:28 event1
crw-rw-rwx 1 root root 13, 66 Apr 30 02:28 event2
crw-rw-rwx 1 root root 13, 67 Apr 30 02:28 event3
crw-rw-rwx 1 root root 13, 0 Apr 30 02:28 js0
crw-rw-rwx 1 root root 13, 1 Apr 30 02:28 js1
crw-rw-rwx 1 root root 13, 2 Apr 30 02:28 js2
crw-rw-rwx 1 root root 13, 3 Apr 30 02:28 js3
crw-rw-rwx 1 root root 13, 63 Apr 30 02:28 mice
crw-rw-rwx 1 root root 13, 32 Apr 30 02:28 mouse0
crw-rw-rwx 1 root root 13, 33 Apr 30 02:28 mouse1
crw-rw-rwx 1 root root 13, 34 Apr 30 02:28 mouse2
crw-rw-rwx 1 root root 13, 35 Apr 30 02:28 mouse3

Is this all the events that need to be there?
I have run the ControllerReadTest and ControllerTextTest and the output was rather lengthy, so I put the complete output on this page: http://palobas.campus.luth.se/~magnus/

Thanks //
Gregof

Have you tried my version of the Linux plugin? The links are the end of the first post here: http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=jinput;action=display;num=1087611855;start=0#0

If this plugin does strange things too, than there might be a problem on your side.

But on the other hand I had told endolf already that on Linux a single USB keyboard consists of two event devices.

Things are even more strange with the kb drivers since these report keys that do not exist. The last USB kb I had provided not a single additional usable key on the second event device but reported to have plenty of them … eg. power key and such)

Hi, thanks for the reply.
I tried your plugin, but it only finds 2 devices, thats my 2 keyboards, one ps/2 and one usb, I didnt detect my mouse or my joystick tough :frowning:
(If I been unclear, It is the mouse that I dont get to work, I do keyinput with awt.)

// Gregof

have you tried ‘cat’ on the event devices? this should normally spit out some garbage when moving the mouse around. if not its is possible that you have not configured the mouse to be available as event device.

if you have /proc/config.gz enabled try: zcat /proc/config.gz | grep MOUSEDEV it should return something similar to this:


CONFIG_INPUT_MOUSEDEV=y
CONFIG_INPUT_MOUSEDEV_PSAUX=y
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768

err I have another idea: you seem to have attached a lot of devices. maybe there are not enough device files.
it may help to create a few eventXX files with mknod.

Hmm, it looks as you might be on to something there, none of my event devices generates garbage when i do cat and move the mouse. What do I need to do to configure the mouse as an event device? Is there ANY dockumentation about this? It is not easy to guess this sort of things… :slight_smile:

Thanks //
Gregof

It seems that you have not activated evdev support in your kernel. Just run ‘make menuconfig’ and activate ‘Event interface’ which is under ‘device drivers/input device support’.

Maybe you have compiled it as a module. Its called evdev then.
Can you post the output of the zcat-grep thing which I showed you 2 posts upwards? If you recompile the kernel please post the output with the new one, too.

Btw: ‘input device support’ … isn’t that a nice argument for the discussion about the naming issue in JInput? endolf, anyone? :slight_smile:

Hi
This is the output from config.gz:


kit:~# zcat /proc/config.gz   | grep -i MOUSEDEV
CONFIG_INPUT_MOUSEDEV=y
CONFIG_INPUT_MOUSEDEV_PSAUX=y
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768

I have evdev as module in my kernel and it is loaded.
I tested TheBohemian’s tip and created a few more /dev/input/eventXX files and now i get garbage in the console when I do cat event4( I only had 0-3 before). Unfortunately I still have the same behaviour, that is: I detect the mouse but I dont get any polldata from it :frowning:

Thanks for your time //
Gregof

are there enough access rights for that new event device file?

how is my plugin reacting? does the device show up or is it left out (which means that it was thrown away because the kernel said it had no usable controls on it)?

can you post a link to an online description of the hardware?

can you look up the mouse in /proc/bus/input/devices and post its entry?

Hi
I made the new /dev/input/eventXX files like you suggested before, but I now realised that I didnt fix their permissions…(stupid me) I fixed that and now it WORKS! I have only tried the standard plugin, but if if you want me to try your plugin again, just say the word :slight_smile:
One thing that I have learned from this is that there seems to be a lack of info when it comes to the linuxside of jinput, I havent found any resources on the web and the wiki seems a bit short on the matter.
Is there some place I missed? if not, maybe I should write my small findings in the wiki?

Thanks to all of you! //
Gregof

If you want to test my plugin I have very convenient option for you.
The intro post now contains a JNLP link to JInputTester. IMHO a better
app then controllerreadtest and such …
http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=jinput;action=display;num=1087611855

I think it would be a good idea to add your experience with JInput on Linux to the wiki.

Btw: Is it this http://wiki.java.net/bin/view/Games you are talking about? Looks pretty empty for JInput …