Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2007

Tip: Looking for answers? Try searching our database.

Reading keyboard state without keylistener ??

Thread view: 
axel.kowald@rub.de - 11 Jun 2007 15:19 GMT
Hi everybody,

I would like to read the current keyboard state (is button X pressed)
without a keylistener.
The problem is that I need to recognize a keypress in my java
application even if the application is not the foreground window and
has no keyboard focus.

My application runs in a looping thread and during each cycle I want
to check the current state of the keyboard.
How can I do this?

Many thanks,

  axel
Andrew Thompson - 11 Jun 2007 15:31 GMT
...
>...need to recognize a keypress in my java
>application even if the application is not the foreground window and
>has no keyboard focus.

I doubt it can be done in pure Java.  Try JNI.

Signature

Andrew Thompson
http://www.athompson.info/andrew/

cyprian - 11 Jun 2007 18:09 GMT
> axel.kow...@rub.de wrote:
>
[quoted text clipped - 10 lines]
>
> Message posted viahttp://www.javakb.com

the focus hierarchy flows from Windows before it gets to your
component, you'll always get a FOCUS_LOST response because the window
that is the focus cycle root will return DEACTIVATED, no show in java
for that.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.