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) - 25 Feb 2015