# Accessibility::DeviceEvent Struct Reference

`import "Accessibility_Registry.idl";`

## Data Fields

EventType | type
long | id
short | hw_code
unsigned short | modifiers
unsigned long | timestamp
string | event_string
boolean | is_text

## Detailed Description

A structure which encapsulates information about a device event.

## Field Documentation

EventType Accessibility::DeviceEvent::type

Identifies the type of the containing DeviceEvent.

long Accessibility::DeviceEvent::id

an identifier which identifies this event in the event stream. On X Window systems this corresponds to the XEvent serial number.

short Accessibility::DeviceEvent::hw_code

a numeric code which is hardware and system-dependent, identifying the specific hardware button or key on the device for which the event has occurred. On X Window systems, for global key notifications and for most non-global key notifications as well, this code corresponds to the XKeycode. For switch and button events it indicates the switch or button number.

Note:
  For technical reasons, this code may differ from the XKeycode when generated by Java applications for consumption by non-global key listeners. This is subject to change in future versions of the DeviceEventController implementation.

unsigned short Accessibility::DeviceEvent::modifiers

an unsigned short int consisting of zero or more of the following values OR'ed together:

- `1<<MODIFIER_SHIFT` (=1, corresponds to Xlib's ShiftMask)
- `1<<MODIFIER_SHIFTLOCK` (=2, corresponds to Xlib's LockMask)
- `1<<MODIFIER_CONTROL` (=4, corresponds to Xlib's ControlMask)
- `1<<MODIFIER_ALT` (=8, corresponds to Xlib's Mod1Mask)
- `1<<MODIFIER_META` (=16, corresponds to Xlib's Mod2Mask)
- `1<<MODIFIER_META2` (=32, corresponds to Xlib's Mod3Mask)
- `1<<MODIFIER_META3` (=64, corresponds to Xlib's Mod4Mask)

unsigned long Accessibility::DeviceEvent::timestamp

an unsigned integer representing the time that the event occurred. On X Window systems this event is a time in milliseconds from some arbitrary starting point; it therefore has a cycle time of approximately 50 days.

string Accessibility::DeviceEvent::event_string

A string representation of the event. If is_text is `True`, then this string represents the character or typographic sequence that would be received by a focussed text input field. event_string is in general suitable for exposure to the end-user for purposes of keyboard echo.

boolean Accessibility::DeviceEvent::is_text

`True` if the event results in the insertion of characters into an input text buffer, or would do so if delivered to a focussed text input field. ¨Typographical¨ key events have this field set to `True`, whereas ¨control¨ key events generally do not.

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

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