Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (538)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (601)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Linux mouse problems  (Read 2874 times)
0 Members and 1 Guest are viewing this topic.
Offline gregof

Junior Devvie




in code we trust


« Posted 2004-09-08 19:20:38 »

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
Offline endolf

JGO Coder


Medals: 7
Exp: 15 years


Current project release date: sometime in 3003


« Reply #1 - Posted 2004-09-09 06:20:58 »

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

Offline gregof

Junior Devvie




in code we trust


« Reply #2 - Posted 2004-09-09 06:49:13 »

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
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline endolf

JGO Coder


Medals: 7
Exp: 15 years


Current project release date: sometime in 3003


« Reply #3 - Posted 2004-09-09 06:52:15 »

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

Offline gregof

Junior Devvie




in code we trust


« Reply #4 - Posted 2004-09-09 17:38:39 »

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
Offline TheBohemian

Junior Devvie




Java will rule them all!


« Reply #5 - Posted 2004-09-11 21:43:21 »

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)

cya

TheBohemian

---------------------------------------
my favorite OS: http://jnode.sf.net
Java 1.5 -> 1.4 converter: http://retroweaver.sf.net
Offline gregof

Junior Devvie




in code we trust


« Reply #6 - Posted 2004-09-12 12:07:50 »

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 :-(
(If I been unclear, It is the mouse that I dont get to work, I do keyinput with awt.)

// Gregof
Offline TheBohemian

Junior Devvie




Java will rule them all!


« Reply #7 - Posted 2004-09-12 16:32:05 »

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:
1  
2  
3  
4  
CONFIG_INPUT_MOUSEDEV=y
CONFIG_INPUT_MOUSEDEV_PSAUX=y
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768

cya

TheBohemian

---------------------------------------
my favorite OS: http://jnode.sf.net
Java 1.5 -> 1.4 converter: http://retroweaver.sf.net
Offline TheBohemian

Junior Devvie




Java will rule them all!


« Reply #8 - Posted 2004-09-12 16:42:19 »

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.

cya

TheBohemian

---------------------------------------
my favorite OS: http://jnode.sf.net
Java 1.5 -> 1.4 converter: http://retroweaver.sf.net
Offline gregof

Junior Devvie




in code we trust


« Reply #9 - Posted 2004-09-12 16:54:33 »

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... :-)

Thanks //
               Gregof
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline TheBohemian

Junior Devvie




Java will rule them all!


« Reply #10 - Posted 2004-09-12 23:00:37 »

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? Smiley

cya

TheBohemian

---------------------------------------
my favorite OS: http://jnode.sf.net
Java 1.5 -> 1.4 converter: http://retroweaver.sf.net
Offline gregof

Junior Devvie




in code we trust


« Reply #11 - Posted 2004-09-13 17:40:20 »

Hi
This is the output from config.gz:
1  
2  
3  
4  
5  
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 :-(

Thanks for your time  //
                                 Gregof
Offline TheBohemian

Junior Devvie




Java will rule them all!


« Reply #12 - Posted 2004-09-15 19:11:22 »

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?

cya

TheBohemian

---------------------------------------
my favorite OS: http://jnode.sf.net
Java 1.5 -> 1.4 converter: http://retroweaver.sf.net
Offline TheBohemian

Junior Devvie




Java will rule them all!


« Reply #13 - Posted 2004-09-15 19:18:44 »

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

cya

TheBohemian

---------------------------------------
my favorite OS: http://jnode.sf.net
Java 1.5 -> 1.4 converter: http://retroweaver.sf.net
Offline gregof

Junior Devvie




in code we trust


« Reply #14 - Posted 2004-09-16 15:26:33 »

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 :-)
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
Offline TheBohemian

Junior Devvie




Java will rule them all!


« Reply #15 - Posted 2004-09-16 23:49:03 »

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 ...

cya

TheBohemian

---------------------------------------
my favorite OS: http://jnode.sf.net
Java 1.5 -> 1.4 converter: http://retroweaver.sf.net
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

rwatson462 (30 views)
2014-12-15 09:26:44

Mr.CodeIt (20 views)
2014-12-14 19:50:38

BurntPizza (42 views)
2014-12-09 22:41:13

BurntPizza (76 views)
2014-12-08 04:46:31

JscottyBieshaar (37 views)
2014-12-05 12:39:02

SHC (51 views)
2014-12-03 16:27:13

CopyableCougar4 (48 views)
2014-11-29 21:32:03

toopeicgaming1999 (115 views)
2014-11-26 15:22:04

toopeicgaming1999 (103 views)
2014-11-26 15:20:36

toopeicgaming1999 (30 views)
2014-11-26 15:20:08
Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!