Hello.
I am new to Jinput and have just recently set up Jinput, class paths, and what not and I have a question.
I worked through the “Getting Started with JInput” topic and everything was working fine until I got to the section on reading in input from the controllers. I went ahead and typed out the code for polling the controllers, establishing an eventqueue, and reading events and the code did not seam to do anything. I would run it, and nothing. I set up a few debug statements listing the controller’s names etc, a System.out.println if an event was triggered (to see if the StringBuffer was somehow empty), I messed around with administrator settings, and nothing seamed to work. I was about to give up, when I plugged in my old Axis Pad, and voila it was being detected!
I’ve searched these forums for an explanation and came about this thread: http://www.java-gaming.org/index.php/topic,20169.0.html
I am writing these programs using the Netbeans 7.0 IDE, and it could be possible when the program executes there is no active window for the raw data to fetch keyboard and mouse events from (I should have mentioned above that the test program ran correctly).
As the above thread was from two years ago, I was wondering if any fix had been discovered in the meantime.
You see, my final project (and initial reason for installing JInput) requires detecting input from multiple mice and keyboards while out of focus. Why this is is that I bought Portal 2 recently, and was very disappointed that it did not have an “offline” multiplayer (playing split screen on one computer with a friend). Looking around the internet I found a workaround on the Steam forums, how one can launch the multiplayer maps directly from the console, and bind a joystick’s keys to player two (after said joystick was emulated as a 360 controller).
I have also found and set up a way to play the game on two different monitors.
While this is all great, my controller is pretty old (3 of the 4 bumpers/triggers don’t work) and playing with it on the more reaction based puzzles is very difficult. So I started looking for ways to detect multiple mice and keyboards, and then emulate a controller with them. One solution (GlovePIE) would require the computer to run in test mode as it used unsigned drivers to emulate controllers; another was outdated by 4-6 years. This makes JInput my best bet as it is still regularly updated and has a forum of awesome people (This would be you guys) working on it.
In short, is there a way to detect the input of multiple mice and keyboards without having an in-focus window, or is there a way to have a window and Portal 2 to share focus, or some other workaround?