How to simulate a key pressing in VB
Hi, I've got a problem witch often annoys me, that's how to simulate a key pressing.
I actually know how to make the computer type character, but I'd like to press other keys like Left, Right, Ctrl... and I'd also like to keep the keys down as long as I want.
Thanks for your answers !
Re: How to simulate a key pressing in VB
You are probably going to have to provide more info about your problem. What have you tried to get this to work? Do you have an example of what exactly you are trying to do in code?
Re: How to simulate a key pressing in VB
I can't really give an example, because I'm just looking for a command or a function.
It can be for example : Keyboard.PressKey(Keys.Left, 1500). 1500 would be the time to keep the key down.
Re: How to simulate a key pressing in VB
Why not just run a while loop on the forms key down or key press event?
Re: How to simulate a key pressing in VB
What mechanism are you using to 'type a character'? Why can't you do the same for other keys?
Simply, as stated before, you need to give more information. Is this your application? Are you wanting to interact with another application? Do you want to send data to another application? Ids this a game cheater that you are trying to implement?
Re: How to simulate a key pressing in VB
To type characters, it's quiet simple:
Sendkeys.Send("a"), but you cant write Left instead of "a", and you cant make it keep the key down few seconds.
I dont know what informations I could give.
Yes, I want to interact with a game to cheat.
Re: How to simulate a key pressing in VB
Quote:
Originally Posted by
Recoil1980
Why not just run a while loop on the forms key down or key press event?
I dont see want you mean.
Re: How to simulate a key pressing in VB
Quote:
Originally Posted by
Nayl.VBcoder
Yes, I want to interact with a game to cheat.
I am unable to help further...
Re: How to simulate a key pressing in VB
Never mind, I just saw this was for cheating.
Re: How to simulate a key pressing in VB
So, does anyone know if such a command or fonction exists ?
Re: How to simulate a key pressing in VB
If you want to know, it's to cheat on the hidden game in Google Chrome.
Re: How to simulate a key pressing in VB
We do not condone cheating on this forum. Apart from anything, reverse engineering Google's content breaks their terms and conditions.
Thread Closed