Skip to main content

primary_modifier_with_shift

Function primary_modifier_with_shift 

Source
pub fn primary_modifier_with_shift(mods: &ModifiersState) -> bool
Expand description

Returns true when the platform’s primary modifier key and Shift are held, and no other modifiers are held, i.e.:

  • macOS: Cmd+Shift; Alt and Ctrl not pressed
  • Windows/Linux: Ctrl+Shift; Alt and Super not pressed

Use this for shortcuts that require Shift to avoid conflicts (Cmd+Shift+] on macOS / Ctrl+Shift+] elsewhere). Like primary_modifier, this excludes the cross modifier and Alt so that combos such as Ctrl+Cmd+Shift+] do not shadow separate keybindings.