I have
'**************************************************************************************************************************
Type KeyboardBytes
kbb(0 To 255) As Byte
End Type
Declare Function GetKeyboardState Lib "User32.dll" (kbArray As
KeyboardBytes) As Long
Sub FetchESC()
Dim kbArray As KeyboardBytes
Do
DoEvents
GetKeyboardState kbArray
If kbArray.kbb(27) And 128 Then
ESCpressed
End If
' Terminate Macro with STRG
Loop Until kbArray.kbb(17) And 128
End Sub
Sub ESCpressed()
MsgBox "You have pressed ESC"
End Sub
'**************************************************************************************************************************
I am lookin for a list, from where I can see, which keybuttons of a
keyboard are assigned to the keyboard bytes 0 to 255, esp the arrow
keybuttons.
Any help or internet link?
/*
* VK_L* & VK_R* - left and right Alt, Ctrl and Shift virtual keys.
* Used only as parameters to GetAsyncKeyState() and GetKeyState().
* No other API or message will distinguish left and right keys in this way.
*/
#define VK_LSHIFT 0xA0
#define VK_RSHIFT 0xA1
#define VK_LCONTROL 0xA2
#define VK_RCONTROL 0xA3
#define VK_LMENU 0xA4
#define VK_RMENU 0xA5
#define VK_OEM_1 0xBA // ';:' for US
#define VK_OEM_PLUS 0xBB // '+' any country
#define VK_OEM_COMMA 0xBC // ',' any country
#define VK_OEM_MINUS 0xBD // '-' any country
#define VK_OEM_PERIOD 0xBE // '.' any country
#define VK_OEM_2 0xBF // '/?' for US
#define VK_OEM_3 0xC0 // '`~' for US
/*
* 0xC1 - 0xD7 : reserved
*/
/*
* 0xD8 - 0xDA : unassigned
*/
#define VK_OEM_4 0xDB // '[{' for US
#define VK_OEM_5 0xDC // '\|' for US
#define VK_OEM_6 0xDD // ']}' for US
#define VK_OEM_7 0xDE // ''"' for US
#define VK_OEM_8 0xDF
/*
* 0xE0 : reserved
*/
/*
* Various extended or enhanced keyboards
*/
#define VK_OEM_AX 0xE1 // 'AX' key on Japanese AX kbd
#define VK_OEM_102 0xE2 // "<>" or "\|" on RT 102-key kbd.
#define VK_ICO_HELP 0xE3 // Help key on ICO
#define VK_ICO_00 0xE4 // 00 key on ICO