com.jniwrapper.win32.hook
Class KeyboardEvent

java.lang.Object
  extended by java.util.EventObject
      extended by com.jniwrapper.win32.hook.HookEventObject
          extended by com.jniwrapper.win32.hook.KeyboardEvent
All Implemented Interfaces:
java.io.Serializable

public class KeyboardEvent
extends HookEventObject

This class describes events of the Hook.Descriptor.KEYBOARD hook.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
KeyboardEvent(java.lang.Object source, long virtualKeyCode, long keyInfo)
           
 
Method Summary
 boolean getPreviousState()
          Specifies the previous key state.
 int getRepeatCount()
          Specifies the repeat count.
 int getScanCode()
          Specifies the scan code.
 boolean getTransitionState()
          Specifies the transition state.
 long getVirtualKeyCode()
           
 boolean isAltPressed()
          Specifies the context code.
 boolean isExtendedKey()
          Specifies whether the key is an extended key, such as a function key or a key on the numeric keypad.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

KeyboardEvent

public KeyboardEvent(java.lang.Object source,
                     long virtualKeyCode,
                     long keyInfo)
Method Detail

getVirtualKeyCode

public long getVirtualKeyCode()

getRepeatCount

public int getRepeatCount()
Specifies the repeat count. The value is the number of times the keystroke is repeated as a result of the user's holding down the key.

Returns:
the repeat count.

getScanCode

public int getScanCode()
Specifies the scan code. The value depends on the OEM.

Returns:
scan code.

isExtendedKey

public boolean isExtendedKey()
Specifies whether the key is an extended key, such as a function key or a key on the numeric keypad.

Returns:
true, if the key is an extended key; otherwise, it is false.

isAltPressed

public boolean isAltPressed()
Specifies the context code.

Returns:
true, if the ALT key is down; otherwise, it is false.

getPreviousState

public boolean getPreviousState()
Specifies the previous key state.

Returns:
true, if the key is down before the message is sent; false if the key is up.

getTransitionState

public boolean getTransitionState()
Specifies the transition state.

Returns:
true, if the key is being pressed; false if it is being released.