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 position of the pointer within that sheet, the key name or character corresponding to a key on the keyboard, and so forth.
Figure 35. shows all the event classes. All classes are indented to the right of their superclasses.
event [Protocol Class]
Summary: 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 . Subclasses of event must obey the event protocol.
All of the event classes are immutable.
eventp [Function]
Summary: Returns t if object is an event; otherwise, it returns nil .
Summary: All subclasses of event must take a :timestamp initarg, which is used to specify the timestamp for the event.
event-timestamp [Generic Function]
Summary: Returns an integer that is a monotonically increasing timestamp for the event event . The timestamp must have at least as many bits of precision as a fixnum.
Summary: 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 .
All event classes must implement methods for event-type and event-timestamp .
Summary: The class that corresponds to any sort of device event. This is a subclass of event .
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.
event-sheet [Generic Function]
Summary: Returns the sheet associated with the event device-event .
event-modifier-state [Generic Function]
Summary: Returns a value that encodes the state of all the modifier keys on the keyboard. This will be a mask consisting of the logical-or of +shift-key+ , +control-key+ , +meta-key+ , +super-key+ , and +hyper-key+ .
All device event classes must implement methods for event-sheet and event-modifier-state .
Summary: The class corresponding to any keyboard event; a subclass of device-event .
All subclasses of keyboard-event must take the :key-name initarg, which is used to specify the key name component for the event.
keyboard-event-key-name [Generic Function]
Summary: Returns the name of the key pressed or released in a keyboard event. This will be a symbol whose value is port-specific. Key names corresponding to standard characters such as the alphanumerics will be symbols in the keyword package.
keyboard-event-character [Generic Function]
Summary: Returns the character associated with the event keyboard-event , if there is any.
All keyboard event classes must implement methods for keyboard-event-key-name and keyboard-event-character .
Summary: The classes corresponding to key press or release events. They are subclasses of keyboard-event .
Summary: The class corresponding to any pointer event. This is a subclass of device-event .
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.
pointer-event-x [Generic Function]
pointer-event-y [Generic Function]
Summary: 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.
pointer-event-native-x [Generic Function]
pointer-event-native-y [Generic Function]
Summary: 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.
pointer-event-pointer [Generic Function]
Summary: Returns the pointer object to which this event refers.
pointer-event-button [Generic Function]
Summary: Returns an integer, the number of the pointer button that was pressed. Programs should compare this against the constants +pointer-left-button+ , +pointer-middle-button+ , and +pointer-right-button+ to see what value was returned.
All pointer event classes must implement methods for pointer-event-x , pointer-event-y , pointer-event-native-x , pointer-event-native-y , pointer-event-pointer , and pointer-event-button .
pointer-event-shift-mask[Generic Function]
Arguments: pointer-button-event
Summary: Returns the state of the keyboard's shift keys when pointer-button-event occurred.
Summary: The class corresponding to any sort of pointer button event. It is a subclass of pointer-event .
Summary: The classes that correspond to a pointer button press, button release, and click-and-hold events. These are subclasses of pointer-button-event .
pointer-button-double-click-event
pointer-button-click-and-hold-event
Summary: The classes that correspond to a pointer button press followed 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.
Summary: The class that corresponds to any sort of pointer motion event. This is a subclass of pointer-event .
Summary: The classes that correspond to a pointer enter or exit event. This is a subclass of pointer-motion-event .
Summary: The class that corresponds to any sort of windowing event. This is a subclass of device-event .
All subclasses of window-event must take a :region initarg, which is used to specify the damage region associated with the event.
window-event-region [Generic Function]
Summary: Returns the region of the sheet that is affected by a window event.
window-event-native-region [Generic Function]
Summary: Returns the region of the sheet in native coordinates.
window-event-mirrored-sheet [Generic Function]
Summary: Returns the mirrored sheet that is attached to the mirror on which the event occurred.
All window event classes must implement methods for window-event-region , window-event-native-region , and window-event-mirrored-sheet .
Summary: The class that corresponds to a window changing its size or position. This is a subclass of window-event .
Summary: The class that corresponds to a request to repaint the window. This is a subclass of window-event .
Summary: The class that corresponds to a timeout event. This is a subclass of event .
Summary: Constants that correspond to the left, middle, and right button on a pointing device. pointer-event-button will returns one of these three values.
Summary: Constants that correspond to the
SHIFT
,
CONTROL
,
META
,
SUPER
, and
HYPER
modifier keys being held down on the keyboard. These constants must be powers of 2 so that they can be combined with
logical-or
and tested with
logtest
.
event-modifier-state
will return some combination of these values.
CLIM does not provide default key mappings for
META
,
HYPER
, or
SUPER
modifier keys, as they are keyboard/X-server specific.
key-modifier-state-match-p [Macro]
Arguments: button modifier-state
&body
clauses
Summary: This macro generates code that will check whether the modifier state modifier-state and the pointer button button match all of the clauses. clauses are implicitly grouped by and . Matching a button or a modifier means that the modifier state indicates that the button or modifier is pressed.
A pointer button (one of :left , :middle , or :right )
A modifier key (one of :shift , :control , :meta , :super , or :hyper )
Common Lisp Interface Manager 2.0 User's Guide - 7 Aug 2017