x-y coordinates from trackball - like mouseWheel() in 2 axis

I was wondering if there was a way to capture the direction info from a trackball, sort of like mouse 'vector' info. Don't think that is available. The mouseWheel() event works for one dimension, but I wanted 2. I'm guessing that this would be a Java library, but I've looked and frankly being only tangentially able to use them in processing sketches, I can't figure out what library/call might return this kind of information. Would anyone know this info by any chance?

I guess the other way to approach would be to set mouse to screen center (invisible), capture any changes every 1/10th second to a vector, reset mouse position to center... rinse repeat. Seems like a lot of work for interface data that must be available on a fundamental level.



  • Isn't a trackball essentially a mouse? Maybe you could look into ways to use more than one mouse on a computer...

  • edited August 2014

    hmm.... They would both still generate the same data even if it coming from two input devices. Think of a keyboard. attach two keyboards and you still get a 'k' on the screen whether you hit the 'k' key on the first or the second keyboard. Thanks for the thought though.

  • Answer ✓

    You might try the Game Control Plus library. Plug in the trackball and try the Gcp_ShowDevices and Configurator examples. If it detects the trackball then have a look at the library videos (on the website) to get a detailed look at this library and how to use it.

    The library can be installed through the PDE All Library menu option.

  • I'll give that a try. Thanks.

  • Seems to work.... but. Weird results with the trackball, it is only returning data when there is another mouse defined with the controller too. Must have something wrong. Getting there thanks.

Sign In or Register to comment.