Hi guys,
I’ve got a problem running jInput on Windows 7. I’ve downloaded jInput from http://ci.newdawnsoftware.com/job/JInput/2119/artifact/dist/.
If I run the scala code below on Linux 64 bit everything works fine and I get the positions of the mice. (If I run it as sudo.)
If I run the code on Windows 7 64 bit I just get 0.0 as positions of the mice.
private class JInputTest() {
private val pause = 20
private var mice: List[Mouse] = Nil
private val ca = ControllerEnvironment.getDefaultEnvironment.getControllers
println(Version.getVersion)
for (c <- ca) {
println(c.getName + " " + c.getType + " " + c.getPortType)
if (c.getType == Type.MOUSE)
mice = c.asInstanceOf[Mouse] :: mice
}
println(mice.size)
loopie()
private def loopie() {
val in = System.currentTimeMillis()
for (m <- mice) {
val erg = m.poll()
println(in + " " + erg + " " + m.getName + ": " + m.getPortType + ": " + m.getPortNumber + ": " + m.getX.getPollData + "/" + m.getY.getPollData)
}
val delay = (System.currentTimeMillis() - in).toInt
Thread.sleep(pause - delay)
loopie()
}
}
Output on Linux64bit (Ubuntu 13.10):
[quote]1392125100588 true PixArt USB Optical Mouse: USB: Port 2: 1.0/-8.0
[/quote]
Output on Win764bit:
[quote]1392124909590 true HID-compliant mouse: Unknown: 0: 0.0/0.0
[/quote]
Does anyone have a clue, why I won’t get a realistic output on Win7?
Another strange thing: The demo application below runs smooth on both OS and returns realistic outputs.
java -Djava.library.path=. -cp jinput.jar:jinput-test.jar net.java.games.input.test.ControllerReadTest
Thanks in advance.
Greetings