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 


VkKeyScan() C++ High and Low Byte

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

Joined: 13 Jun 2007
Posts: 80

PostPosted: Thu Aug 02, 2007 6:49 pm    Post subject: VkKeyScan() C++ High and Low Byte Reply with quote

In the VkKeyScan(), it sais you can get the shift state from the high order byte.
vk=VkKeyScan(x);
now vk holds the key code for x.(this works fine)
How do I retrieve the shift status(high-order byte)?

_________________
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

Joined: 09 May 2003
Posts: 25820
Location: The netherlands

PostPosted: Thu Aug 02, 2007 7:01 pm    Post subject: Reply with quote

vk holds both the shiftkey state and the keycode
to get the key code use
keycode = vk & 0xff;

to get the shift status use:
shiftstate = vk >> 8;

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Varreon
Advanced Cheater
Reputation: 0

Joined: 13 Jun 2007
Posts: 80

PostPosted: Thu Aug 02, 2007 7:04 pm    Post subject: Reply with quote

Thanks! I'd never find this with google Smile

*Edit:*
Just to be sure, the bitshift right 8 was because a byte has a size of 8, right?
Maybe im wrong :/

_________________
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

Joined: 09 May 2003
Posts: 25820
Location: The netherlands

PostPosted: Thu Aug 02, 2007 7:19 pm    Post subject: Reply with quote

yes, that way the high byte becomes the low byte and can you just work with it like that
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Varreon
Advanced Cheater
Reputation: 0

Joined: 13 Jun 2007
Posts: 80

PostPosted: Thu Aug 02, 2007 7:20 pm    Post subject: Reply with quote

Cool Smile
_________________
Back to top
View user's profile Send private message
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