Avoid Keylogger

Hi

To add Joystick support to my input abstraction I use JInput. Since JInput’s Mouse doesn’t produce input events in a stable way (at least on Linux) And the Keyboard localization doesn’t work properly, I have mixed modes, where the Keyboard and Mouse are polled through other APIs like AWT or LWJGL and just the Joysticks are handled by JInput. Unfortunately there’s no way to query the list of Keyboards or the list of Mouses only in JInput. You can only query the list of Controllers and have to filter for Keyboards or Mouses. In principle this is not a problem. But unfortunately some anti-virus tools (like Kaspersky) seem to detect a keylogger (which a JInput keyboard certainly is), if a Keyboard instance is created.

Is there a way to avoid that? I guess, if I was able to query the list of Keyboards/Mouses/Joysticks separately and instances of the different types would only be created, if needed, the problem would be solved.

Thanks in advance.

Marvin

I typically loop through all the controllers once and then store the keyboard under and instance variable. Will doing that alleviate your problem? I’ve never had any issues with anti-virus software, so I’m not the exact nature of this.

This is of course the exact same way, that I do it. Is there a different way? I loop through the list of controllers, check for the type, store the instances locally, that I am interested in, and ignore the others. But at this point in time the Keyboard instance is already created, which seems to be enough for it to be detected as a keylogger.

Marvin

Huh, that’s interesting. I’d imagine that if this is the way JInput works then there is nothing you can do aside from turning off your key logger detector software. But at the same time it seems like I would have heard of other complaints like this before, especially for people trying to run our games. LWJGL also uses JInput.

Yes. For Controller handling (where a Controller is a Joystick, SteeringWheel, etc., but not a Keyboard or Mouse).

Marvin

I’ve not heard of JInput triggering AV software, but I can understand why it might. LWJGL also uses JInput as pointed out, and does it the way you do, so I can’t see how LWJGL would not trigger the AV software. I’m assuming it scans the DLL when the system loads it, so I can’t see how not reading the controllers would change anything.

Endolf

It does as for Controllers.

Hi

My point was that it’s not the creation of the Keyboard instance that fires off the AV software, but the extraction from the jar of the native dll. I can’t see a way around that as the DLL will always be in the jar, even if it’s unused.

Endolf

Well, I am still using an older version of JInput, that works without any natives. I just never got the current version to work. I am using the version, that is shipped with LWJGL. And I assume, the one, who reported this issue to me, is using this version of JInput, too.

So, it should not be the existence of a native (dll).

Is there anything I can do to help you find this out? Could you possibly give me some testcode, that I could run (resp. forward the testcode to the one, who reported this issue)?

I guess, it would help, if you could give me the minimum code, that is necessary to check, if a device is a Keyboard/Mouse/Joystick, etc. Is that possible?

Marvin

Hi

There never has been a version of JInput that has worked without natives, unless you mean you are only shipping the AWT plugin, which should still work. That would probably support internationalisation too.

If you are saying that the older versions didn’t do this, then it might be the RAW plugin thats causing the AV software to fire off. In which case, remove the raw dll from the distribution and pass the right property to load just the directx plugin on windows, you can load the AWT one if you want also.

HTH

Endolf

Hmm… That’s strange. The version, I am using definitely doesn’t use/need natives. Just checkout Xith3D or JAGaToo from sourceforge and see it your self.

I’m also pretty sure, that the AWT plugin isn’t used, since it doesn’t find any Controllers (Joysticks), if the device nodes don’t get applied rw-privileges for everybody (which is still a very annoying thing).

How can I remove the RAW plugin? DirectX is obviously not an option, since I am not working on Windows ;). And I definitely don’t want to use the AWT plugin, since AWT SUCKS in terms of game input. But what if I used the AWT plugin? Are Joysticks still available? If they are, are they retrieved through a different plugin, while Mouse nad Keyboard are accessed through the AWT plugin? that would definitely be an option, since I anyway want to use only the Joysticks through JInput.

BTW. How do you control the mouse in the AWT plugin? If the mouse is used as a relative one (invisible cursor, only deltas in the events), how do you do that? In my AWT abstraction I am using the Robot class, which produces events by itself, which makes it pretty hard to handle.

Marvin

Ok, I’m confused now. Lets rewind to basics.

There are 5 plugins for JInput, mac, linux, Raw input on windows, direct x on windows, and AWT. All plugins except the AWT one require a native library. Raw input on windows is the newest addition and at one point did not exist. AWT and Raw input plugins are only used for keyboards/mice. There is another plugin that combines the mice/keyboards from Raw and excludes them from directx.

If the natives are not there, you’re not getting controllers through jinput.

What version is fine, what version is not, what platform is the issue on?

Cheers

Endolf

Controllers are working fine without natives. Please checkout JAGaToo and run the InputTest. You will see, that no JInput natives are used are controllers do still work.

I only used the version, I am talking about (from the LWJGL distribution) and a year ago I tried the latest built, but without success.

The platform, on which the keylogger-issue arose, is Windows (XP I guess). Please see this thread.

Marvin