Dinesh966 / jnativehook

Automatically exported from code.google.com/p/jnativehook
0 stars 0 forks source link

Detect When Meta Key is Held Down #55

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In the "Global Keyboard Listener" example on this website, console output is 
continuously generated when a letter key is held down, but not when the meta 
key is held down. For instance, if I hold down the "J" key, lines are 
continuously generated in the console output until I stop holding it down. 
However, if I hold down the meta key (i.e. Option on a Mac and Alt on a PC), 
only my initial keypress generates console output and holding it down does 
nothing. 

I would like for jnativehook to recognize when the meta key is held down, which 
would be useful in creating a program that allows for holding down the option 
key during startup (like some of Blizzard's games).

Original issue reported on code.google.com by wjherrmann on 2 Jul 2013 at 3:45

GoogleCodeExporter commented 9 years ago
Auto-repeated keys are determined by the operating system's configuration and, 
as far as I know, do not include modifier keys on any operating system.  If you 
need to determine if a key is being held down, store a copy of the modifier 
mask and check against that.  As of version 1.2 you will be able to simulate 
the repeat if needed, however it will be a few more months before that version 
is near beta status.  If there is a platform related discrepancy between which 
keys are auto-repeated, please reopen this bug.

Original comment by a...@1stleg.com on 2 Jul 2013 at 4:34