[HELP] KboardHook (or something like that..)[Help]

Posts 1–2 of 2 · Page 1 of 1
[HELP] KboardHook (or something like that..)[Help]
hi,

EDIT: wrong title... should be : Help whit string-compatible sendkeys
i'm having some troubles using the sendkeyapi (posted here, on MPGH.net)... I want to send a string of text using keybd_event, but I'm having some problems...

here is the code (it's loland code):

[php]
Dim mystrng as string = "text"
dim chrs() as char = mystrng.tochararray 'converts mystrng to an array of characters
Dim i as integer = 0
Do until i = chrs.count 'performs an action until all the characters are covered
keybd_event(vkKeyScan(chrs(i)), 0, 0, 0) 'keydowns the specified character
keybd_event(vkKeyScan(chrs(i)), 0, KEYEVENTF_KEYUP, 0) 'keyups the specified character
i += 1
Loop
[/php]

I understand everything in there, exept the vkKeyScan (don't know how it works...)

Can someone tell me how to make this work? Thanks...



You can see the original Module and code (and other stuff) here:

http://www.mpgh.net/forum/33-visual-...y-alt-sdk.html

or here

http://www.mpgh.net/forum/33-visual-basics/137965-sdk-multiplayer-game-hacking-vb-codes.html
Quote Originally Posted by TheRealOne View Post
hi,

EDIT: wrong title... should be : Help whit string-compatible sendkeys
i'm having some troubles using the sendkeyapi (posted here, on MPGH.net)... I want to send a string of text using keybd_event, but I'm having some problems...

here is the code (it's loland code):

[php]
Dim mystrng as string = "text"
dim chrs() as char = mystrng.tochararray 'converts mystrng to an array of characters
Dim i as integer = 0
Do until i = chrs.count 'performs an action until all the characters are covered
keybd_event(vkKeyScan(chrs(i)), 0, 0, 0) 'keydowns the specified character
keybd_event(vkKeyScan(chrs(i)), 0, KEYEVENTF_KEYUP, 0) 'keyups the specified character
i += 1
Loop
[/php]

I understand everything in there, exept the vkKeyScan (don't know how it works...)

Can someone tell me how to make this work? Thanks...



You can see the original Module and code (and other stuff) here:

http://www.mpgh.net/forum/33-visual-...y-alt-sdk.html

or here

http://www.mpgh.net/forum/33-visual-basics/137965-sdk-multiplayer-game-hacking-vb-codes.html
Correct me if I'm wrong anyone, but I believe VkKeyScan converts a char to an integer? Once you break down your string into a char array, you cannot directly tell the keybd_event to press each letter just by putting "Char(i)" in the first parameter. Most functions related to the keyboard and such require an integer value, not a direct string/char variable. You've probably used

[php]
GetAsyncKeyState(Keys.F5)
[/php]

Or something similar before, yes? Well GetAsyncKeyState actually requires the char enumeration for the F5 key to be able to check it. The "Keys." class is actually just a nice little precompiled enumeration list of all the keys on the keyboard, try doing

[php]
Dim i As Integer = Keys.Left
MsgBox(i)
[/php]

You'll see that keys.left is actually an integer. Anyway,I think i managed to get wayyyy off-topic there haha. The point of vkKeyScan is it scans the specified char from your char array and attempts to convert it into an integer that keybd_event can recognise as a key of your keyboard.

Again, I'm not 100% sure if I'm right about all this so someone please correct me on any mistakes I made.
Posts 1–2 of 2 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us