Enumeration ButtonCode

Contains all possible input buttons, including keyboard scan codes, mouse buttons and gamepad buttons.

Constructors

  • Parameters

    • do_not_: undefined
    • construct_: undefined
    • this_: undefined
    • type_: undefined

    Returns ButtonCode

Values

A = 30
Apostrophe = 40
At = 145
B = 48
Back = 14
Backslash = 43
C = 46
CapsLock = 58
Colon = 146
Comma = 51
Command = 219
Count = 249
D = 32
Delete = 211
Down = 208
E = 18
End = 207
Equals = 13
Escape = 1
F = 33
F1 = 59
F10 = 68
F11 = 87
F12 = 88
F13 = 100
F14 = 101
F15 = 102
F2 = 60
F3 = 61
F4 = 62
F5 = 63
F6 = 64
F7 = 65
F8 = 66
F9 = 67
G = 34
GamepadA = 1073742095
GamepadB = 1073742096
GamepadBack = 1073742103
GamepadBtn1 = 1073742109
GamepadBtn10 = 1073742118
GamepadBtn11 = 1073742119
GamepadBtn12 = 1073742120
GamepadBtn13 = 1073742121
GamepadBtn14 = 1073742122
GamepadBtn15 = 1073742123
GamepadBtn16 = 1073742124
GamepadBtn2 = 1073742110
GamepadBtn3 = 1073742111
GamepadBtn4 = 1073742112
GamepadBtn5 = 1073742113
GamepadBtn6 = 1073742114
GamepadBtn7 = 1073742115
GamepadBtn8 = 1073742116
GamepadBtn9 = 1073742117
GamepadDPadLeft = 1073742105
GamepadDPadRight = 1073742106
GamepadDPadUp = 1073742107
GamepadDPatDown = 1073742108
GamepadLb = 1073742099
GamepadLs = 1073742101
GamepadRb = 1073742100
GamepadRs = 1073742102
GamepadStart = 1073742104
GamepadX = 1073742097
GamepadY = 1073742098
Grave = 41
H = 35
Home = 199
I = 23
Insert = 210
J = 36
K = 37
Keypad0 = 82
Keypad1 = 79
Keypad2 = 80
Keypad3 = 81
Keypad4 = 75
Keypad5 = 76
Keypad6 = 77
Keypad7 = 71
Keypad8 = 72
Keypad9 = 73
KeypadAdd = 78
KeypadComma = 179
KeypadDecimal = 83
KeypadDivide = 181
KeypadEquals = 141
KeypadMultiply = 55
KeypadSubtract = 74
L = 38
Left = 203
LeftBracket = 26
LeftControl = 29
LeftMenu = 56
LeftShift = 42
LeftWindows = 219
M = 50
Minus = 12
MouseBtn10 = 2147483895
MouseBtn11 = 2147483896
MouseBtn12 = 2147483897
MouseBtn13 = 2147483898
MouseBtn14 = 2147483899
MouseBtn15 = 2147483900
MouseBtn16 = 2147483901
MouseBtn4 = 2147483889
MouseBtn5 = 2147483890
MouseBtn6 = 2147483891
MouseBtn7 = 2147483892
MouseBtn8 = 2147483893
MouseBtn9 = 2147483894
MouseLeft = 2147483886
MouseMiddle = 2147483888
MouseRight = 2147483887
N = 49
Num0 = 11
Num1 = 2
Num2 = 3
Num3 = 4
Num4 = 5
Num5 = 6
Num6 = 7
Num7 = 8
Num8 = 9
Num9 = 10
NumGamepadButtons = 30
NumKeys = 203
NumLock = 69
NumMouseButtons = 16
NumpadEnter = 156
O = 24
P = 25
PageDown = 209
PageUp = 201
Pause = 197
Period = 52
Q = 16
R = 19
Return = 28
Right = 205
RightBracket = 27
RightControl = 157
RightMenu = 184
RightShift = 54
RightWindows = 220
S = 31
ScrollLock = 70
Semicolon = 39
Slash = 53
Space = 57
T = 20
Tab = 15
U = 22
Unassigned = 0
Up = 200
V = 47
W = 17
X = 45
Y = 21
Z = 44

Methods

  • Takes an array of enum values and combines them as a single enum flag value. This assumes that the target enum is a flag enum that can have their values combined using bitwise operators.

    Type Parameters

    Parameters

    Returns EnumValueTyped<T, number>

    The combined enum value.

  • Type Parameters

    • T

    Parameters

    Returns string

    Compatibility

  • Returns string[]

    Compatibility

  • Parameters

    • index: number

    Returns number

    Compatibility

  • Returns number[]

    Compatibility

  • Gets the name for the enumeration value that matches the specified enumValue.

    Type Parameters

    • T

    Parameters

    Returns string

    The enumeration value or undefined if not found.

  • Gets the enumeration names

    Returns string[]

    The enumeration names.

  • Gets the enumeration value at the specified index.

    Type Parameters

    • T = number

    Parameters

    • index: number

      The index.

    Returns EnumValueTyped<T, number>

    The enumeration value or undefined if not found.

  • Determines if the enum value has the flags set.

    Type Parameters

    Parameters

    Returns boolean

  • Determines if the enum bits were changed from previousValue to currentValue.

    Type Parameters

    Parameters

    Returns boolean

  • Iterates the enumeration names

    Returns Generator<string, any, any>

    The enumeration names.

  • Iterates the enumeration values

    Type Parameters

    • T = any

    Returns Generator<EnumValueTyped<T, number>, any, any>

    The enumeration values.

  • Takes a single enum value and splits it into separated flag values set on the value. This assumes that the target enum is a flag enum that can have their values combined using bitwise operators.

    Type Parameters

    Parameters

    • value: number | BrandedType<number, "enum"> | BrandedType<T, "enum">

      The enum value to have it's value split using bitwise-and operator.

    Returns EnumValueTyped<T, number>[]

    An array of each "bit flag" set in the enum.