All Manuals > LispWorks User Guide and Reference Manual > 49 The SYSTEM Package

NextPrevUpTopContentsIndex

coerce-to-gesture-spec

Function
Summary

Returns a Gesture Spec object.

Package

system

Signature

coerce-to-gesture-spec object &optional errorp => gspec

Arguments

object

A character, keyword, Gesture Spec or string.

errorp

A boolean.

Values

gspec

A Gesture Spec object

Description

The function coerce-to-gesture-spec returns a Gesture Spec object gspec which can be used to represent the keystroke indicated by object.

If object is a Lisp character, then gspec's data is its cl:char-code and gspec's modifiers are 0.

If object is a keyword, then it must be one of the known Gesture Spec keywords and becomes gspec's data. gspec's modifiers is 0.

If object is a string, then coerce-to-gesture-spec expects it to be a sequence of modifier key names separated by the - character, followed by a single character or a character name as returned by name-char or the name of one of the known Gesture Spec keywords. Then gspec contains the corresponding Gesture Spec keyword or char-code in its data, and the modifier keys are represented in its modifiers.

If object is a Gesture Spec object, it is simply returned.

coerce-to-gesture-spec does not create wild gesture specs.

Examples
(sys:coerce-to-gesture-spec :F10)
=>
#S(SYSTEM::GESTURE-SPEC :DATA :F10 :MODIFIERS 0)
 
(sys:coerce-to-gesture-spec "Ctrl-C")
=>
#S(SYSTEM::GESTURE-SPEC :DATA 67 :MODIFIERS 2)
 
(sys:coerce-to-gesture-spec "Shift-F10")
=>
#S(SYSTEM::GESTURE-SPEC :DATA :F10 :MODIFIERS 1)
See also

gesture-spec-control-bit
gesture-spec-data
gesture-spec-modifiers
gesture-spec-p
gesture-spec-to-character
make-gesture-spec
print-pretty-gesture-spec


LispWorks User Guide and Reference Manual - 20 Sep 2017

NextPrevUpTopContentsIndex