Skip to content

Instantly share code, notes, and snippets.

@masnana
Created May 4, 2025 15:25
Show Gist options
  • Select an option

  • Save masnana/89d269ec08641a42d6e1a0db5508e573 to your computer and use it in GitHub Desktop.

Select an option

Save masnana/89d269ec08641a42d6e1a0db5508e573 to your computer and use it in GitHub Desktop.

Letters

Key Value
A 65
B 66
C 67
D 68
E 69
F 70
G 71
H 72
I 73
J 74
K 75
L 76
M 77
N 78
O 79
P 80
Q 81
R 82
S 83
T 84
U 85
V 86
W 87
X 88
Y 89
Z 90

Numbers

Key Value
0 48
1 49
2 50
3 51
4 52
5 53
6 54
7 55
8 56
9 57

Function Keys

Key Value
F1 112
F2 113
F3 114
F4 115
F5 116
F6 117
F7 118
F8 119
F9 120
F10 121
F11 122
F12 123

Control Keys

Key Value
Backspace 8
Tab 9
Enter 13
LeftShift 160
RIghtShift 161
Shift 16
LeftCtrl 162
RightCtrl 163
Ctrl 17
LeftAlt 164
RightAlt 165
Alt 18
Pause 19
Caps Lock 20
Escape 27
Spacebar 32

Arrow Keys

Key Value
Left Arrow 37
Up Arrow 38
Right Arrow 39
Down Arrow 40

Numpad Keys

Key Value
Numpad 0 96
Numpad 1 97
Numpad 2 98
Numpad 3 99
Numpad 4 100
Numpad 5 101
Numpad 6 102
Numpad 7 103
Numpad 8 104
Numpad 9 105
Multiply 106
Add 107
Subtract 109
Decimal Point 110
Divide 111

Other Keys

Key Value
Print Screen 44
Insert 45
Delete 46
Home 36
End 35
Page Up 33
Page Down 34
RedM Native Reference
REGISTER_RAW_KEYMAP
REMAP_RAW_KEYMAP
DISABLE_RAW_KEY_THIS_FRAME
IS_RAW_KEY_PRESSED
IS_RAW_KEY_RELEASED
IS_DISABLED_RAW_KEY_PRESSED
IS_DISABLED_RAW_KEY_RELEASED
IS_RAW_KEY_DOWN
IS_RAW_KEY_UP
IS_DISABLED_RAW_KEY_DOWN
IS_DISABLED_RAW_KEY_UP
local KEY_E = 69
local KEY_F = 70
local KEY_SPACE = 32
local canBeDisabled = false

function onKeyDown() print("onKeyDown") end
function onKeyUp() print("onKeyUp") end

RegisterRawKeymap("rawKeyMap", onKeyDown, onKeyUp, KEY_E, canBeDisabled)
RemapRawKeymap("rawKeyMap", KEY_F)

CreateThread(function()
    while true do
        if IsRawKeyPressed(KEY_SPACE) then
            print("Spacebar pressed")
        end
        if IsRawKeyReleased(KEY_SPACE) then
            print("Spacebar released")
        end
        if IsRawKeyUp(KEY_SPACE) then
            print("Spacebar is up")
        end
        if IsRawKeyDown(KEY_SPACE) then
            print("Spacebar is down")
        end
        Wait(0)
    end
end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment