| View previous topic :: View next topic |
| Author |
Message |
yoyonerd Grandmaster Cheater
Reputation: 0
Joined: 26 Apr 2008 Posts: 699 Location: -->formerly yoyonerd<--
|
Posted: Sun May 03, 2009 3:56 pm Post subject: [Question]MapVirtualKey |
|
|
Well I'm the type of person who likes to know what my programming code does.
Recently I made an auto-looter for a game that was removed from the CEF game sections.
For one of the parameters of the PMX function I used, I had to use MapVirtualKey()
I was just wondering if anybody could tell me what
| Code: |
MapVirtualKey(0x5A, 0) << 16 |
does
YES I know what 0x5A is, I'm just not so sure about MVK and what the << 16 does.
_________________
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Sun May 03, 2009 4:44 pm Post subject: |
|
|
| MSDN wrote: | | The MapVirtualKey function translates (maps) a virtual-key code into a scan code or character value, or translates a scan code into a virtual-key code. |
And, << is the left bitwise shift operator. Follow this link for more information.
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Sun May 03, 2009 6:58 pm Post subject: |
|
|
MapVirtualKey(0x5A, 0) returns the scan-code of that virtual key.
<< 16 shifts that scan-code 16 bits left.
If you look at the lParam value of WM_KEYDOWN.
| Quote: | 16-23
Specifies the scan code. The value depends on the OEM. |
So to specify the scan-code, we must shift the value 16 bits.
_________________
|
|
| Back to top |
|
 |
yoyonerd Grandmaster Cheater
Reputation: 0
Joined: 26 Apr 2008 Posts: 699 Location: -->formerly yoyonerd<--
|
Posted: Mon May 04, 2009 7:22 pm Post subject: |
|
|
I see, but what does this do to make it possible to actually loot an item in the game?
_________________
|
|
| Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Mon May 04, 2009 7:33 pm Post subject: |
|
|
| yoyonerd wrote: | | I see, but what does this do to make it possible to actually loot an item in the game? |
I don't really know, most likely is that the application that receives the WM_KEYDOWN message checks the lParam for a proper scan-code before proceeding.
_________________
|
|
| Back to top |
|
 |
yoyonerd Grandmaster Cheater
Reputation: 0
Joined: 26 Apr 2008 Posts: 699 Location: -->formerly yoyonerd<--
|
Posted: Tue May 05, 2009 8:16 pm Post subject: |
|
|
| lurc wrote: | | yoyonerd wrote: | | I see, but what does this do to make it possible to actually loot an item in the game? |
I don't really know, most likely is that the application that receives the WM_KEYDOWN message checks the lParam for a proper scan-code before proceeding. |
So is it just another one of those things that we just use because we have to? xD
_________________
|
|
| Back to top |
|
 |
|