(May 21, 2015 05:31 PM)iGuessSo Wrote: You shouldn't need to use anything like NaMeMaN suggests from what I can tell.
(May 21, 2015 12:46 PM)MrRapidz Wrote: I basically need to detect the name of the key pressed, the key's name needs to be the same name that it uses in code though (ex. 1's name in code is D1).
He wants to 'detect' the key pressed and have use of the key's code.
For x = 1 To 255
Chrctr = 0
Chrctr = GetAsyncKeyState(
x)
If Chrctr = -32767 Then
RichTextBox1.Text += Chr(
x) & vbNewLine
End If
Next
x
X is the integer value of the character being detected.
A = 65, B = 66, C = 67, D = 68, etc...
From what he said in his post, I believe what I have given him is more than sufficient to satify the desires of the OP. My first thoughts were he was wanting to make a customizable hotkey based on the detected key, but then after reading through his post I realized he was simply asking to save the key presses so I came up with this.