# Accessibility::DeviceEventController Interface Reference

`import "Accessibility_Registry.idl";`

## Public Member Functions

boolean | registerKeystrokeListener (in DeviceEventListener listener, in KeySet keys, in ControllerEventMask mask, in KeyEventTypeSeq type, in EventListenerMode mode)
void | deregisterKeystrokeListener (in DeviceEventListener listener, in KeySet keys, in ControllerEventMask mask, in KeyEventTypeSeq type)
boolean | registerDeviceEventListener (in DeviceEventListener listener, in EventTypeSeq typeseq)
void | deregisterDeviceEventListener (in DeviceEventListener listener, in EventTypeSeq typeseq)
boolean | notifyListenersSync (in DeviceEvent event)
oneway void | notifyListenersAsync (in DeviceEvent event)
void | generateKeyboardEvent (in long keycode, in string keystring, in KeySynthType type)
void | generateMouseEvent (in long x, in long y, in string eventName)

## Detailed Description

The interface via which clients request notification of device events, and through which device events may be simulated.

## Member Function Documentation

void Accessibility::DeviceEventController::deregisterDeviceEventListener | ( | in DeviceEventListener | listener,
|  | in EventTypeSeq | typeseq |
| ) |  |  |

De-register a previously registered keyboard eventlistener.

Parameters:

  | listener,: | a DeviceEventListener which will intercept events.
  | typeseq,: | an EventTypeSeq indicating which event types to stop listening for.

void Accessibility::DeviceEventController::deregisterKeystrokeListener | ( | in DeviceEventListener | listener,
|  | in KeySet | keys,
|  | in ControllerEventMask | mask,
|  | in KeyEventTypeSeq | type |
| ) |  |  |

De-register a previously registered keyboard eventlistener.

Parameters:

  | listener,: | a DeviceEventListener which will intercept key events.
  | keys,: | a KeySet indicating which keys to intercept, or KEYSET_ALL_KEYS.
  | mask,: | a ControllerEventMask filtering the intercepted key events.
  | type,: | an EventType mask that may created by ORing event types together.

void Accessibility::DeviceEventController::generateKeyboardEvent | ( | in long | keycode,
|  | in string | keystring,
|  | in KeySynthType | type |
| ) |  |  |

Synthesize a keyboard event.

Parameters:

  | keycode,: | a long integer indicating the keycode of the keypress to be synthesized.
  | keystring,: | an optional UTF-8 string indicating a complex keyboard input event.
  | type,: | a KeySynthType indicating the type of event(s) to be synthesized: a key press, release, press-release pair, or a complex input string (for instance from an internationalized or complex text input method, or a composed character).

Note:
  keycode may be truncated before being processed, as keycode length may be platform-dependent and keycode ranges are generally much smaller than CORBA_long. One or the other of keycode or keystring are generally NULL, (but not both), depending on the value of `type`.

void Accessibility::DeviceEventController::generateMouseEvent | ( | in long | x,
|  | in long | y,
|  | in string | eventName |
| ) |  |  |

Synthesize a mouse event.

Parameters:

  | x,: | a long integer indicating the screen x coord for the mouse event.
  | y,: | a long integer indicating the screen y coord for the mouse event.
  | eventName,: | a string indicating the type of mouse event, e.g. "button1up"

oneway void Accessibility::DeviceEventController::notifyListenersAsync | ( | in DeviceEvent | event | ) |

Notify the Registry instance that a device event has taken place in an asynchronous manner. This is the method used by accessibility bridges to forward "toolkit dependent" device events to the Registry from the application's process space. If the event in question is potentially pre-emptible. notifyListenersSync should be used instead.

Note:
  AT clients do not normally need to use this method, it is intended for use by toolkit bridges and special-purpose applications.

boolean Accessibility::DeviceEventController::notifyListenersSync | ( | in DeviceEvent | event | ) |

Notify the Registry instance that a device event has taken place, and allow pre-emptive listeners the opportunity to 'consume' the event and thus prevent its further issuance/forwarding. This is the method used by accessibility bridges to forward "toolkit dependent" device events to the Registry from the application's process space.

Note:
  AT clients do not normally need to use this method, it is intended for use by toolkit bridges and special-purpose applications.

Returns:
  `True` if the event was consumed by a (pre-emptive) listener, `False` if not (in which case the device event will be forwarded as normal to any application which would normally receive it, e.g. the currently active application in the case of mouse or keyboard events).

boolean Accessibility::DeviceEventController::registerDeviceEventListener | ( | in DeviceEventListener | listener,
|  | in EventTypeSeq | typeseq |
| ) |  |  |

Register to intercept events, and either pass them on or consume them. To listen to keyboard events use registerKeystrokeListener instead.

Parameters:

  | listener,: | a DeviceEventListener which will intercept events.
  | typeseq,: | an EventTypeSeq indicating which event types to listen for.

Returns:
  `True` if successful, `False` if not

boolean Accessibility::DeviceEventController::registerKeystrokeListener | ( | in DeviceEventListener | listener,
|  | in KeySet | keys,
|  | in ControllerEventMask | mask,
|  | in KeyEventTypeSeq | type,
|  | in EventListenerMode | mode |
| ) |  |  |

Register to intercept keyboard events, and either pass them on or consume them.

Parameters:

  | listener,: | a DeviceEventListener which will intercept key events.
  | keys,: | a KeySet indicating which keys to intercept, or KEYSET_ALL_KEYS.
  | mask,: | a ControllerEventMask filtering the intercepted key events.
  | type,: | a KeyEventTypeSeq that may created by ORing event types together.
  | mode,: | an EventListenerMode indicating whether the listener should receive the events synchronously, potentially consuming them, or just be notified asynchronously of those events that have been generated.

Note:
  Some platforms have limited support for global, preemptive EventListenerMode. Such a registration may fail if another client already has priority for preemptive access to one or more of the members of the KeySet. AT consumers have the option of re-trying the request without the global flag, or without the preemptive flag, or of re-trying with a different KeySet. The best support for pre-emptive global keyboard listeners is provided on platforms whose Xserver implementation provides the XEvIE extension.

Returns:
  `True` if the DeviceEventListener was successfully registered for the requested KeySet, ControllerEventMask, event types, and EventListenerMode; otherwise returns `False`.

The documentation for this interface was generated from the following file:

- /home/liyuan/src/at-spi/idl/Accessibility_Registry.idl