Results 1 to 14 of 14
  1. #1
    omanel's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Portugal
    Posts
    93
    Reputation
    10
    Thanks
    4
    My Mood
    Inspired

    [Help Request]Keysend[Solved]

    Hi everyone, how can I send several keys at the same time, per example "ctrll+tab" so I can change the tab in firefox or "ctrl+w"?
    I'd appreciate your help,

    Thanks in advance,
    Omanel

  2. #2
    Nubwaffle00's Avatar
    Join Date
    Nov 2009
    Gender
    male
    Location
    idk
    Posts
    17
    Reputation
    15
    Thanks
    9
    My Mood
    Bored
    On the top of ur form, add this:
    Private Declare Function key Lib "User32" Alias "GetAsyncKeyState" (ByVal Key As Keys) As Keys
    And in a timer, add this:
    If key(Keys.ControlKey) And Keys.W Then

    End If
    Thank me if I helped!

    Help me raise my Habamon!

  3. #3
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    He wants to send them, not check if they are pressed, I guess.



  4. #4
    omanel's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Portugal
    Posts
    93
    Reputation
    10
    Thanks
    4
    My Mood
    Inspired
    Quote Originally Posted by Blubb1337 View Post
    He wants to send them, not check if they are pressed, I guess.
    I already know how to do it, found it on msdn

    If someone's Intrested:
    https://msdn.microsof*****m/en-us/libr...8VS.80%29.aspx

    (I think there's no problem in posting that link since it's a neutral and safe website)
    Last edited by omanel; 07-05-2010 at 10:46 PM.

  5. #5
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Okay add these declarations and constants (just under "Public Class Form1"):

    [php]
    Public Declare Function keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long) As Long

    Const KEYEVENTF_KEYUP = &H2
    [/php]

    Then add this sub procedure:

    [php]
    Private Sub press(ByVal mykey1 As Keys, ByVal mykey2 As Keys)

    keybd_event(mykey1, 0, 0, 0)
    keybd_event(mykey2, 0, 0, 0)
    keybd_event(mykey1, 0, KEYEVENTF_KEYUP, 0)
    keybd_event(mykey2, 0, KEYEVENTF_KEYUP, 0)

    End Sub
    [/php]

    Then to utilize this,

    [php]

    Press(Keys.ControlKey, Keys.W) 'this will press Ctrl + W)

    [/php]

    FLAMESABER originally gave me a similar snippet, I just modified it to press two keys.

    Not sure it works though :P Don't have VB right nao. It should though.

    J-Deezy

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  6. #6
    CodeHPro's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Posts
    116
    Reputation
    10
    Thanks
    76
    My Mood
    Aggressive
    if your just using firefox as an example, and your really planning on using this for a game it wont work there different add me on msn if your doing this for a game and ill help you get it to work

  7. #7
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    Quote Originally Posted by CodeHPro View Post
    if your just using firefox as an example, and your really planning on using this for a game it wont work there different add me on msn if your doing this for a game and ill help you get it to work
    It will work anywhere.

    @Deezy: Slight modification to your code.


    Code:
    Private Sub press(ByVal mykey1 As Keys, ByVal mykey2 As Keys)
    
            keybd_event(mykey1, 0, 0, 0)
            keybd_event(mykey2, 0, 0, 0)
            System.Threading.Thread.Sleep(500)
            keybd_event(mykey1, 0, KEYEVENTF_KEYUP, 0)
            keybd_event(mykey2, 0, KEYEVENTF_KEYUP, 0)
    
       End Sub
    ^^ This will work better !!

  8. #8
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Hmm I see But If you hold the keys down for half a second, multiple tabs will be opened etc.

    Maybe reduce it to 100 instead of 500

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  9. #9
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    Quote Originally Posted by J-Deezy View Post
    Hmm I see But If you hold the keys down for half a second, multiple tabs will be opened etc.

    Maybe reduce it to 100 instead of 500
    Ya, I just entered an example. It can be changed according to needs.

  10. #10
    omanel's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Portugal
    Posts
    93
    Reputation
    10
    Thanks
    4
    My Mood
    Inspired
    Quote Originally Posted by CodeHPro View Post
    if your just using firefox as an example, and your really planning on using this for a game it wont work there different add me on msn if your doing this for a game and ill help you get it to work
    Actually am doing it for a game, but it's a browser game that's why I said firefox

    Altough I found out how to do it in a simplest way Thnks to FLAMESABER and J-deezy anyways!

  11. #11
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    Quote Originally Posted by omanel View Post
    Actually am doing it for a game, but it's a browser game that's why I said firefox

    Altough I found out how to do it in a simplest way Thnks to FLAMESABER and J-deezy anyways!
    Glad to know prob is solved, but it will be good if you can share that simplest solution with us !!

  12. #12
    Bryci's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    In your pants. /fmm
    Posts
    503
    Reputation
    -24
    Thanks
    19
    My Mood
    Amused
    Quote Originally Posted by FLAMESABER View Post
    Glad to know prob is solved, but it will be good if you can share that simplest solution with us !!
    I believe he did with the MSDN link he posted earlier.

  13. #13
    Lolland's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Location
    Lolland!
    Posts
    3,156
    Reputation
    49
    Thanks
    868
    My Mood
    Inspired
    Marking solved.

  14. #14
    omanel's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Portugal
    Posts
    93
    Reputation
    10
    Thanks
    4
    My Mood
    Inspired
    Quote Originally Posted by FLAMESABER View Post
    Glad to know prob is solved, but it will be good if you can share that simplest solution with us !!
    Here's a source code of a application w/ 2 buttons and 1 timer that changes per example your tab in firefox etc.
    [html]Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Timer1.Enabled = True
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    Timer1.Enabled = False
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
    SendKeys.Send("^({tab})")
    End Sub
    End Class[/html]

    [html]SendKeys.Send("^({tab})")[/html]
    That equals "ctrl+tab"

    @lolland, ok, just awnsering FLAMESABER.

  15. The Following User Says Thank You to omanel For This Useful Post:

    Hassan (07-06-2010)

Similar Threads

  1. [Help Request] [Help Request] How to make No Recoil hack in Visual Studio?
    By Tstovall in forum CrossFire Help
    Replies: 5
    Last Post: 07-20-2011, 02:55 AM
  2. [Help Request] HElp request ?
    By wakosam in forum CrossFire Help
    Replies: 2
    Last Post: 07-17-2011, 06:35 PM
  3. [Help Request] Easy Help Request.
    By KrustyKokehead in forum Vindictus Help
    Replies: 6
    Last Post: 06-01-2011, 05:58 PM
  4. [Solved]help/request
    By deathic in forum Call of Duty Modern Warfare 2 Help
    Replies: 4
    Last Post: 11-14-2010, 02:25 AM
  5. [Help Request]Class[Solved]
    By omanel in forum Visual Basic Programming
    Replies: 11
    Last Post: 07-08-2010, 10:32 PM