Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (603)
Games in Android Showcase (171)
games submitted by our members
Games in WIP (652)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  reading input without focus  (Read 3317 times)
0 Members and 1 Guest are viewing this topic.
Offline Paulere

Junior Newbie

« Posted 2011-01-05 17:59:18 »


is it possible to monitor pressed Keys e.g. from a x-box controller with JInput when the application is out of focus?

afaik JInput uses the JNI Interface, so basically it should be possible.

Offline Eli Delventhal

JGO Kernel

Medals: 42
Projects: 11
Exp: 10 years

Game Engineer

« Reply #1 - Posted 2011-01-05 18:02:21 »


See my work:
OTC Software
Offline Paulere

Junior Newbie

« Reply #2 - Posted 2011-01-05 19:16:36 »

Great. Grin

With the application i wrote it  didn't work. I used the getEventQueue() method. (as shown in the getting started section)
As soon as my application is out of focus it stops getting signals.

What am I doing wrong? What might be the problem?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline endolf

JGO Coder

Medals: 7
Exp: 15 years

Current project release date: sometime in 3003

« Reply #3 - Posted 2011-01-06 07:41:14 »

Which plugin are you using?, which platform?


Offline Paulere

Junior Newbie

« Reply #4 - Posted 2011-01-06 10:03:35 »

It's running on Windows XP SP3 so far.
Well, if you ask like this... I took the JInput binarys I found in one of my older projects, so it's from February 2010.
Offline endolf

JGO Coder

Medals: 7
Exp: 15 years

Current project release date: sometime in 3003

« Reply #5 - Posted 2011-01-06 10:09:10 »

Ok, so windows, and I'm guessing you have not set the property to define which plugin to use?

There are posts here and here regarding focus and how to get it to always work, and the side effect.



Offline Paulere

Junior Newbie

« Reply #6 - Posted 2011-01-06 12:53:52 »

Right, I didn't define the plugin.

It works Smiley  So far I'm happy.

now I just need to find out how to differentiate the input...Keyboard and mouse is all the same, but a gamepad has its own name.
Is there any device ID to read out... I mean the OS can differentiate between two mice, and with default Plugin JInput too. But with JInput the name of the mouse might be the same (HID compliant mouse for both) and its no problem for JInput to know which does what.

To save some space: where do I find something like a TODO list and what has changed in the last time, so I don't have to ask each time.
Offline endolf

JGO Coder

Medals: 7
Exp: 15 years

Current project release date: sometime in 3003

« Reply #7 - Posted 2011-01-06 13:17:10 »


Currently, there is no way to identify each instance of a device where the name is the same, we use what the OS gives us. Under directx you only get 1 mouse and 1 keyboard listed even if more are plugged on (the values from each device are combined but the OS, so we don't see them as unique devices).

There are no TODO or release notes normally, if something significant changes it will probably be posted to JGO somewhere.


Offline Paulere

Junior Newbie

« Reply #8 - Posted 2011-01-06 13:24:05 »


thx for the quick help
Offline Nate

« JGO Bitwise Duke »

Medals: 165
Projects: 4
Exp: 14 years

Esoteric Software

« Reply #9 - Posted 2011-01-06 21:35:13 »

I wrote a wrapper class for the 360 controllers:
There is also a very lightweight native lib for Windows to use XInput to interface with the controllers:

Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

SHC (11 views)
2015-08-01 03:58:20

Jesse (17 views)
2015-07-29 04:35:27

Riven (38 views)
2015-07-27 16:38:00

Riven (19 views)
2015-07-27 15:35:20

Riven (22 views)
2015-07-27 12:26:13

Riven (12 views)
2015-07-27 12:23:39

BurntPizza (32 views)
2015-07-25 00:14:37

BurntPizza (44 views)
2015-07-24 22:06:39

BurntPizza (25 views)
2015-07-24 06:06:53

NoxInc (32 views)
2015-07-22 22:16:53
List of Learning Resources
by gouessej
2015-07-09 11:29:36

How Do I Expand My Game?
by bashfrog
2015-06-14 11:34:43

List of Learning Resources
by PocketCrafter7
2015-05-31 05:37:30

Intersection Methods
by Roquen
2015-05-29 08:19:33

List of Learning Resources
by SilverTiger
2015-05-05 10:20:32

How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!