Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[Question]MapVirtualKey

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
yoyonerd
Grandmaster Cheater
Reputation: 0

Joined: 26 Apr 2008
Posts: 699
Location: -->formerly yoyonerd<--

PostPosted: Sun May 03, 2009 3:56 pm    Post subject: [Question]MapVirtualKey Reply with quote

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
View user's profile Send private message AIM Address
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Sun May 03, 2009 4:44 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Sun May 03, 2009 6:58 pm    Post subject: Reply with quote

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
View user's profile Send private message
yoyonerd
Grandmaster Cheater
Reputation: 0

Joined: 26 Apr 2008
Posts: 699
Location: -->formerly yoyonerd<--

PostPosted: Mon May 04, 2009 7:22 pm    Post subject: Reply with quote

I see, but what does this do to make it possible to actually loot an item in the game?
_________________
Back to top
View user's profile Send private message AIM Address
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Mon May 04, 2009 7:33 pm    Post subject: Reply with quote

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
View user's profile Send private message
yoyonerd
Grandmaster Cheater
Reputation: 0

Joined: 26 Apr 2008
Posts: 699
Location: -->formerly yoyonerd<--

PostPosted: Tue May 05, 2009 8:16 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites