Skip to main content

classify_control_mode_key

Function classify_control_mode_key 

fn classify_control_mode_key(
    virtual_key: VIRTUAL_KEY,
    control_key_state: u32,
) -> ControlModeAction
Expand description

Classifies a top-level control-mode keystroke.

control_key_state is ANDed with MODIFIER_MASK so lock toggles (CAPSLOCK_ON, NUMLOCK_ON, SCROLLLOCK_ON) and the ENHANCED_KEY flag never bleed into the match - the (VK_*, 0) arms must still fire while any of those bits are set. Any “real” modifier bit (Ctrl / Alt / Shift) survives the mask and falls through to ControlModeAction::NoOp.

§Arguments

  • virtual_key - The pressed key’s [VIRTUAL_KEY].
  • control_key_state - The raw dwControlKeyState field from the [KEY_EVENT_RECORD].

§Returns

The ControlModeAction the dispatch should execute.