Modifier Active

Returns a boolean indicating if the target modifier is active.

Syntax

function getModifier(state, modifier) {
  return state.command.activeModifiers.has(modifier);
}

Parameters

modifier

The target modifier that may be active. A full list of available command ids can be found here.

Examples

Returns whether the fast forward hotkey is currently active.

getModifier(
  store.getState(),
  "modifiers.fastForward"
)