SENDKEYS Win32 API Constants
#1
Hi Royal Subjects,

Ever get tired of looking up virtual key codes for things like using SENDKEYS in Win32 API? I sure do, and no matter how many Midol I pop, it doesn't seem to help. Did you know they now come in chewables? Umm, cherry, but I digress...

So while we went off topic to talk bloat, here's some bloat that's back on topic!

Code: (Select All)
DECLARE DYNAMIC LIBRARY "user32"
    SUB SENDKEYS ALIAS keybd_event (BYVAL bVk AS LONG, BYVAL bScan AS LONG, BYVAL dwFlags AS _UNSIGNED LONG, BYVAL dwExtraInfo AS _UNSIGNED LONG)
END DECLARE

CONST KEYEVENTF_KEYUP = &H2 ' Key up (Released).
CONST VK_LBUTTON = &H01 'Left mouse button
CONST VK_RBUTTON = &H02 'Right mouse button
CONST VK_CANCEL = &H03 'Control-break processing
CONST VK_MBUTTON = &H04 'Middle mouse button (three-button mouse)
CONST VK_XBUTTON1 = &H05 'X1 mouse button
CONST VK_XBUTTON2 = &H06 'X2 mouse button
CONST VK_BACK = &H08 'BACKSPACE key
CONST VK_TAB = &H09 'TAB key
CONST VK_CLEAR = &H0C 'CLEAR key
CONST VK_RETURN = &H0D 'ENTER key
CONST VK_SHIFT = &H10 'SHIFT key
CONST VK_CONTROL = &H11 'CTRL key
CONST VK_MENU = &H12 'ALT key
CONST VK_PAUSE = &H13 'PAUSE key
CONST VK_CAPITAL = &H14 'CAPS LOCK key
CONST VK_KANA = &H15 'IME Kana mode
CONST VK_HANGUEL = &H15 'IME Hanguel mode (maintained for compatibility; use VK_HANGUL)
CONST VK_HANGUL = &H15 'IME Hangul mode
CONST VK_IME_ON = &H16 'IME On
CONST VK_JUNJA = &H17 'IME Junja mode
CONST VK_FINAL = &H18 'IME final mode
CONST VK_HANJA = &H19 'IME Hanja mode
CONST VK_KANJI = &H19 'IME Kanji mode
CONST VK_IME_OFF = &H1A 'IME Off
CONST VK_ESCAPE = &H1B 'ESC key
CONST VK_CONVERT = &H1C 'IME convert
CONST VK_NONCONVERT = &H1D 'IME nonconvert
CONST VK_ACCEPT = &H1E 'IME accept
CONST VK_MODECHANGE = &H1F 'IME mode change request
CONST VK_SPACE = &H20 'SPACEBAR
CONST VK_PRIOR = &H21 'PAGE UP key
CONST VK_NEXT = &H22 'PAGE DOWN key
CONST VK_END = &H23 'END key
CONST VK_HOME = &H24 'HOME key
CONST VK_LEFT = &H25 'LEFT ARROW key
CONST VK_UP = &H26 'UP ARROW key
CONST VK_RIGHT = &H27 'RIGHT ARROW key
CONST VK_DOWN = &H28 'DOWN ARROW key
CONST VK_SELECT = &H29 'SELECT key
CONST VK_PRINT = &H2A 'PRINT key
CONST VK_EXECUTE = &H2B 'EXECUTE key
CONST VK_SNAPSHOT = &H2C 'PRINT SCREEN key
CONST VK_INSERT = &H2D 'INS key
CONST VK_DELETE = &H2E 'DEL key
CONST VK_HELP = &H2F 'HELP key
CONST VK_LWIN = &H5B 'Left Windows key (Natural keyboard)
CONST VK_RWIN = &H5C 'Right Windows key (Natural keyboard)
CONST VK_APPS = &H5D 'Applications key (Natural keyboard)
CONST VK_SLEEP = &H5F 'Computer Sleep key
CONST VK_NUMPAD0 = &H60 'Numeric keypad 0 key
CONST VK_NUMPAD1 = &H61 'Numeric keypad 1 key
CONST VK_NUMPAD2 = &H62 'Numeric keypad 2 key
CONST VK_NUMPAD3 = &H63 'Numeric keypad 3 key
CONST VK_NUMPAD4 = &H64 'Numeric keypad 4 key
CONST VK_NUMPAD5 = &H65 'Numeric keypad 5 key
CONST VK_NUMPAD6 = &H66 'Numeric keypad 6 key
CONST VK_NUMPAD7 = &H67 'Numeric keypad 7 key
CONST VK_NUMPAD8 = &H68 'Numeric keypad 8 key
CONST VK_NUMPAD9 = &H69 'Numeric keypad 9 key
CONST VK_MULTIPLY = &H6A 'Multiply key
CONST VK_ADD = &H6B 'Add key
CONST VK_SEPARATOR = &H6C 'Separator key
CONST VK_SUBTRACT = &H6D 'Subtract key
CONST VK_DECIMAL = &H6E 'Decimal key
CONST VK_DIVIDE = &H6F 'Divide key
CONST VK_F1 = &H70 'F1 key
CONST VK_F2 = &H71 'F2 key
CONST VK_F3 = &H72 'F3 key
CONST VK_F4 = &H73 'F4 key
CONST VK_F5 = &H74 'F5 key
CONST VK_F6 = &H75 'F6 key
CONST VK_F7 = &H76 'F7 key
CONST VK_F8 = &H77 'F8 key
CONST VK_F9 = &H78 'F9 key
CONST VK_F10 = &H79 'F10 key
CONST VK_F11 = &H7A 'F11 key
CONST VK_F12 = &H7B 'F12 key
CONST VK_F13 = &H7C 'F13 key
CONST VK_F14 = &H7D 'F14 key
CONST VK_F15 = &H7E 'F15 key
CONST VK_F16 = &H7F 'F16 key
CONST VK_F17 = &H80 'F17 key
CONST VK_F18 = &H81 'F18 key
CONST VK_F19 = &H82 'F19 key
CONST VK_F20 = &H83 'F20 key
CONST VK_F21 = &H84 'F21 key
CONST VK_F22 = &H85 'F22 key
CONST VK_F23 = &H86 'F23 key
CONST VK_F24 = &H87 'F24 key
CONST VK_NUMLOCK = &H90 'NUM LOCK key
CONST VK_SCROLL = &H91 'SCROLL LOCK key
CONST VK_LSHIFT = &HA0 'Left SHIFT key
CONST VK_RSHIFT = &HA1 'Right SHIFT key
CONST VK_LCONTROL = &HA2 'Left CONTROL key
CONST VK_RCONTROL = &HA3 'Right CONTROL key
CONST VK_LMENU = &HA4 'Left ALT key
CONST VK_RMENU = &HA5 'Right ALT key
CONST VK_BROWSER_BACK = &HA6 'Browser Back key
CONST VK_BROWSER_FORWARD = &HA7 'Browser Forward key
CONST VK_BROWSER_REFRESH = &HA8 'Browser Refresh key
CONST VK_BROWSER_STOP = &HA9 'Browser Stop key
CONST VK_BROWSER_SEARCH = &HAA 'Browser Search key
CONST VK_BROWSER_FAVORITES = &HAB 'Browser Favorites key
CONST VK_BROWSER_HOME = &HAC 'Browser Start and Home key
CONST VK_VOLUME_MUTE = &HAD 'Volume Mute key
CONST VK_VOLUME_DOWN = &HAE 'Volume Down key
CONST VK_VOLUME_UP = &HAF 'Volume Up key
CONST VK_MEDIA_NEXT_TRACK = &HB0 'Next Track key
CONST VK_MEDIA_PREV_TRACK = &HB1 'Previous Track key
CONST VK_MEDIA_STOP = &HB2 'Stop Media key
CONST VK_MEDIA_PLAY_PAUSE = &HB3 'Play/Pause Media key
CONST VK_LAUNCH_MAIL = &HB4 'Start Mail key
CONST VK_LAUNCH_MEDIA_SELECT = &HB5 'Select Media key
CONST VK_LAUNCH_APP1 = &HB6 'Start Application 1 key
CONST VK_LAUNCH_APP2 = &HB7 'Start Application 2 key
CONST VK_OEM_1 = &HBA 'Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the ';:' key
CONST VK_OEM_PLUS = &HBB 'For any country/region, the '+' key
CONST VK_OEM_COMMA = &HBC 'For any country/region, the ',' key
CONST VK_OEM_MINUS = &HBD 'For any country/region, the '-' key
CONST VK_OEM_PERIOD = &HBE 'For any country/region, the '.' key
CONST VK_OEM_2 = &HBF 'Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the '/?' key
CONST VK_OEM_3 = &HC0 'Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the '`~' key
CONST VK_OEM_4 = &HDB 'Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the '[{' key
CONST VK_OEM_5 = &HDC 'Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the '\|' key
CONST VK_OEM_6 = &HDD 'Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the ']}' key
CONST VK_OEM_7 = &HDE 'Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the 'single-quote/double-quote' key
CONST VK_OEM_8 = &HDF 'Used for miscellaneous characters; it can vary by keyboard.
CONST VK_OEM_102 = &HE2 'The <> keys on the US standard keyboard, or the \\| key on the non-US 102-key keyboard
CONST VK_PROCESSKEY = &HE5 'IME PROCESS key
CONST VK_PACKET = &HE7 'Used to pass Unicode characters as if they were keystrokes. The VK_PACKET key is the low word of a 32-bit Virtual Key value used for non-keyboard input methods. For more information, see Remark in KEYBDINPUT, SendInput, WM_KEYDOWN, and WM_KEYUP
CONST VK_ATTN = &HF6 'Attn key
CONST VK_CRSEL = &HF7 'CrSel key
CONST VK_EXSEL = &HF8 'ExSel key
CONST VK_EREOF = &HF9 'Erase EOF key
CONST VK_PLAY = &HFA 'Play key
CONST VK_ZOOM = &HFB 'Zoom key
CONST VK_NONAME = &HFC 'Reserved
CONST VK_PA1 = &HFD 'PA1 key
CONST VK_OEM_CLEAR = &HFE 'Clear key

REM Keyboard numbers and letters reference.
REM &H30 '0 key
REM &H31 '1 key
REM &H32 '2 key
REM &H33 '3 key
REM &H34 '4 key
REM &H35 '5 key
REM &H36 '6 key
REM &H37 '7 key
REM &H38 '8 key
REM &H39 '9 key
REM &H41 'A key
REM &H42 'B key
REM &H43 'C key
REM &H44 'D key
REM &H45 'E key
REM &H46 'F key
REM &H47 'G key
REM &H48 'H key
REM &H49 'I key
REM &H4A 'J key
REM &H4B 'K key
REM &H4C 'L key
REM &H4D 'M key
REM &H4E 'N key
REM &H4F 'O key
REM &H50 'P key
REM &H51 'Q key
REM &H52 'R key
REM &H53 'S key
REM &H54 'T key
REM &H55 'U key
REM &H56 'V key
REM &H57 'W key
REM &H58 'X key
REM &H59 'Y key
REM &H5A 'Z key

' Use Code (Block $IF/THEN REM statement hack.)
$IF  THEN
        SENDKEYS Constant, 0, 0, 0 'stant Value Description
        SENDKEYS Constant, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_LBUTTON, 0, 0, 0 'Left mouse button
        SENDKEYS VK_LBUTTON, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_RBUTTON, 0, 0, 0 'Right mouse button
        SENDKEYS VK_RBUTTON, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_CANCEL, 0, 0, 0 'Control-break processing
        SENDKEYS VK_CANCEL, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_MBUTTON, 0, 0, 0 'Middle mouse button (three-button mouse)
        SENDKEYS VK_MBUTTON, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_XBUTTON1, 0, 0, 0 'X1 mouse button
        SENDKEYS VK_XBUTTON1, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_XBUTTON2, 0, 0, 0 'X2 mouse button
        SENDKEYS VK_XBUTTON2, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_BACK, 0, 0, 0 'BACKSPACE key
        SENDKEYS VK_BACK, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_TAB, 0, 0, 0 'TAB key
        SENDKEYS VK_TAB, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_CLEAR, 0, 0, 0 'CLEAR key
        SENDKEYS VK_CLEAR, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_RETURN, 0, 0, 0 'ENTER key
        SENDKEYS VK_RETURN, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_SHIFT, 0, 0, 0 'SHIFT key
        SENDKEYS VK_SHIFT, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_CONTROL, 0, 0, 0 'CTRL key
        SENDKEYS VK_CONTROL, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_MENU, 0, 0, 0 'ALT key
        SENDKEYS VK_MENU, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_PAUSE, 0, 0, 0 'PAUSE key
        SENDKEYS VK_PAUSE, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_CAPITAL, 0, 0, 0 'CAPS LOCK key
        SENDKEYS VK_CAPITAL, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_KANA, 0, 0, 0 'IME Kana mode
        SENDKEYS VK_KANA, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_HANGUEL, 0, 0, 0 'IME Hanguel mode (maintained for compatibility; use VK_HANGUL)
        SENDKEYS VK_HANGUEL, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_HANGUL, 0, 0, 0 'IME Hangul mode
        SENDKEYS VK_HANGUL, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_IME_ON, 0, 0, 0 'IME On
        SENDKEYS VK_IME_ON, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_JUNJA, 0, 0, 0 'IME Junja mode
        SENDKEYS VK_JUNJA, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_FINAL, 0, 0, 0 'IME final mode
        SENDKEYS VK_FINAL, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_HANJA, 0, 0, 0 'IME Hanja mode
        SENDKEYS VK_HANJA, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_KANJI, 0, 0, 0 'IME Kanji mode
        SENDKEYS VK_KANJI, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_IME_OFF, 0, 0, 0 'IME Off
        SENDKEYS VK_IME_OFF, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_ESCAPE, 0, 0, 0 'ESC key
        SENDKEYS VK_ESCAPE, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_CONVERT, 0, 0, 0 'IME convert
        SENDKEYS VK_CONVERT, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_NONCONVERT, 0, 0, 0 'IME nonconvert
        SENDKEYS VK_NONCONVERT, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_ACCEPT, 0, 0, 0 'IME accept
        SENDKEYS VK_ACCEPT, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_MODECHANGE, 0, 0, 0 'IME mode change request
        SENDKEYS VK_MODECHANGE, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_SPACE, 0, 0, 0 'SPACEBAR
        SENDKEYS VK_SPACE, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_PRIOR, 0, 0, 0 'PAGE UP key
        SENDKEYS VK_PRIOR, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_NEXT, 0, 0, 0 'PAGE DOWN key
        SENDKEYS VK_NEXT, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_END, 0, 0, 0 'END key
        SENDKEYS VK_END, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_HOME, 0, 0, 0 'HOME key
        SENDKEYS VK_HOME, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_LEFT, 0, 0, 0 'LEFT ARROW key
        SENDKEYS VK_LEFT, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_UP, 0, 0, 0 'UP ARROW key
        SENDKEYS VK_UP, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_RIGHT, 0, 0, 0 'RIGHT ARROW key
        SENDKEYS VK_RIGHT, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_DOWN, 0, 0, 0 'DOWN ARROW key
        SENDKEYS VK_DOWN, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_SELECT, 0, 0, 0 'SELECT key
        SENDKEYS VK_SELECT, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_PRINT, 0, 0, 0 'PRINT key
        SENDKEYS VK_PRINT, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_EXECUTE, 0, 0, 0 'EXECUTE key
        SENDKEYS VK_EXECUTE, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_SNAPSHOT, 0, 0, 0 'PRINT SCREEN key
        SENDKEYS VK_SNAPSHOT, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_INSERT, 0, 0, 0 'INS key
        SENDKEYS VK_INSERT, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_DELETE, 0, 0, 0 'DEL key
        SENDKEYS VK_DELETE, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_HELP, 0, 0, 0 'HELP key
        SENDKEYS VK_HELP, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_LWIN, 0, 0, 0 'Left Windows key (Natural keyboard)
        SENDKEYS VK_LWIN, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_RWIN, 0, 0, 0 'Right Windows key (Natural keyboard)
        SENDKEYS VK_RWIN, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_APPS, 0, 0, 0 'Applications key (Natural keyboard)
        SENDKEYS VK_APPS, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_SLEEP, 0, 0, 0 'Computer Sleep key
        SENDKEYS VK_SLEEP, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_NUMPAD0, 0, 0, 0 'Numeric keypad 0 key
        SENDKEYS VK_NUMPAD0, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_NUMPAD1, 0, 0, 0 'Numeric keypad 1 key
        SENDKEYS VK_NUMPAD1, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_NUMPAD2, 0, 0, 0 'Numeric keypad 2 key
        SENDKEYS VK_NUMPAD2, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_NUMPAD3, 0, 0, 0 'Numeric keypad 3 key
        SENDKEYS VK_NUMPAD3, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_NUMPAD4, 0, 0, 0 'Numeric keypad 4 key
        SENDKEYS VK_NUMPAD4, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_NUMPAD5, 0, 0, 0 'Numeric keypad 5 key
        SENDKEYS VK_NUMPAD5, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_NUMPAD6, 0, 0, 0 'Numeric keypad 6 key
        SENDKEYS VK_NUMPAD6, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_NUMPAD7, 0, 0, 0 'Numeric keypad 7 key
        SENDKEYS VK_NUMPAD7, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_NUMPAD8, 0, 0, 0 'Numeric keypad 8 key
        SENDKEYS VK_NUMPAD8, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_NUMPAD9, 0, 0, 0 'Numeric keypad 9 key
        SENDKEYS VK_NUMPAD9, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_MULTIPLY, 0, 0, 0 'Multiply key
        SENDKEYS VK_MULTIPLY, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_ADD, 0, 0, 0 'Add key
        SENDKEYS VK_ADD, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_SEPARATOR, 0, 0, 0 'Separator key
        SENDKEYS VK_SEPARATOR, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_SUBTRACT, 0, 0, 0 'Subtract key
        SENDKEYS VK_SUBTRACT, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_DECIMAL, 0, 0, 0 'Decimal key
        SENDKEYS VK_DECIMAL, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_DIVIDE, 0, 0, 0 'Divide key
        SENDKEYS VK_DIVIDE, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_F1, 0, 0, 0 'F1 key
        SENDKEYS VK_F1, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_F2, 0, 0, 0 'F2 key
        SENDKEYS VK_F2, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_F3, 0, 0, 0 'F3 key
        SENDKEYS VK_F3, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_F4, 0, 0, 0 'F4 key
        SENDKEYS VK_F4, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_F5, 0, 0, 0 'F5 key
        SENDKEYS VK_F5, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_F6, 0, 0, 0 'F6 key
        SENDKEYS VK_F6, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_F7, 0, 0, 0 'F7 key
        SENDKEYS VK_F7, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_F8, 0, 0, 0 'F8 key
        SENDKEYS VK_F8, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_F9, 0, 0, 0 'F9 key
        SENDKEYS VK_F9, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_F10, 0, 0, 0 'F10 key
        SENDKEYS VK_F10, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_F11, 0, 0, 0 'F11 key
        SENDKEYS VK_F11, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_F12, 0, 0, 0 'F12 key
        SENDKEYS VK_F12, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_F13, 0, 0, 0 'F13 key
        SENDKEYS VK_F13, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_F14, 0, 0, 0 'F14 key
        SENDKEYS VK_F14, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_F15, 0, 0, 0 'F15 key
        SENDKEYS VK_F15, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_F16, 0, 0, 0 'F16 key
        SENDKEYS VK_F16, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_F17, 0, 0, 0 'F17 key
        SENDKEYS VK_F17, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_F18, 0, 0, 0 'F18 key
        SENDKEYS VK_F18, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_F19, 0, 0, 0 'F19 key
        SENDKEYS VK_F19, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_F20, 0, 0, 0 'F20 key
        SENDKEYS VK_F20, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_F21, 0, 0, 0 'F21 key
        SENDKEYS VK_F21, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_F22, 0, 0, 0 'F22 key
        SENDKEYS VK_F22, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_F23, 0, 0, 0 'F23 key
        SENDKEYS VK_F23, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_F24, 0, 0, 0 'F24 key
        SENDKEYS VK_F24, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_NUMLOCK, 0, 0, 0 'NUM LOCK key
        SENDKEYS VK_NUMLOCK, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_SCROLL, 0, 0, 0 'SCROLL LOCK key
        SENDKEYS VK_SCROLL, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_LSHIFT, 0, 0, 0 'Left SHIFT key
        SENDKEYS VK_LSHIFT, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_RSHIFT, 0, 0, 0 'Right SHIFT key
        SENDKEYS VK_RSHIFT, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_LCONTROL, 0, 0, 0 'Left CONTROL key
        SENDKEYS VK_LCONTROL, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_RCONTROL, 0, 0, 0 'Right CONTROL key
        SENDKEYS VK_RCONTROL, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_LMENU, 0, 0, 0 'Left ALT key
        SENDKEYS VK_LMENU, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_RMENU, 0, 0, 0 'Right ALT key
        SENDKEYS VK_RMENU, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_BROWSER_BACK, 0, 0, 0 'Browser Back key
        SENDKEYS VK_BROWSER_BACK, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_BROWSER_FORWARD, 0, 0, 0 'Browser Forward key
        SENDKEYS VK_BROWSER_FORWARD, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_BROWSER_REFRESH, 0, 0, 0 'Browser Refresh key
        SENDKEYS VK_BROWSER_REFRESH, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_BROWSER_STOP, 0, 0, 0 'Browser Stop key
        SENDKEYS VK_BROWSER_STOP, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_BROWSER_SEARCH, 0, 0, 0 'Browser Search key
        SENDKEYS VK_BROWSER_SEARCH, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_BROWSER_FAVORITES, 0, 0, 0 'Browser Favorites key
        SENDKEYS VK_BROWSER_FAVORITES, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_BROWSER_HOME, 0, 0, 0 'Browser Start and Home key
        SENDKEYS VK_BROWSER_HOME, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_VOLUME_MUTE, 0, 0, 0 'Volume Mute key
        SENDKEYS VK_VOLUME_MUTE, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_VOLUME_DOWN, 0, 0, 0 'Volume Down key
        SENDKEYS VK_VOLUME_DOWN, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_VOLUME_UP, 0, 0, 0 'Volume Up key
        SENDKEYS VK_VOLUME_UP, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_MEDIA_NEXT_TRACK, 0, 0, 0 'Next Track key
        SENDKEYS VK_MEDIA_NEXT_TRACK, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_MEDIA_PREV_TRACK, 0, 0, 0 'Previous Track key
        SENDKEYS VK_MEDIA_PREV_TRACK, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_MEDIA_STOP, 0, 0, 0 'Stop Media key
        SENDKEYS VK_MEDIA_STOP, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_MEDIA_PLAY_PAUSE, 0, 0, 0 'Play/Pause Media key
        SENDKEYS VK_MEDIA_PLAY_PAUSE, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_LAUNCH_MAIL, 0, 0, 0 'Start Mail key
        SENDKEYS VK_LAUNCH_MAIL, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_LAUNCH_MEDIA_SELECT, 0, 0, 0 'Select Media key
        SENDKEYS VK_LAUNCH_MEDIA_SELECT, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_LAUNCH_APP1, 0, 0, 0 'Start Application 1 key
        SENDKEYS VK_LAUNCH_APP1, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_LAUNCH_APP2, 0, 0, 0 'Start Application 2 key
        SENDKEYS VK_LAUNCH_APP2, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_OEM_1, 0, 0, 0 'Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the ';:' key
        SENDKEYS VK_OEM_1, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_OEM_PLUS, 0, 0, 0 'For any country/region, the '+' key
        SENDKEYS VK_OEM_PLUS, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_OEM_COMMA, 0, 0, 0 'For any country/region, the ',' key
        SENDKEYS VK_OEM_COMMA, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_OEM_MINUS, 0, 0, 0 'For any country/region, the '-' key
        SENDKEYS VK_OEM_MINUS, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_OEM_PERIOD, 0, 0, 0 'For any country/region, the '.' key
        SENDKEYS VK_OEM_PERIOD, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_OEM_2, 0, 0, 0 'Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the '/?' key
        SENDKEYS VK_OEM_2, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_OEM_3, 0, 0, 0 'Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the '`~' key
        SENDKEYS VK_OEM_3, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_OEM_4, 0, 0, 0 'Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the '[{' key
        SENDKEYS VK_OEM_4, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_OEM_5, 0, 0, 0 'Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the '\|' key
        SENDKEYS VK_OEM_5, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_OEM_6, 0, 0, 0 'Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the ']}' key
        SENDKEYS VK_OEM_6, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_OEM_7, 0, 0, 0 'Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the 'single-quote/double-quote' key
        SENDKEYS VK_OEM_7, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_OEM_8, 0, 0, 0 'Used for miscellaneous characters; it can vary by keyboard.
        SENDKEYS VK_OEM_8, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_OEM_102, 0, 0, 0 'The <> keys on the US standard keyboard, or the \\| key on the non-US 102-key keyboard
        SENDKEYS VK_OEM_102, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_PROCESSKEY, 0, 0, 0 'IME PROCESS key
        SENDKEYS VK_PROCESSKEY, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_PACKET, 0, 0, 0 'Used to pass Unicode characters as if they were keystrokes. The VK_PACKET key is the low word of a 32-bit Virtual Key value used for non-keyboard input methods. For more information, see Remark in KEYBDINPUT, SendInput, WM_KEYDOWN, and WM_KEYUP
        SENDKEYS VK_PACKET, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_ATTN, 0, 0, 0 'Attn key
        SENDKEYS VK_ATTN, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_CRSEL, 0, 0, 0 'CrSel key
        SENDKEYS VK_CRSEL, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_EXSEL, 0, 0, 0 'ExSel key
        SENDKEYS VK_EXSEL, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_EREOF, 0, 0, 0 'Erase EOF key
        SENDKEYS VK_EREOF, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_PLAY, 0, 0, 0 'Play key
        SENDKEYS VK_PLAY, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_ZOOM, 0, 0, 0 'Zoom key
        SENDKEYS VK_ZOOM, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_NONAME, 0, 0, 0 'Reserved
        SENDKEYS VK_NONAME, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_PA1, 0, 0, 0 'PA1 key
        SENDKEYS VK_PA1, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS VK_OEM_CLEAR, 0, 0, 0 'Clear key
        SENDKEYS VK_OEM_CLEAR, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS &H30, 0, 0, 0 '0 key
        SENDKEYS &H30, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS &H31, 0, 0, 0 '1 key
        SENDKEYS &H31, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS &H32, 0, 0, 0 '2 key
        SENDKEYS &H32, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS &H33, 0, 0, 0 '3 key
        SENDKEYS &H33, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS &H34, 0, 0, 0 '4 key
        SENDKEYS &H34, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS &H35, 0, 0, 0 '5 key
        SENDKEYS &H35, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS &H36, 0, 0, 0 '6 key
        SENDKEYS &H36, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS &H37, 0, 0, 0 '7 key
        SENDKEYS &H37, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS &H38, 0, 0, 0 '8 key
        SENDKEYS &H38, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS &H39, 0, 0, 0 '9 key
        SENDKEYS &H39, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS &H41, 0, 0, 0 'A key
        SENDKEYS &H41, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS &H42, 0, 0, 0 'B key
        SENDKEYS &H42, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS &H43, 0, 0, 0 'C key
        SENDKEYS &H43, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS &H44, 0, 0, 0 'D key
        SENDKEYS &H44, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS &H45, 0, 0, 0 'E key
        SENDKEYS &H45, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS &H46, 0, 0, 0 'F key
        SENDKEYS &H46, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS &H47, 0, 0, 0 'G key
        SENDKEYS &H47, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS &H48, 0, 0, 0 'H key
        SENDKEYS &H48, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS &H49, 0, 0, 0 'I key
        SENDKEYS &H49, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS &H4A, 0, 0, 0 'J key
        SENDKEYS &H4A, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS &H4B, 0, 0, 0 'K key
        SENDKEYS &H4B, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS &H4C, 0, 0, 0 'L key
        SENDKEYS &H4C, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS &H4D, 0, 0, 0 'M key
        SENDKEYS &H4D, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS &H4E, 0, 0, 0 'N key
        SENDKEYS &H4E, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS &H4F, 0, 0, 0 'O key
        SENDKEYS &H4F, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS &H50, 0, 0, 0 'P key
        SENDKEYS &H50, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS &H51, 0, 0, 0 'Q key
        SENDKEYS &H51, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS &H52, 0, 0, 0 'R key
        SENDKEYS &H52, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS &H53, 0, 0, 0 'S key
        SENDKEYS &H53, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS &H54, 0, 0, 0 'T key
        SENDKEYS &H54, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS &H55, 0, 0, 0 'U key
        SENDKEYS &H55, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS &H56, 0, 0, 0 'V key
        SENDKEYS &H56, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS &H57, 0, 0, 0 'W key
        SENDKEYS &H57, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS &H58, 0, 0, 0 'X key
        SENDKEYS &H58, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS &H59, 0, 0, 0 'Y key
        SENDKEYS &H59, 0, KEYEVENTF_KEYUP, 0

        SENDKEYS &H5A, 0, 0, 0 'Z key
        SENDKEYS &H5A, 0, KEYEVENTF_KEYUP, 0
$END IF

Kidding aside, I hope to make availble snippets like this, eventually, in my Sam-Clip project at:

Sam-Clip: https://staging.qb64phoenix.com/showthread.php?tid=1042

Special thanks to Dav for the DECLARE LIBRARY header:

Pete (API Princess)
[Image: b6b7782ed5fa6b3493e346c22db729e4.jpg]
Reply
#2
Ah Keys to the Kingdom!
b = b + ...
Reply
#3
Yep, good for now, until King Spriggsy one ups me, or Queen Steve holds a coronation and there's a new princess in town! Well scratch that. Sam don't share ah tiara with nobody!
Reply
#4
These are all the same keys as mapped and used by my keyboard library. They're also documented in it, in case you're missing any of the key codes/values. @Pete

Code: (Select All)
default_keyboard_data:
    '   Index   Unmodified      Ctrl      Shift       Alt         AltGr     Repeat
    DATA 1,900001,0,0,0,0,0.2: 'Left Mouse Button
    DATA 2,900002,0,0,0,0,0.2: 'Right Mouse Button
    DATA 3,900003,0,0,0,0,0.2: 'VK_Cancel
    DATA 4,900004,0,0,0,0,0.2: 'Middle Mouse Button
    DATA 5,900005,0,0,0,0,0.2: 'Mouse Button 4
    DATA 6,900006,0,0,0,0,0.2: 'Mouse Button 5
    DATA 7,900007,0,0,0,0,0.2: 'Undefined
    DATA 8,8,0,0,0,0,0.2: 'Backspace
    DATA 9,9,0,0,0,0,0.2: 'Tab
    DATA 10,900010,0,0,0,0,0.2: 'Reserved
    DATA 11,900011,0,0,0,0,0.2: 'Reserved
    DATA 12,19456,0,0,0,0,0.2: 'Clear
    DATA 13,13,0,0,0,0,0.2: 'Enter
    DATA 14,900014,0,0,0,0,0.2: 'Undefined
    DATA 15,900015,0,0,0,0,0.2: 'Undefined
    DATA 16,100016,0,0,0,0,-1: 'Shift (Notice I set it to simple toddle and report UP/DOWN results for us)
    DATA 17,100017,0,0,0,0,-1: 'Ctrl   (Same)
    DATA 18,100018,0,0,0,0,-1: 'Alt     (Same)
    DATA 19,100019,0,0,0,0,0.2: 'Pause
    DATA 20,100301,0,0,0,0,-1: 'Caps Lock
    DATA 21,900021,0,0,0,0,0.2: 'VK_Hangul
    DATA 22,900022,0,0,0,0,0.2: 'Undefined
    DATA 23,900023,0,0,0,0,0.2: 'VK_Junja
    DATA 24,900024,0,0,0,0,0.2: 'VK_Final
    DATA 25,900025,0,0,0,0,0.2: 'VK_Hanga//VK_Kanji
    '   Index   Unmodified      Ctrl      Shift       Alt         AltGr     Repeat
    DATA 26,900026,0,0,0,0,0.2: 'Undefined
    DATA 27,27,0,0,0,0,0.2: 'ESC
    DATA 28,900028,0,0,0,0,0.2: 'VK_Convert
    DATA 29,900029,0,0,0,0,0.2: 'VK_NonConvert
    DATA 30,900030,0,0,0,0,0.2: 'VK_Accept
    DATA 31,900031,0,0,0,0,0.2: 'VK_ModeChange
    DATA 32,32,0,0,0,0,0.2: 'VK_Space
    DATA 33,18688,0,0,0,0,0.2: 'Page Up
    DATA 34,20736,0,0,0,0,0.2: 'Page Down
    DATA 35,20224,0,0,0,0,0.2: 'End
    DATA 36,18176,0,0,0,0,0.2: 'Home
    DATA 37,19200,0,0,0,0,0.2: 'Left Arrow
    DATA 38,18432,0,0,0,0,0.2: 'Up Arrow
    DATA 39,19712,0,0,0,0,0.2: 'Right Arrow
    DATA 40,20480,0,0,0,0,0.2: 'Down Arrow
    DATA 41,900041,0,0,0,0,-1: 'VK_SELECT
    DATA 42,900042,0,0,0,0,-1: 'CK_PRINT
    DATA 43,900043,0,0,0,0,-1: 'VK_EXECUTE
    DATA 44,900044,0,0,0,0,-1: 'VK_SNAPSHOT
    DATA 45,20992,0,0,0,0,0.2: 'INS
    DATA 46,21248,0,0,0,0,0.2: 'DEL
    DATA 47,900047,0,0,0,0,0.2: 'VK_HELP
    DATA 48,48,0,41,0,0,0.2: '0
    DATA 49,49,0,33,0,0,0.2: '1
    DATA 50,50,0,64,0,0,0.2: '2
    '   Index   Unmodified      Ctrl      Shift       Alt         AltGr     Repeat
    DATA 51,51,0,35,0,0,0.2: '3
    DATA 52,52,0,36,0,0,0.2: '4
    DATA 53,53,0,37,0,0,0.2: '5
    DATA 54,54,0,94,0,0,0.2: '6
    DATA 55,55,0,38,0,0,0.2: '7
    DATA 56,56,0,42,0,0,0.2: '8
    DATA 57,57,0,40,0,0,0.2: '9
    DATA 58,900058,0,0,0,0,0.2: 'Undefined
    DATA 59,900059,0,0,0,0,0.2: 'Undefined
    DATA 60,900060,0,0,0,0,0.2: 'Undefined
    DATA 61,900061,0,0,0,0,0.2: 'Undefined
    DATA 62,900062,0,0,0,0,0.2: 'Undefined
    DATA 63,900063,0,0,0,0,0.2: 'Undefined
    DATA 64,900064,0,0,0,0,0.2: 'Undefined
    DATA 65,65,0,97,0,0,0.2: 'a
    DATA 66,66,0,98,0,0,0.2: 'b
    DATA 67,67,0,99,0,0,0.2: 'c
    DATA 68,68,0,100,0,0,0.2: 'd
    DATA 69,69,0,101,0,0,0.2: 'e
    DATA 70,70,0,102,0,0,0.2: 'f
    DATA 71,71,0,103,0,0,0.2: 'g
    DATA 72,72,0,104,0,0,0.2: 'h
    DATA 73,73,0,105,0,0,0.2: 'i
    DATA 74,74,0,106,0,0,0.2: 'j
    DATA 75,75,0,107,0,0,0.2: 'k
    '   Index   Unmodified      Ctrl      Shift       Alt         AltGr     Repeat
    DATA 76,76,0,108,0,0,0.2: 'l
    DATA 77,77,0,109,0,0,0.2: 'm
    DATA 78,78,0,110,0,0,0.2: 'n
    DATA 79,79,0,111,0,0,0.2: 'o
    DATA 80,80,0,112,0,0,0.2: 'p
    DATA 81,81,0,113,0,0,0.2: 'q
    DATA 82,82,0,114,0,0,0.2: 'r
    DATA 83,83,0,115,0,0,0.2: 's
    DATA 84,84,0,116,0,0,0.2: 't
    DATA 85,85,0,117,0,0,0.2: 'u
    DATA 86,86,0,118,0,0,0.2: 'v
    DATA 87,87,0,119,0,0,0.2: 'w
    DATA 88,88,0,120,0,0,0.2: 'x
    DATA 89,89,0,121,0,0,0.2: 'y
    DATA 90,90,0,122,0,0,0.2: 'z
    DATA 91,100311,0,0,0,0,-1: 'Left WIN
    DATA 92,100312,0,0,0,0,-1: 'Right WIN
    DATA 93,100319,0,0,0,0,-1: 'Applications (Menu)
    DATA 94,900094,0,0,0,0,0.2: 'Reserved
    DATA 95,900095,0,0,0,0,0.2: 'VK_SLEEP
    DATA 96,48,0,0,0,0,0.2: 'Numpad 0
    DATA 97,49,0,0,0,0,0.2: 'Numpad 1
    DATA 98,50,0,0,0,0,0.2: 'Numpad 2
    DATA 99,51,0,0,0,0,0.2: 'Numpad 3
    DATA 100,52,0,0,0,0,0.2: 'Numpad 4
    '   Index   Unmodified      Ctrl      Shift       Alt         AltGr     Repeat
    DATA 101,53,0,0,0,0,0.2: 'Numpad 5
    DATA 102,54,0,0,0,0,0.2: 'Numpad 6
    DATA 103,55,0,0,0,0,0.2: 'Numpad 7
    DATA 104,56,0,0,0,0,0.2: 'Numpad 8
    DATA 105,57,0,0,0,0,0.2: 'Numpad 9
    DATA 106,42,0,0,0,0,0.2: 'Numpad *
    DATA 107,43,0,0,0,0,0.2: 'Numpad +
    DATA 108,900108,0,0,0,0,0.2: 'VK_SEPARATOR
    DATA 109,51,0,0,0,0,0.2: 'Numpad -
    DATA 110,52,0,0,0,0,0.2: 'Numpad .
    DATA 111,53,0,0,0,0,0.2: 'Numpad /
    DATA 112,15104,0,0,0,0,0.2: 'F1
    DATA 113,15360,0,0,0,0,0.2: 'F2
    DATA 114,15616,0,0,0,0,0.2: 'F3
    DATA 115,15872,0,0,0,0,0.2: 'F4
    DATA 116,16128,0,0,0,0,0.2: 'F5            /
    DATA 117,16384,0,0,0,0,0.2: 'F6
    DATA 118,16640,0,0,0,0,0.2: 'F7
    DATA 119,16896,0,0,0,0,0.2: 'F8
    DATA 120,17152,0,0,0,0,0.2: 'F9
    DATA 121,17408,0,0,0,0,0.2: 'F10
    DATA 122,34048,0,0,0,0,0.2: 'F11
    DATA 123,34304,0,0,0,0,0.2: 'F12
    DATA 124,900124,0,0,0,0,0.2: 'F13
    DATA 125,900125,0,0,0,0,0.2: 'F14
    '   Index   Unmodified      Ctrl      Shift       Alt         AltGr     Repeat
    DATA 126,900126,0,0,0,0,0.2: 'F15
    DATA 127,900127,0,0,0,0,0.2: 'F16
    DATA 128,900128,0,0,0,0,0.2: 'F17
    DATA 129,900129,0,0,0,0,0.2: 'F18
    DATA 130,900130,0,0,0,0,0.2: 'F19
    DATA 131,900131,0,0,0,0,0.2: 'F20
    DATA 132,900132,0,0,0,0,0.2: 'F21
    DATA 133,900133,0,0,0,0,0.2: 'F22
    DATA 134,900134,0,0,0,0,0.2: 'F23
    DATA 135,900135,0,0,0,0,0.2: 'F24
    DATA 136,900136,0,0,0,0,0.2: 'Unassigned
    DATA 137,900137,0,0,0,0,0.2: 'Unassigned
    DATA 138,900138,0,0,0,0,0.2: 'Unassigned
    DATA 139,900139,0,0,0,0,0.2: 'Unassigned
    DATA 140,900140,0,0,0,0,0.2: 'Unassigned
    DATA 141,900141,0,0,0,0,0.2: 'Unassigned
    DATA 142,900142,0,0,0,0,0.2: 'Unassigned
    DATA 143,900143,0,0,0,0,0.2: 'Unassigned
    DATA 144,100300,0,0,0,0,-1: 'NUM LOCK
    DATA 145,100302,0,0,0,0,-1: 'SCROLL LOCK
    DATA 146,900146,0,0,0,0,0.2: 'OEM SPECIFIC
    DATA 147,900147,0,0,0,0,0.2: 'OEM SPECIFIC
    DATA 148,900148,0,0,0,0,0.2: 'OEM SPECIFIC
    DATA 149,900149,0,0,0,0,0.2: 'OEM SPECIFIC
    DATA 150,900150,0,0,0,0,0.2: 'OEM SPECIFIC
    '   Index   Unmodified      Ctrl      Shift       Alt         AltGr     Repeat
    DATA 151,900151,0,0,0,0,0.2: 'Unassigned
    DATA 152,900152,0,0,0,0,0.2: 'Unassigned
    DATA 153,900153,0,0,0,0,0.2: 'Unassigned
    DATA 154,900154,0,0,0,0,0.2: 'Unassigned
    DATA 155,900155,0,0,0,0,0.2: 'Unassigned
    DATA 156,900156,0,0,0,0,0.2: 'Unassigned
    DATA 157,900157,0,0,0,0,0.2: 'Unassigned
    DATA 158,900158,0,0,0,0,0.2: 'Unassigned
    DATA 159,900159,0,0,0,0,0.2: 'Unassigned
    DATA 160,100304,0,0,0,0,-1: 'Left Shift
    DATA 161,100303,0,0,0,0,-1: 'Right Shift
    DATA 162,100306,0,0,0,0,-1: 'Left Control
    DATA 163,100305,0,0,0,0,-1: 'Right Control
    DATA 164,100308,0,0,0,0,-1: 'Left Alt
    DATA 165,100309,0,0,0,0,-1: 'Right Alt
    DATA 166,900166,0,0,0,0,0.2: 'Browser back
    DATA 167,900167,0,0,0,0,0.2: 'Browser forward
    DATA 168,900168,0,0,0,0,0.2: 'Browser refresh
    DATA 169,900169,0,0,0,0,0.2: 'Browser stop
    DATA 170,900170,0,0,0,0,0.2: 'Browser search
    DATA 171,900171,0,0,0,0,0.2: 'Browser favorites
    DATA 172,900172,0,0,0,0,0.2: 'Browser home
    DATA 173,900173,0,0,0,0,0.2: 'Mute
    DATA 174,900174,0,0,0,0,0.2: 'Vol Down
    DATA 175,900175,0,0,0,0,0.2: 'Vol Up
    '   Index   Unmodified      Ctrl      Shift       Alt         AltGr     Repeat
    DATA 176,900176,0,0,0,0,0.2: 'Media Next
    DATA 177,900177,0,0,0,0,0.2: 'Media prev
    DATA 178,900178,0,0,0,0,0.2: 'Media stop
    DATA 179,900179,0,0,0,0,0.2: 'Media Play/Pause
    DATA 180,900180,0,0,0,0,0.2: 'Launch mail
    DATA 181,900181,0,0,0,0,0.2: 'Launch media select
    DATA 182,900182,0,0,0,0,0.2: 'Launch app1
    DATA 183,900183,0,0,0,0,0.2: 'Launch app2
    DATA 184,900184,0,0,0,0,0.2: 'Reserved
    DATA 185,900185,0,0,0,0,0.2: 'Reserved
    DATA 186,59,0,58,0,0,0.2: ';:
    DATA 187,61,0,43,0,0,0.2: '=+
    DATA 188,44,0,60,0,0,0.2: ',<
    DATA 189,45,0,95,0,0,0.2: '-_
    DATA 190,46,0,62,0,0,0.2: '.>
    DATA 191,47,0,63,0,0,0.2: '/?
    DATA 192,96,0,126,0,0,0.2: '`~
    DATA 193,900193,0,0,0,0,0.2: 'Reserved
    DATA 194,900194,0,0,0,0,0.2: 'Reserved
    DATA 195,900195,0,0,0,0,0.2: 'Reserved
    DATA 196,900196,0,0,0,0,0.2: 'Reserved
    DATA 197,900197,0,0,0,0,0.2: 'Reserved
    DATA 198,900198,0,0,0,0,0.2: 'Reserved
    DATA 199,900199,0,0,0,0,0.2: 'Reserved
    DATA 200,900200,0,0,0,0,0.2: 'Reserved
    '   Index   Unmodified      Ctrl      Shift       Alt         AltGr     Repeat
    DATA 201,900201,0,0,0,0,0.2: 'Reserved
    DATA 202,900202,0,0,0,0,0.2: 'Reserved
    DATA 203,900203,0,0,0,0,0.2: 'Reserved
    DATA 204,900204,0,0,0,0,0.2: 'Reserved
    DATA 205,900205,0,0,0,0,0.2: 'Reserved
    DATA 206,900206,0,0,0,0,0.2: 'Reserved
    DATA 207,900207,0,0,0,0,0.2: 'Reserved
    DATA 208,900208,0,0,0,0,0.2: 'Reserved
    DATA 209,900209,0,0,0,0,0.2: 'Reserved
    DATA 210,900210,0,0,0,0,0.2: 'Reserved
    DATA 211,900211,0,0,0,0,0.2: 'Reserved
    DATA 212,900212,0,0,0,0,0.2: 'Reserved
    DATA 213,900213,0,0,0,0,0.2: 'Reserved
    DATA 214,900214,0,0,0,0,0.2: 'Reserved
    DATA 215,900215,0,0,0,0,0.2: 'Reserved
    DATA 216,900216,0,0,0,0,0.2: 'Unassigned
    DATA 217,900217,0,0,0,0,0.2: 'Unassigned
    DATA 218,900218,0,0,0,0,0.2: 'Unassigned
    DATA 219,91,0,123,0,0,0.2: '[{
    DATA 220,92,0,124,0,0,0.2: '\|
    DATA 221,93,0,125,0,0,0.2: ']}
    DATA 222,39,0,34,0,0,0.2: ''"
    DATA 223,900223,0,0,0,0,0.2: 'OEM SPECIFIC
    DATA 224,900224,0,0,0,0,0.2: 'Reserved
    DATA 225,900225,0,0,0,0,0.2: 'OEM SPECIFIC d
    DATA 226,900226,0,0,0,0,0.2: 'Either the Angle Bracket key,or Backslash on RT 102-key keyboard
    DATA 227,900227,0,0,0,0,0.2: 'OEM SPECIFIC
    DATA 228,900228,0,0,0,0,0.2: 'OEM SPECIFIC
    DATA 229,900229,0,0,0,0,0.2: 'IME PROCESS key (whatever that is)
    DATA 230,900230,0,0,0,0,0.2: 'OEM SPECIFIC
    DATA 231,900231,0,0,0,0,0.2: 'Used to pass UNICODE characters (however that works)
    DATA 232,900232,0,0,0,0,0.2: 'Unassigned
    DATA 233,900233,0,0,0,0,0.2: 'OEM SPECIFIC
    DATA 234,900234,0,0,0,0,0.2: 'OEM SPECIFIC
    DATA 235,900235,0,0,0,0,0.2: 'OEM SPECIFIC
    DATA 236,900236,0,0,0,0,0.2: 'OEM SPECIFIC
    DATA 237,900237,0,0,0,0,0.2: 'OEM SPECIFIC
    DATA 238,900238,0,0,0,0,0.2: 'OEM SPECIFIC
    DATA 239,900239,0,0,0,0,0.2: 'OEM SPECIFIC
    DATA 240,900240,0,0,0,0,0.2: 'OEM SPECIFIC
    DATA 241,900241,0,0,0,0,0.2: 'OEM SPECIFIC
    DATA 242,900242,0,0,0,0,0.2: 'OEM SPECIFIC
    DATA 243,900243,0,0,0,0,0.2: 'OEM SPECIFIC
    DATA 244,900244,0,0,0,0,0.2: 'OEM SPECIFIC
    DATA 245,900245,0,0,0,0,0.2: 'OEM SPECIFIC
    DATA 246,900246,0,0,0,0,0.2: 'VK_ATTN
    DATA 247,900247,0,0,0,0,0.2: 'VK_ATTN
    DATA 248,900248,0,0,0,0,0.2: 'VK_ATTN
    DATA 249,900249,0,0,0,0,0.2: 'VK_ATTN
    DATA 250,900250,0,0,0,0,0.2: 'VK_ATTN
    DATA 251,900251,0,0,0,0,0.2: 'VK_ATTN
    DATA 252,900252,0,0,0,0,0.2: 'Reserved
    DATA 253,900253,0,0,0,0,0.2: 'VK_PA1
    DATA 254,900253,0,0,0,0,0.2: 'VK_OEM_CLEAR
    DATA 0,0,0,0,0,0,0.2: 'END OF DATA

The first value is the Windows-code value, the second is the QB64 _KEYHIT value, and the comment at the end helps explain what they all are. Wink
Reply
#5
OR... Use this little code to quickly get the value of your keys:

Code: (Select All)
$If WIN Then
    Declare Library 'function is already used by QB64 so "User32" is not required
        Function GetKeyState% (ByVal vkey As Long)
        Function GetAsyncKeyState% (ByVal vkey As Long)
    End Declare
$End If

_Delay .25
Cls

Do
    For i = 1 To 254
        If GetAsyncKeyState(i) Then Print "Keycode ="; i
    Next
    While _MouseInput: Wend
    _Delay .25
Loop
Reply
#6
I am wondering is that handy little tool in IDE incomplete?
b = b + ...
Reply
#7
(11-10-2022, 08:41 PM)bplus Wrote: I am wondering is that handy little tool in IDE incomplete?

Which handy little tool?  The keycode generator?  It gives you _KEYHIT code values, not windows system values.  Wink
Reply
#8
Ah so Keys to API-ness.
b = b + ...
Reply
#9
My only input right now is that dwFlags and dwExtraInfo should both be unsigned longs. Functionally, nothing changes. It's just a matter of type matching.
Ask me about Windows API and maybe some Linux stuff
Reply
#10
(11-10-2022, 08:56 PM)Spriggsy Wrote: My only input right now is that dwFlags and dwExtraInfo should both be unsigned longs. Functionally, nothing changes. It's just a matter of type matching.

@Spriggsy

I'll go up and make the edit.

I always thought that's a matter of convention. For fun, I've changed many API TYPE variables and the functions almost always continue to work. That includes _OFFSET and unsigned. I blame Dav. Off with his head! Big Grin

Pete
Reply




Users browsing this thread: 5 Guest(s)