Skip to content

Latest commit

 

History

History
44 lines (30 loc) · 873 Bytes

File metadata and controls

44 lines (30 loc) · 873 Bytes
id isModifierKey
title isModifierKey

Function: isModifierKey()

function isModifierKey(event): boolean;

Defined in: parse.ts:292

Checks if a KeyboardEvent represents a modifier-only key press.

Modifier-only keys are keys like 'Control', 'Shift', 'Alt', 'Meta', etc. that don't have an associated character or action key. This is useful for filtering out modifier key presses when recording shortcuts.

Parameters

event

KeyboardEvent

The KeyboardEvent to check

Returns

boolean

True if the event represents a modifier-only key

Example

document.addEventListener('keydown', (event) => {
  if (isModifierKey(event)) {
    console.log('Modifier key pressed, waiting for action key...')
    return
  }
  // Process non-modifier key
})