List with keycodes

SIGKILL

Active member
Joined
Apr 29, 2020
Messages
37
Reaction score
22
Location
Earth
GTA has an internal table which contains states of your keys. You can find this state if you know the right memory offset. The table begins at 0xB72CC8. To find the key of interest use the following formula:

0xB72CC8 + key * 2

C++:
enum KeyCode
{
    KEY_BACKSPACE = 0x11E,
    KEY_TAB = 0x11F,   
    KEY_CAPSLOCK = 0x120,
    KEY_RETURN = 0x121,
    KEY_LEFTSHIFT = 0x122,
    KEY_RIGHTSHIFT = 0x123,
    KEY_LEFTCONTROL = 0x125,
    KEY_RIGHTCONTROL = 0x126,
    KEY_LEFTALT = 0x127,
    KEY_RIGHTALT = 0x128,
    KEY_F1 = 0x12C,
    KEY_F2 = 0x12D,
    KEY_F3 = 0x12E,
    KEY_F4 = 0x12F,
    KEY_F5 = 0x130,
    KEY_F6 = 0x131,
    KEY_F7 = 0x132,
    KEY_F8 = 0x133,
    KEY_F9 = 0x134,
    KEY_F10 = 0x135,
    KEY_F11 = 0x136,
    KEY_F12 = 0x137,
    KEY_SPACE = 0x158,
    KEY_ALPAHA0 = 0x168,
    KEY_ALPAHA1 = 0x169,
    KEY_ALPAHA2 = 0x16A,
    KEY_ALPAHA3 = 0x16B,
    KEY_ALPAHA4 = 0x16C,
    KEY_ALPAHA5 = 0x16D,
    KEY_ALPAHA6 = 0x16E,
    KEY_ALPAHA7 = 0x16F,
    KEY_ALPAHA8 = 0x170,
    KEY_ALPAHA9 = 0x171,
    KEY_A = 0x179,
    KEY_B = 0x17A,
    KEY_C = 0x17C,
    KEY_D = 0x17C,
    KEY_E = 0x17D,
    KEY_F = 0x17E,
    KEY_G = 0x17F,
    KEY_H = 0x180,
    KEY_I = 0x181,
    KEY_J = 0x182,
    KEY_K = 0x183,
    KEY_L = 0x184,
    KEY_M = 0x185,
    KEY_N = 0x186,
    KEY_O = 0x187,
    KEY_P = 0x188,
    KEY_Q = 0x189,
    KEY_R = 0x18A,
    KEY_S = 0x18B,
    KEY_T = 0x18C,
    KEY_U = 0x18D,
    KEY_V = 0x18E,
    KEY_W = 0x18F,
    KEY_X = 0x190,
    KEY_Y = 0x191,
    KEY_Z = 0x192,
    KEY_NUMLOCK = 0x245,
    KEY_KEYPADDIVIDE = 0x246,
    KEY_KEYPADMULTIPLY = 0x247,
    KEY_KEYPADMINUS = 0x248,
    KEY_KEYPADPLUS = 0x249,
    KEY_KEYPADRETURN = 0x24A,
    KEY_KEYPADPERIOD = 0x24B,
    KEY_KEYPAD1 = 0x24C,
    KEY_KEYPAD2 = 0x24D,
    KEY_KEYPAD3 = 0x24E,
    KEY_KEYPAD4 = 0x24F,
    KEY_KEYPAD5 = 0x250,
    KEY_KEYPAD6 = 0x251,
    KEY_KEYPAD7 = 0x252,
    KEY_KEYPAD8 = 0x253,
    KEY_KEYPAD9 = 0x254,
    KEY_KEYPAD0 = 0x255,
    KEY_QUOTE = 0x297,
    KEY_COMMA = 0x29C,
    KEY_PERIOD = 0x29E,
    KEY_SLASH = 0x29F,
    KEY_SEMICOLON = 0x2AB,
    KEY_MINUS = 0x29D,
    KEY_PLUS = 0x2AD,
    KEY_LEFTBRACKET = 0x2CB,
    KEY_BACKSLASH = 0x2CC,
    KEY_RIGHTBRACKET = 0x2CD,
    KEY_TILDE = 0x2D0,
    KEY_INSERT = 0x371,
    KEY_HOME = 0x373,
    KEY_END = 0x374,
    KEY_DELETE = 0x372,
    KEY_PAGEUP = 0x375,
    KEY_PAGEDOWN = 0x376,
    KEY_UPARROW = 0x377,
    KEY_DOWNARROW = 0x378,
    KEY_LEFTARROW = 0x379,
    KEY_RIGHTARROW = 0x37A,
    KEY_SCROLLLOCK = 0x37B,
    KEY_PAUSE = 0x37C
};

Thanks to @Parazitas for the formula!
 
Last edited by a moderator:

SIGKILL

Active member
Joined
Apr 29, 2020
Messages
37
Reaction score
22
Location
Earth
Before just copying and pasting note that there's an error. KEY_C should be 0x17B and not 0x17C. I'm still waiting for that moment that we can edit posts...
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,112
Solutions
5
Reaction score
878
Location
Lithuania
I'm still waiting for that moment that we can edit posts...
According @0x_ this function was disabled because peoples keep editing and deleting everything what they write straight away after they got what wanted..
 

0x_

Wtf I'm not new....
Administrator
Joined
Feb 18, 2013
Messages
1,118
Reaction score
166
According @0x_ this function was disabled because peoples keep editing and deleting everything what they write straight away after they got what wanted..
Not exactly, the edit function should only be blocked on release type of posts I'll look into once I have the sufficient time to reconfigure the settings for other boards.
 
Top