You can query the state of the modifier keys (Control, Shift, Meta, Command (Hyper) and Caps Lock) by calling pane-modifiers-state.
Control
Shift
Meta
Command
Hyper
Caps Lock
CAPI User Guide and Reference Manual (Unix version) - 01 Dec 2021 19:32:40