Docs
CodeRabbit
Cloudflare
AG Grid
SerpAPI
Netlify
OpenRouter
Neon
WorkOS
Clerk
Electric
PowerSync
Sentry
Railway
Prisma
Strapi
Unkey
CodeRabbit
Cloudflare
AG Grid
SerpAPI
Netlify
OpenRouter
Neon
WorkOS
Clerk
Electric
PowerSync
Sentry
Railway
Prisma
Strapi
Unkey
API Reference
Hotkeys API Reference
Hotkey Sequence API Reference
Key Hold API Reference
Held Keys API Reference
Hotkey Recorder API Reference
Hotkey Sequence Recorder API Reference
Format for Display API Reference

isModifierKey

Function: isModifierKey()

ts
function isModifierKey(event): boolean;

Defined in: parse.ts:284

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

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