All Manuals > Common Lisp Interface Manager 2.0 User's Guide > Chapter 18 Sheets

NextPrevUpTopContentsIndex

18.6 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 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.

 

Figure 35. CLIM Event Classes
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]	

Arguments: object

Summary: Returns t if object is an event; otherwise, it returns nil .

:timestamp

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

event-timestamp [Generic Function]

Arguments: event

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.

event-type [Generic Function]

Arguments: event

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 .

device-event

:sheet

:modifier-state

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]

Arguments: device-event

Summary: Returns the sheet associated with the event device-event .

event-modifier-state [Generic Function]

Arguments: device-event

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 .

keyboard-event

:key-name

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]

Arguments: keyboard-event

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]

Arguments: keyboard-event

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 .

key-press-event

key-release-event

Summary: The classes corresponding to key press or release events. They are subclasses of keyboard-event .

pointer-event

:pointer

:button

:x

:y

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]

Arguments: pointer-event

pointer-event-y [Generic Function]

Arguments: pointer-event

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]

Arguments: pointer-event

pointer-event-native-y [Generic Function]

Arguments: pointer-event

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]

Arguments: pointer-event

Summary: Returns the pointer object to which this event refers.

pointer-event-button [Generic Function]

Arguments: pointer-event

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.

pointer-button-event

Summary: The class corresponding to any sort of pointer button event. It is a subclass of pointer-event .

pointer-button-press-event

pointer-button-release-event

pointer-button-hold-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-click-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.

pointer-motion-event

Summary: The class that corresponds to any sort of pointer motion event. This is a subclass of pointer-event .

pointer-enter-event

pointer-exit-event

Summary: The classes that correspond to a pointer enter or exit event. This is a subclass of pointer-motion-event .

window-event

:region

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]

Arguments: window-event

Summary: Returns the region of the sheet that is affected by a window event.

window-event-native-region [Generic Function]

Arguments: window-event

Summary: Returns the region of the sheet in native coordinates.

window-event-mirrored-sheet [Generic Function]

Arguments: window-event

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 .

window-configuration-event

Summary: The class that corresponds to a window changing its size or position. This is a subclass of window-event .

window-repaint-event

Summary: The class that corresponds to a request to repaint the window. This is a subclass of window-event .

timer-event

Summary: The class that corresponds to a timeout event. This is a subclass of event .

+pointer-left-button+

+pointer-middle-button+

+pointer-right-button+

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.

+shift-key+

+control-key+

+meta-key+

+super-key+

+hyper-key+

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 clause may be one of:

A pointer button (one of :left , :middle , or :right )

A modifier key (one of :shift , :control , :meta , :super , or :hyper )

(and [ clause ]+)

(or [ clause ]+)

(not clause )


Common Lisp Interface Manager 2.0 User's Guide - 3 Mar 2015

NextPrevUpTopContentsIndex