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
Hotkeys API Reference
App Hotkeys API Reference
Key hold & held keys API Reference
Hotkey Recorder API Reference
Normalization & format API Reference

hasNonModifierKey

ts
function hasNonModifierKey(chord, platform?): boolean;
function hasNonModifierKey(chord, platform?): boolean;

Defined in: parse.ts:346

Checks if a chord contains at least one non-modifier key.

This is useful for validating that a recorded chord is complete and not just a combination of modifiers without an action key.

Parameters

chord

| HotkeyChord | string & object | ParsedHotkeyChord

The chord string or parsed chord to check

platform?

Platform = ...

The target platform for parsing (defaults to auto-detection)

Returns

boolean

True if the chord contains at least one non-modifier key

Example

ts
hasNonModifierKey('Control+Shift+S') // true
hasNonModifierKey('Control+Shift') // false (no action key)
hasNonModifierKey(parseHotkey('Mod+A')) // true
hasNonModifierKey('Control+Shift+S') // true
hasNonModifierKey('Control+Shift') // false (no action key)
hasNonModifierKey(parseHotkey('Mod+A')) // true