All files / tools/src/enums ToolBindings.ts

0% Statements 0/0
0% Branches 0/0
0% Functions 0/0
0% Lines 0/0

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46                                                                                           
/**
 * Mouse This enum enumerates the different buttons returned by `.buttons` on the mouse event.
 * These values are used when setting a tool active in a tool group.
 *
 * See also: https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons
 */
enum MouseBindings {
  /** usually the left button */
  Primary = 1,
  /** usually the right button */
  Secondary = 2,
  Primary_And_Secondary = 3,
  /** usually mouse wheel button */
  Auxiliary = 4,
  Primary_And_Auxiliary = 5,
  Secondary_And_Auxiliary = 6,
  Primary_And_Secondary_And_Auxiliary = 7,
  /** usually "Browser Back" button */
  Fourth_Button = 8,
  /** usually "Browser Forward" button */
  Fifth_Button = 16,
 
  /**
   * The wheel binding selects for the wheel rotation, and does not have
   * separate down/up but only rotation
   */
  Wheel = 524_288,
  /** Wheel rotation plus primary */
  Wheel_Primary = 524_289,
}
 
enum KeyboardBindings {
  Shift = 16,
  Ctrl = 17,
  Alt = 18,
  Meta = 91,
  ShiftCtrl = 1617,
  ShiftAlt = 1618,
  ShiftMeta = 1691,
  CtrlAlt = 1718,
  CtrlMeta = 1791,
  AltMeta = 1891,
}
 
export { MouseBindings, KeyboardBindings };