Results 1 to 12 of 12

Thread: How to simulate a key pressing in VB

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2016
    Posts
    12

    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 !

  2. #2
    Lively Member
    Join Date
    Dec 2011
    Posts
    116

    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?

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2016
    Posts
    12

    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.

  4. #4
    Lively Member
    Join Date
    Dec 2011
    Posts
    116

    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?

  5. #5
    PowerPoster SJWhiteley's Avatar
    Join Date
    Feb 2009
    Location
    South of the Mason-Dixon Line
    Posts
    2,256

    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?
    "Ok, my response to that is pending a Google search" - Bucky Katt.
    "There are two types of people in the world: Those who can extrapolate from incomplete data sets." - Unk.
    "Before you can 'think outside the box' you need to understand where the box is."

  6. #6

    Thread Starter
    New Member
    Join Date
    Jan 2016
    Posts
    12

    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.

  7. #7

    Thread Starter
    New Member
    Join Date
    Jan 2016
    Posts
    12

    Re: How to simulate a key pressing in VB

    Quote Originally Posted by Recoil1980 View Post
    Why not just run a while loop on the forms key down or key press event?
    I dont see want you mean.

  8. #8
    Lively Member
    Join Date
    Dec 2011
    Posts
    116

    Re: How to simulate a key pressing in VB

    Quote Originally Posted by Nayl.VBcoder View Post
    Yes, I want to interact with a game to cheat.
    I am unable to help further...

  9. #9
    Hyperactive Member
    Join Date
    Sep 2004
    Posts
    482

    Re: How to simulate a key pressing in VB

    Never mind, I just saw this was for cheating.

  10. #10

    Thread Starter
    New Member
    Join Date
    Jan 2016
    Posts
    12

    Re: How to simulate a key pressing in VB

    So, does anyone know if such a command or fonction exists ?

  11. #11

    Thread Starter
    New Member
    Join Date
    Jan 2016
    Posts
    12

    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.

  12. #12
    Super Moderator FunkyDexter's Avatar
    Join Date
    Apr 2005
    Location
    An obscure body in the SK system. The inhabitants call it Earth
    Posts
    7,957

    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
    The best argument against democracy is a five minute conversation with the average voter - Winston Churchill

    Hadoop actually sounds more like the way they greet each other in Yorkshire - Inferrd

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width