8.2 Standard Device Events

An event is a CLIM object that represents some sort of user gesture (such as moving the pointer or pressing a key on the keyboard) or that corresponds to some sort of notification from the display server. Event objects store such things as the sheet associated with the event, the x and y bposition of the pointer within that sheet, the key name or character corresponding to a key on the keyboard, and so forth. [annotate]

[event, Concept← A Glossary]
[event, Concept← 22.3 Gestures and Gesture Names]
[event, Concept← 8.2 Standard Device Events, event-type]
[event, Concept← 8.2 Standard Device Events, event-timestamp]
[event, Concept← 8.2 Standard Device Events, eventp]
[event, Concept← 8.1 Input Protocol]

Figure 8.1 shows all the event classes. [annotate]


XXXXXXXXXXXX event
device-event
keyboard-event
key-press-event
key-release-event
pointer-event
pointer-button-event
pointer-button-press-event
pointer-button-release-event
pointer-button-hold-event
pointer-motion-event
pointer-boundary-event
pointer-enter-event
pointer-exit-event
window-event
window-configuration-event
window-repaint-event
window-manager-event
window-manager-delete--event
timer-event
[annotate]



Figure 8.1: CLIM event classes. All classes that appear at a given indentation are subclasses of the class that appears above and at a lesser indentation.
event   [Protocol Class]
          

The protocol class that corresponds to any sort of "event". If you want to create a new class that behaves like an event, it should be a subclass of event. All instantiable subclasses of event must obey the event protocol. [annotate]

All of the event classes are immutable. CLIM implementations may choose to keep a resource of the device event classes, but this must be invisible at the API level. That is, any event visible at the level of the API must act as though it is immutable. [annotate]

[annotate]

eventp  object [Protocol Predicate]
          

Returns true if object is an event, otherwise returns false. [annotate]

[annotate]

:timestamp   [Initarg]
          

All subclasses of event must take a :timestamp initarg, which is used to specify the timestamp for the event. [annotate]

[annotate]

event-timestamp  event [Generic Function]
          

Returns an integer that is a monotonically increasing timestamp for the the event event. The timestamp must have at least as many bits of precision as a fixnum. [annotate]

[annotate]

event-type  event [Generic Function]
          

For the event event, returns a keyword with the same name as the class name, except stripped of the "-event" ending. For example, the keyword :key-press is returned by event-type for an event whose class is key-press-event. [annotate]

All event classes must implement methods for event-type and event-timestamp. [annotate]

[annotate]

device-event   [Class]
:sheet   [Initarg]
:modifier-state   [Initarg]
          

The instantiable class that corresponds to any sort of device event. This is a subclass of event. [annotate]

All subclasses of device-event must take the :sheet and :modifier-state initargs, which are used to specify the sheet and modifier state components for the event. [annotate]

[annotate]

event-sheet  device-event [Generic Function]
          

Returns the sheet associated with the event device-event. [annotate]

[annotate]

event-modifier-state  device-event [Generic Function]
          

Returns an integer value that encodes the state of all the modifier keys on the keyboard. This will be a mask consisting of the logior of +shift-key+, +control-key+, +meta-key+, +super-key+, and +hyper-key+. [annotate]

All device event classes must implement methods for event-sheet and event-modifier-state. [annotate]

[annotate]

keyboard-event   [Class]
:key-name   [Initarg]
          

The instantiable class that corresponds to any sort of keyboard event. This is a subclass of device-event. [annotate]

All subclasses of keyboard-event must take the :key-name initarg, which is used to specify the key name component for the event. [annotate]

[annotate]

keyboard-event-key-name  keyboard-event [Generic Function]
          

Returns the name of the key that was pressed or released in a keyboard event. This will be a symbol whose value is port-specific. Key names corresponding to the set of "standard" characters (such as the alphanumerics) will be a symbol in the keyword package. [annotate]

[annotate]

keyboard-event-character  keyboard-event [Generic Function]
          

Returns the character associated with the event keyboard-event, if there is any. [annotate]

All keyboard event classes must implement methods for keyboard-event-key-name and keyboard-event-character. [annotate]

[annotate]

key-press-event   [Class]
key-release-event   [Class]
          

The instantiable classes that correspond to a key press or release event. This is a subclass of keyboard-event. [annotate]

[annotate]

pointer-event   [Class]
:pointer   [Initarg]
:button   [Initarg]
:x   [Initarg]
:y   [Initarg]
          

The instantiable class that corresponds to any sort of pointer event. This is a subclass of device-event. [annotate]

All subclasses of pointer-event must take the :pointer, :button, :x, and :y initargs, which are used to specify the pointer object, pointer button, and native x and y position of the pointer at the time of the event. The sheet's x and y positions are derived from the supplied native x and y positions and the sheet itself. [annotate]

[annotate]

pointer-event-x  pointer-event [Generic Function]
pointer-event-y  pointer-event [Generic Function]
          

Returns the x and y position of the pointer at the time the event occurred, in the coordinate system of the sheet that received the event. All pointer events must implement a method for these generic functions. [annotate]

[annotate]

pointer-event-native-x  pointer-event [Generic Function]
pointer-event-native-y  pointer-event [Generic Function]
          

Returns the x and y position of the pointer at the time the event occurred, in the pointer's native coordinate system. All pointer events must implement a method for these generic functions. [annotate]

Note: What is the "pointer's native coordinate system"? I think what actually is meant (and would be useful) is the native coordinate system of the graft. Hence the same as X11's root-x and root-y device event slots. [edit]-- GB 2003-01-21 15:42Z
 

[annotate]

pointer-event-pointer  pointer-event [Generic Function]
          

Returns the pointer object to which this event refers. [annotate]

All pointer event classes must implement methods for pointer-event-x, pointer-event-y, pointer-event-native-x, pointer-event-native-y, and pointer-event-pointer. [annotate]

[annotate]

pointer-button-event   [Class]
pointer-event-button  pointer-button-event [Generic Function]
          

Returns the an integer corresponding to the pointer button that was pressed or released, which will be one of +pointer-left-button+, +pointer-middle-button+, or +pointer-right-button+. [annotate]

[annotate]

pointer-button-press-event   [Class]
pointer-button-release-event   [Class]
pointer-button-hold-event   [Class]
          

The instantiable classes that correspond to a pointer button press, button release, and click-and-hold events. These are subclasses of pointer-button-event. [annotate]

[annotate]

pointer-click-event   [Class]
pointer-double-click-event   [Class]
pointer-click-and-hold-event   [Class]
          

The instantiable classes that correspond to a pointer button press, followed immediately by (respectively) a button release, another button press, or pointer motion. These are subclasses of pointer-button-event. Ports are not required to generate these events. [annotate]

[annotate]

pointer-motion-event   [Class]
          

The instantiable class that corresponds to any sort of pointer motion event. This is a subclass of pointer-event. [annotate]

[annotate]

pointer-boundary-event   [Class]
          

The instantiable class that corresponds to a pointer motion event that crosses some sort of sheet boundary. This is a subclass of pointer-motion-event. [annotate]

[annotate]

pointer-boundary-event-kind  pointer-boundary-event [Generic Function]
          

Returns the "kind" of boundary event, which will be one of :ancestor, :virtual, :inferior, :nonlinear, :nonlinear-virtual, or nil. These event kinds correspond to the detail members for X11 enter and exit events. [annotate]

[annotate]

pointer-enter-event   [Class]
pointer-exit-event   [Class]
          

The instantiable classes that correspond to a pointer enter or exit event. These are subclasses of pointer-boundary-event. [annotate]

[annotate]

window-event   [Class]
:region   [Initarg]
          

The instantiable class that corresponds to any sort of windowing event. This is a subclass of event. [annotate]

All subclasses of window-event must take a :region initarg, which is used to specify the damage region associated with the event. [annotate]

[annotate]

window-event-region  window-event [Generic Function]
          

Returns the region of the sheet that is affected by a window event. [annotate]

[annotate]

window-event-native-region  window-event [Generic Function]
          

Returns the region of the sheet in native coordinates. [annotate]

[annotate]

window-event-mirrored-sheet  window-event [Generic Function]
          

Returns the mirrored sheet that is attached to the mirror on which the event occurred. [annotate]

All window event classes must implement methods for window-event-region, window-event-native-region, and window-event-mirrored-sheet. [annotate]

[annotate]

window-configuration-event   [Class]
          

The instantiable class that corresponds to a window changing its size or position. This is a subclass of window-event. [annotate]

[annotate]

window-repaint-event   [Class]
          

The instantiable class that corresponds to a request to repaint the window. This is a subclass of window-event. [annotate]

[annotate]

window-manager-event   [Class]
:sheet   [Initarg]
          

The instantiable class that corresponds to any sort of window manager event. This is a subclass of event. [annotate]

All subclasses of window-manager-event must take a :sheet initarg, which is used to specify the sheet on which the window manager acted. [annotate]

[annotate]

window-manager-delete-event   [Class]
          

The instantiable class that corresponds to window manager event that causes a host window to be deleted. This is a subclass of window-manager-event. [annotate]

[annotate]

timer-event   [Class]
          

The instantiable class that corresponds to a timeout event. This is a subclass of event. [annotate]

[annotate]

+pointer-left-button+   [Constant]
+pointer-middle-button+   [Constant]
+pointer-right-button+   [Constant]
          

Constants that correspond to the left, middle, and right button on a pointing device. pointer-event-button will returns one of these three values. [annotate]

These constants are powers of 2 so that they can be combined with logior and tested with logtest. [annotate]

[annotate]

+shift-key+   [Constant]
+control-key+   [Constant]
+meta-key+   [Constant]
+super-key+   [Constant]
+hyper-key+   [Constant]
          

Constants that correspond to the shift, control, meta, super, and hyper modifier keys being held down on the keyboard. These constants are powers of 2 that are disjoint from the pointer button constants, so that they can be combined with logior and tested with logtest. [annotate]

event-modifier-state will return some combination of these values. [annotate]

Implementations must support at least shift, control, and meta modifiers. Control and meta might correspond to the control and option or command shift keys on a Macintosh keyboard, for example. [annotate]

[annotate]