Hello,
I'm working with jinput to access my 360 controller, and have nearly everything working properly. However, one question: with the two analog sticks, the way that I am currently accessing them only sends information back to the application when the stick's value changes. So, if I hold a stick in the same position (be it 1, -1, .423162346 or whatever else) no continuous data stream is sent back to the application.
How would I go about allowing for that?
My current code looks something like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| Controller[] ca = ControllerEnvironment.getDefaultEnvironment().getControllers();
for(int i =0;i<ca.length;i++){ if (ca[i].getType() == Controller.Type.GAMEPAD) { xbox = ca[i]; } }
while (true) { xbox.poll(); EventQueue queue = xbox.getEventQueue(); Event event = new Event();
while (queue.getNextEvent(event)) { Component comp = event.getComponent(); float value = event.getValue(); if (comp.getName().equals("X Axis")) { } } |
Thanks for any help you can offer.