GetAsyncKeyState for Letters

Posts 1–10 of 10 · Page 1 of 1
GetAsyncKeyState for Letters
Does this mean
Code:
if(GetAsyncKeyState(0x45)&1)
If e is pressed do code?
(0x30)
0 key
(0x31)
1 key
(0x32)
2 key
(0x33)
3 key
(0x34)
4 key
(0x35)
5 key
(0x36)
6 key
(0x37)
7 key
(0x38)
8 key
(0x39)
9 key
- (0x3A-40)
Undefined
(0x41)
A key
(0x42)
B key
(0x43)
C key
(0x44)
D key
(0x45)
E key
(0x46)
F key
(0x47)
G key
(0x48)
H key
(0x49)
I key
(0x4A)
J key
(0x4B)
K key
(0x4C)
L key
(0x4D)
M key
(0x4E)
N key
(0x4F)
O key
(0x50)
P key
(0x51)
Q key
(0x52)
R key
(0x53)
S key
(0x54)
T key
(0x55)
U key
(0x56)
V key
(0x57)
W key
(0x58)
X key
(0x59)
Y key
(0x5A)
Z key
Yes, every key has a seprate value other than their original VK_WHATEVER.

Say I wanted to trigger a function with the left mouse button. I could do:

Code:
if(GetAsyncKeystate(VK_LBUTTON)<0){
or I could do

Code:
if(GetAsyncKeyState(0x01)<0) {
It would be the exact same thing.

Letters don't have VK values so you would have to use hex values for them.
Quote Originally Posted by CodeDemon View Post
Yes, every key has a seprate value other than their original VK_WHATEVER.

Say I wanted to trigger a function with the left mouse button. I could do:

Code:
if(GetAsyncKeystate(VK_LBUTTON)<0){
or I could do

Code:
if(GetAsyncKeyState(0x01)<0) {
It would be the exact same thing.

Letters don't have VK values so you would have to use hex values for them.
VK = Virtual Key
0x = Hex

You can also do::
if(GetAsyncKeystate('x')<0) {
}
Daum guys..

[php]
if(GetAsyncKeyState( VkKeyScan('e') )
{
//
}
[/php]
why if you making far reach hack just leave it auto on cuz every time they press e it will turn of and on
or u can find my post.....in c++ area jez us...
You guys know that he asked if that code translated to: If button E pressed, do code.

Which all but one of you answered....

Quote Originally Posted by CodeDemon View Post
Yes, every key has a seprate value other than their original VK_WHATEVER.
I congratulate you CodeDemon.
Posts 1–10 of 10 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?