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!
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)
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)