org.safs.natives
Class MSLLKtoRKEventListener

java.lang.Object
  extended by org.safs.natives.MSLLKtoRKEventListener
All Implemented Interfaces:
CallbackHookListener, LLKeyboardHookListener

public class MSLLKtoRKEventListener
extends java.lang.Object
implements LLKeyboardHookListener

This Low level key listener will convert the MicroSoft Low Level Key events to
Java RobotKeyEvent
This list of RobotKeyEvent can be parsed by method InputKeysParser.antiParse(List),
and a string, something like "AAAB{%}D", will be returned. This string can be used to generate the test script.

See Also:
RobotKeyEvent, InputKeysParser

Constructor Summary
MSLLKtoRKEventListener()
           
 
Method Summary
 java.util.List<RobotKeyEvent> getKeyEvents()
           
 boolean isCapsLockOn()
           
 void onLLKeyboardHook(int code, NativeLong wParam, User32.KBDLLHOOKSTRUCT info)
          This method will analyze each input virtual key code (MS virtual key code)
according to their key status (PRESS, RELEASE), generate a series of RobotKeyEvent
and put these events in the List keyEvents.
Note: RobotKeyEvent contains Java virtual key code as its key code value
 void resetKeyEvents()
          Remove all RobotKeyEvent from the list keyEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MSLLKtoRKEventListener

public MSLLKtoRKEventListener()
Method Detail

onLLKeyboardHook

public void onLLKeyboardHook(int code,
                             NativeLong wParam,
                             User32.KBDLLHOOKSTRUCT info)
This method will analyze each input virtual key code (MS virtual key code)
according to their key status (PRESS, RELEASE), generate a series of RobotKeyEvent
and put these events in the List keyEvents.
Note: RobotKeyEvent contains Java virtual key code as its key code value

Specified by:
onLLKeyboardHook in interface LLKeyboardHookListener

isCapsLockOn

public boolean isCapsLockOn()
Returns:
true if the CapsLock is pressed

getKeyEvents

public java.util.List<RobotKeyEvent> getKeyEvents()
Returns:
A list containing s series of RobotKeyEvent

resetKeyEvents

public void resetKeyEvents()
Remove all RobotKeyEvent from the list keyEvents