Class NativeHookException

java.lang.Object
java.lang.Throwable
java.lang.Exception
com.github.kwhat.jnativehook.NativeHookException
All Implemented Interfaces:
Serializable

public class NativeHookException extends Exception
Signals that a Native Hook Exception has occurred.
Since:
1.0
Version:
2.0
Author:
Alexander Barker (alex@1stleg.com)
See Also:
  • Field Details

    • UNSPECIFIED_FAILURE

      public static final int UNSPECIFIED_FAILURE
      Unspecified failure error code.
      Since:
      2.0
      See Also:
    • HOOK_FAILURE

      public static final int HOOK_FAILURE
      General failure error code.
      Since:
      2.0
      See Also:
    • X11_OPEN_DISPLAY

      public static final int X11_OPEN_DISPLAY
      X11 open display error code.
      Since:
      2.0
      See Also:
    • X11_RECORD_NOT_FOUND

      public static final int X11_RECORD_NOT_FOUND
      X11 extension XRecord was not found.
      Since:
      2.0
      See Also:
    • X11_RECORD_ALLOC_RANGE

      public static final int X11_RECORD_ALLOC_RANGE
      X11 extension XRecord could not allocate range.
      Since:
      2.0
      See Also:
    • X11_RECORD_CREATE_CONTEXT

      public static final int X11_RECORD_CREATE_CONTEXT
      X11 extension XRecord could not create a context.
      Since:
      2.0
      See Also:
    • X11_RECORD_ENABLE_CONTEXT

      public static final int X11_RECORD_ENABLE_CONTEXT
      X11 extension XRecord could not enable the context.
      See Also:
    • X11_RECORD_GET_CONTEXT

      public static final int X11_RECORD_GET_CONTEXT
      X11 extension XRecord could not enable the context.
      See Also:
    • WIN_SET_HOOK

      public static final int WIN_SET_HOOK
      Windows SetWindowsHookEx function failed to register the low level hook. See log level debug for details.
      Since:
      2.0
      See Also:
    • DARWIN_AXAPI_DISABLED

      public static final int DARWIN_AXAPI_DISABLED
      Apple access for assistive devices is disabled.
      See Also:
    • DARWIN_CREATE_EVENT_PORT

      public static final int DARWIN_CREATE_EVENT_PORT
      Apple could not create an event port.
      See Also:
    • DARWIN_CREATE_RUN_LOOP_SOURCE

      public static final int DARWIN_CREATE_RUN_LOOP_SOURCE
      Apple could not create a run loop source.
      See Also:
    • DARWIN_GET_RUNLOOP

      public static final int DARWIN_GET_RUNLOOP
      Apple could not acquire the current run loop.
      See Also:
    • DARWIN_CREATE_OBSERVER

      public static final int DARWIN_CREATE_OBSERVER
      Apple could not create an observer.
      See Also:
  • Constructor Details

    • NativeHookException

      public NativeHookException()
      Instantiates a new NativeHookException with UNKNOWN_FAILURE as its error code and null as its detail message.
    • NativeHookException

      public NativeHookException(int code)
      Instantiates a new NativeHookException with a specified error code and null as its detail message.
      Parameters:
      code - The native error code.
      Since:
      2.0
    • NativeHookException

      public NativeHookException(String message)
      Instantiates a new NativeHookException with UNKNOWN_FAILURE as its error code and a specified detail message.
      Parameters:
      message - The detail message.
    • NativeHookException

      public NativeHookException(int code, String message)
      Instantiates a new NativeHookException with a specified code and detail message.
      Parameters:
      code - The native error code.
      message - The detail message.
      Since:
      2.0
    • NativeHookException

      public NativeHookException(String message, Throwable cause)
      Instantiates a new NativeHookException with a specified detail message and cause.
      Parameters:
      message - The detail message.
      cause - The cause of the exception. A null value is permitted, and indicates that the cause is unknown.
    • NativeHookException

      public NativeHookException(int code, String message, Throwable cause)
      Instantiates a new NativeHookException with a specified error code, detail message and cause.
      Parameters:
      code - The native error code.
      message - The detail message.
      cause - The cause of the exception. A null value is permitted, and indicates that the cause is unknown.
      Since:
      2.0
    • NativeHookException

      public NativeHookException(Throwable cause)
      Instantiates a new NativeHookException with a specified cause.
      Parameters:
      cause - The cause of the exception. A null value is permitted, and indicates that the cause is unknown.
    • NativeHookException

      public NativeHookException(int code, Throwable cause)
      Instantiates a new NativeHookException with a specified error code and cause.
      Parameters:
      code - The native error code.
      cause - The cause of the exception. A null value is permitted, and indicates that the cause is unknown.
  • Method Details

    • getCode

      public int getCode()
      Get the native error code associated with this exception.
      Returns:
      The native error code
      Since:
      2.0