04-03-2023, 08:40 PM
I found a library called:
' GX - A BASIC Game Engine for QB64
' 2021 boxgaming - https://github.com/boxgaming/gx
that had mapped all the _BUTTON vales to keys in a file called gx.bi. I used that as a basis to create the code below if anyone needs the _BUTTON values for the keyboard.
' GX - A BASIC Game Engine for QB64
' 2021 boxgaming - https://github.com/boxgaming/gx
that had mapped all the _BUTTON vales to keys in a file called gx.bi. I used that as a basis to create the code below if anyone needs the _BUTTON values for the keyboard.
Code: (Select All)
' __________________________________________________________________________________________________________________________________________________
'/ KEYBOARD KEY _BUTTON CONSTANTS \
CONST GLKEY_ESC = 2 ' |
CONST GLKEY_F1 = 60 ' FUNCTION KEY ROW _BUTTON CONSTANTS |
CONST GLKEY_F2 = 61 ' _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ |
CONST GLKEY_F3 = 62 ' ||ESC|| ||F1 |||F2 |||F3 |||F4 || ||F5 |||F6 |||F7 |||F8 || ||F9 |||N/A|||F11|||F12|| |
CONST GLKEY_F4 = 63 ' ||___|| ||___|||___|||___|||___|| ||___|||___|||___|||___|| ||___|||___|||___|||___|| |
CONST GLKEY_F5 = 64 ' |/___\| |/___\|/___\|/___\|/___\| |/___\|/___\|/___\|/___\| |/___\|/___\|/___\|/___\| |
CONST GLKEY_F6 = 65 ' |
CONST GLKEY_F7 = 66 ' NOTE: F10 does not register as a _BUTTON. I know, strange but true. |
CONST GLKEY_F8 = 67 ' |
CONST GLKEY_F9 = 68 ' |
CONST GLKEY_F11 = 88 ' |
CONST GLKEY_F12 = 89 ' |
CONST GLKEY_BACKQUOTE = 42 ' ----------------------------------------------------------------------------------------- |
CONST GLKEY_1 = 3 ' FIRST KEY ROW _BUTTON CONSTANTS |
CONST GLKEY_2 = 4 ' |
CONST GLKEY_3 = 5 ' _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _________ |
CONST GLKEY_4 = 6 ' ||`~ |||1! |||2@ |||3# |||4$ |||5% |||6^ |||7& |||8* |||9( |||0) |||-_ |||=+ |||BACKSP || |
CONST GLKEY_5 = 7 ' ||___|||___|||___|||___|||___|||___|||___|||___|||___|||___|||___|||___|||___|||_______|| |
CONST GLKEY_6 = 8 ' |/___\|/___\|/___\|/___\|/___\|/___\|/___\|/___\|/___\|/___\|/___\|/___\|/___\|/_______\| |
CONST GLKEY_7 = 9 ' |
CONST GLKEY_8 = 10 ' |
CONST GLKEY_9 = 11 ' |
CONST GLKEY_0 = 12 ' |
CONST GLKEY_MINUS = 13 ' |
CONST GLKEY_EQUALS = 14 ' |
CONST GLKEY_BACKSPACE = 15 ' |
CONST GLKEY_TAB = 16 ' ----------------------------------------------------------------------------------------- |
CONST GLKEY_Q = 17 ' SECOND KEY ROW _BUTTON CONSTANTS |
CONST GLKEY_W = 18 ' |
CONST GLKEY_E = 19 ' _______ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _______ |
CONST GLKEY_R = 20 ' ||TAB |||Q |||W |||E |||R |||T |||Y |||U |||I |||O |||P |||[{ |||]} |||\| || |
CONST GLKEY_T = 21 ' ||_____|||___|||___|||___|||___|||___|||___|||___|||___|||___|||___|||___|||___|||_____|| |
CONST GLKEY_Y = 22 ' |/_____\|/___\|/___\|/___\|/___\|/___\|/___\|/___\|/___\|/___\|/___\|/___\|/___\|/_____\| |
CONST GLKEY_U = 23 ' |
CONST GLKEY_I = 24 ' |
CONST GLKEY_O = 25 ' |
CONST GLKEY_P = 26 ' |
CONST GLKEY_LBRACKET = 27 ' |
CONST GLKEY_RBRACKET = 28 ' |
CONST GLKEY_BACKSLASH = 44 ' |
CONST GLKEY_CAPSLOCK = 59 ' ----------------------------------------------------------------------------------------- |
CONST GLKEY_A = 31 ' THIRD KEY ROW _BUTTON CONSTANTS |
CONST GLKEY_S = 32 ' |
CONST GLKEY_D = 33 ' ________ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ ____________ |
CONST GLKEY_F = 34 ' ||CAPS |||A |||S |||D |||F |||G |||H |||J |||K |||L |||;: |||'" |||ENTER || |
CONST GLKEY_G = 35 ' ||______|||___|||___|||___|||___|||___|||___|||___|||___|||___|||___|||___|||__________|| |
CONST GLKEY_H = 36 ' |/______\|/___\|/___\|/___\|/___\|/___\|/___\|/___\|/___\|/___\|/___\|/___\|/__________\| |
CONST GLKEY_J = 37 ' |
CONST GLKEY_K = 38 ' |
CONST GLKEY_L = 39 ' |
CONST GLKEY_SEMICOLON = 40 ' |
CONST GLKEY_QUOTE = 41 ' |
CONST GLKEY_ENTER = 29 ' |
CONST GLKEY_LSHIFT = 43 ' ----------------------------------------------------------------------------------------- |
CONST GLKEY_Z = 45 ' FOURTH KEY ROW _BUTTON CONSTANTS |
CONST GLKEY_X = 46 ' |
CONST GLKEY_C = 47 ' _____________ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____________ |
CONST GLKEY_V = 48 ' ||LEFT SHIFT |||Z |||X |||C |||V |||B |||N |||M |||,< |||.> |||/? |||RIGHT SHIFT|| |
CONST GLKEY_B = 49 ' ||___________|||___|||___|||___|||___|||___|||___|||___|||___|||___|||___|||___________|| |
CONST GLKEY_N = 50 ' |/___________\|/___\|/___\|/___\|/___\|/___\|/___\|/___\|/___\|/___\|/___\|/___________\| |
CONST GLKEY_M = 51 ' |
CONST GLKEY_COMMA = 52 ' |
CONST GLKEY_PERIOD = 53 ' |
CONST GLKEY_SLASH = 54 ' |
CONST GLKEY_RSHIFT = 55 ' |
CONST GLKEY_LCTRL = 30 ' ----------------------------------------------------------------------------------------- |
CONST GLKEY_LWIN = 348 ' FIFTH KEY ROW _BUTTON CONSTANTS |
CONST GLKEY_SPACEBAR = 58 ' |
CONST GLKEY_RWIN = 349 ' ______ ______ ______ _____________________________________________ ______ ______ ______ |
CONST GLKEY_RCTRL = 286 ' ||LCTL|||LWIN|||MENU|||SPACEBAR |||N/A |||RWIN|||RCTL|| |
CONST GLKEY_MENU = 350 ' ||____|||____|||____|||___________________________________________|||____|||____|||____|| |
' |/____\|/____\|/____\|/___________________________________________\|/____\|/____\|/____\| |
' |
CONST GLKEY_NUMLOCK = 326 ' ----------------------------------------------------------------------------------------- |
CONST GLKEY_NUMPAD_DIVIDE = 310 ' NUMBER PAD _BUTTON CONSTANTS |
CONST GLKEY_NUMPAD_MULTIPLY = 56 ' |
CONST GLKEY_NUMPAD_MINUS = 75 ' _____ _____ _____ _____ |
CONST GLKEY_NUMPAD_7 = 72 ' ||NUM|||/ |||* |||- || |
CONST GLKEY_NUMPAD_8 = 73 ' ||___|||___|||___|||___|| |
CONST GLKEY_NUMPAD_9 = 74 ' |/___\|/___\|/___\|/___\| |
CONST GLKEY_NUMPAD_PLUS = 79 ' _____ _____ _____ _____ |
CONST GLKEY_NUMPAD_4 = 76 ' ||7 |||8 |||9 |||+ || |
CONST GLKEY_NUMPAD_5 = 77 ' ||___|||___|||___||| || |
CONST GLKEY_NUMPAD_6 = 78 ' |/___\|/___\|/___\|| || |
CONST GLKEY_NUMPAD_1 = 80 ' _____ _____ _____|| || |
CONST GLKEY_NUMPAD_2 = 81 ' ||4 |||5 |||6 ||| || |
CONST GLKEY_NUMPAD_3 = 82 ' ||___|||___|||___|||___|| |
CONST GLKEY_NUMPAD_ENTER = 285 ' |/___\|/___\|/___\|/___\| |
CONST GLKEY_NUMPAD_0 = 83 ' _____ _____ _____ _____ |
CONST GLKEY_NUMPAD_PERIOD = 84 ' ||1 |||2 |||3 |||E || |
' ||___|||___|||___|||N || |
' |/___\|/___\|/___\||T || |
' ___________ _____||E || |
' ||0 |||. |||R || |
' ||_________|||___|||___|| |
' |/_________\|/___\|/___\| |
' |
CONST GLKEY_UP = 329 ' ----------------------------------------------------------------------------------------- |
CONST GLKEY_LEFT = 332 ' ARROW KEY _BUTTON CONSTANTS |
CONST GLKEY_DOWN = 337 ' |
CONST GLKEY_RIGHT = 334 ' _____ |
' || ^ || |
' ||___|| |
' |/___\| |
' _____ _____ _____ |
' || < ||| V ||| > || |
' ||___|||___|||___|| |
' |/___\|/___\|/___\| |
' |
CONST GLKEY_SCRLK = 71 ' ----------------------------------------------------------------------------------------- |
CONST GLKEY_PAUSE = 70 ' POSITION KEY _BUTTON CONSTANTS |
CONST GLKEY_INSERT = 339 ' |
CONST GLKEY_HOME = 328 ' _____ _____ _____ |
CONST GLKEY_PAGEUP = 330 ' ||N/A|||SCR|||PAU|| |
CONST GLKEY_DELETE = 340 ' ||___|||___|||___|| |
CONST GLKEY_END = 336 ' |/___\|/___\|/___\| |
CONST GLKEY_PAGEDOWN = 338 ' _____ _____ _____| |
' ||INS|||HOM|||PUP|| |
' ||___|||___|||___|| |
' |/___\|/___\|/___\| |
' _____ _____ _____ |
' ||DEL|||END|||PDN|| |
' ||___|||___|||___|| |
' |/___\|/___\|/___\| |
' |
'\__________________________________________________________________________________________________________________________________________________/