All Manuals > CAPI User Guide and Reference Manual > 21 CAPI Reference Entries

pane-modifiers-state Function

Summary

Returns an integer describing which modifiers are currently active.

Package

capi

Signature

pane-modifiers-state pane => gesture-spec-bits

Arguments
pane
A CAPI pane.
Values
gesture-spec-bits
An integer or nil.
Description

The function pane-modifiers-state returns an integer describing which modifiers are currently pressed. The modifiers are Control, Shift, Meta and Hyper (representing Command on macOS). It also describes whether Caps Lock is currently on.

pane should be a pane that is displayed on the screen. If it is not displayed, pane-modifiers-state returns nil.

The result is a cl:logior of the following bits:

The Caps Lock bit behaves in a special way: it is on when Caps is locked, rather than when the Caps Lock key is pressed.

For example, to check if the Control modifier is currently pressed call:

(logtest (pane-modifiers-state pane)
         sys:gesture-spec-control-bit)
Notes

On Cocoa sys:gesture-spec-hyper-bit is for Command.

output-pane supports responding to modifier changes - see :modifier-change in the input-model.

sys:gesture-spec-shift-bit and so on are documented in the LispWorks® User Guide and Reference Manual.

See also

output-pane
sys:gesture-spec-shift-bit
sys:gesture-spec-control-bit
sys:gesture-spec-meta-bit
sys:gesture-spec-hyper-bit
sys:gesture-spec-caps-lock-bit
18.3 Modifier keys state


CAPI User Guide and Reference Manual (Macintosh version) - 01 Dec 2021 19:31:27