org.safs.natives
Class LLMouseHook

java.lang.Object
  extended by org.safs.natives.AbstractHook
      extended by org.safs.natives.LLMouseHook

public class LLMouseHook
extends AbstractHook

Hook class for intercepting low-level mouse events.

Usage:
1) define a class that implements interface LLMouseHookListener
2) to intercept mouse events in the class, implement: public void onLLMouseHook(int nCode, NativeLong wParam, MSLLHOOKSTRUCT info)
3) use MouseHook in the class

  • LLMouseHook llmousehook = new LLMouseHook();
  • llmousehook.addListener(this);
  • llmousehook.run();

    See Also:
    org.safs.natives.test.hookTest

    Field Summary
    static int WH_MOUSE_LL
              the type of hook for a hook procedure that monitors low-level mouse events
     
    Fields inherited from class org.safs.natives.AbstractHook
    hhk, hookId, hookname, hookProc, isHooked, listeners, USER32INST, WM_CHAR, WM_KEYDOWN, WM_KEYUP, WM_KILLFOCUS, WM_LBUTTONDBLCLK, WM_LBUTTONDOWN, WM_LBUTTONUP, WM_MOUSEHOVER, WM_MOUSEMOVE, WM_RBUTTONDOWN, WM_RBUTTONUP, WM_SETFOCUS, WM_SYSKEYDOWN, WM_SYSKEYUP, WM_UNICHAR
     
    Constructor Summary
    LLMouseHook()
               
     
    Method Summary
     boolean addListener(CallbackHookListener listener)
              add a listener for current Hook, it should be overridden in its derived classes for setting a specific listener.
     
    Methods inherited from class org.safs.natives.AbstractHook
    getHook, isHooked, removeListener, run, setHook, stop
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    WH_MOUSE_LL

    public static final int WH_MOUSE_LL
    the type of hook for a hook procedure that monitors low-level mouse events

    See Also:
    Constant Field Values
    Constructor Detail

    LLMouseHook

    public LLMouseHook()
    Method Detail

    addListener

    public boolean addListener(CallbackHookListener listener)
    Description copied from class: AbstractHook
    add a listener for current Hook, it should be overridden in its derived classes for setting a specific listener.

    Overrides:
    addListener in class AbstractHook
    Parameters:
    listener - -- a CallbackHookListener
    Returns:
    true if succeeds; otherwise false