Jinput with programs running in background

Hi,

I can get mouse position(velocity) when my software is running in foreground, but I want to know these data even when my software is running in background. Is that possible?
Seens like when my software is in background mode Jinput returns zero for all mouse data.
I’m using Windows Vista.

Thanks,

Marcus Veloso

Hi

This is the expected behaviour under windows, if you change the default plugin from the directx+raw plugin to directx only, I think it might do the business, but you lose support for multiple keyboard/mice.

Windows native input API (not directx) only gives events to the active window, this is partly to prevent key loggers etc, but directx doesn’t have this restriction.

HTH

Endolf

Hi Endolf,

It works.

C:\dist> java -Djava.library.path=. -cp jinput.jar;jinput-test.jar -Djinput.plugins=net.java.games.input.DirectInputEnvironmentPlugin -Djinput.useDefaultPlugin=false net.java.games.input.test.ControllerReadTest

How could i change the default plugin inside my project main class?

Thanks,

Marcus Veloso

Hi

Yes, System.setProperty should do the job, as long as it is called before the getControllers method.

HTH

Endolf