Options
All
  • Public
  • Public/Protected
  • All
Menu

Module modifiers

Support functions and constants that assist in interpreting the result of PluginContext.getModifiers(). Useful mainly for ACTIVATED plug-ins. Can also be used when interpreting various input events in event listeners.

Include this library by adding useLibrary("modifiers") to your script.

Index

Variables

Const ALT

ALT: number

Constant representing the Alt (somtimes called Option) key.

Const COMMAND

COMMAND: number

Constant representing the Command key; alias for META.

Const CONTROL

CONTROL: number

Constant representing the Control key; alias for CTRL.

Const CTRL

CTRL: number

Constant representing the Control key; alias for CONTROL.

Const MENU

MENU: number

Constant representing whichever key is typicaly used for menu accelerators and commands such as Copy and Paste. For example, this is equivalent to CONTROL on Windows and Linux, and COMMAND on macOS.

Const META

META: number

Constant representing the Meta key; alias for COMMAND.

Const SHIFT

SHIFT: number

Constant representing the Shift key.

Functions

allPressed

  • allPressed(modifierState: number, modifiers: number): any
  • Returns whether the modifier state indicates that all of the specified modifier keys (and no other modifier keys) are held down.

    Parameters

    • modifierState: number

      the modifier key state to test; if missing the state from the PluginContext is used

    • modifiers: number

      the bitwise logical or of constants for the modifier keys to test

    Returns any

    true if all of the specified keys are held down, according to the modifier state

anyPressed

  • anyPressed(modifiers: number): any
  • anyPressed(modifierState: number, modifiers: number): any
  • anyPressed(modifiers: number): any
  • Returns whether PluginContext.getModifiers() indicates that all of the specified modifier keys (and no other modifier keys) are held down. For example, allPressed(CONTROL|SHIFT) returns true only if Control and Shift are both held down.

    Parameters

    • modifiers: number

      the bitwise logical or of constants for the modifier keys to test

    Returns any

    true if any of the specified keys are held down, according to the plug-in context

  • Returns whether the modifier state indicates that any of the specified modifier keys are held down.

    Parameters

    • modifierState: number

      the modifier key state to test; if missing the state from the PluginContext is used

    • modifiers: number

      the bitwise logical or of constants for the modifier keys to test

    Returns any

    true if any of the specified keys are held down, according to the modifier state

  • Returns whether PluginContext.getModifiers() indicates that any of the specified modifier keys are held down. For example, anyPressed(CONTROL|SHIFT) returns true only if either Control or Shift are held down.

    Parameters

    • modifiers: number

      the bitwise logical or of constants for the modifier keys to test

    Returns any

    true if any of the specified keys are held down, according to the plug-in context