Results 1 to 8 of 8
  1. #1
    jaake's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Up your ass
    Posts
    55
    Reputation
    13
    Thanks
    23
    My Mood
    Tired

    Question [Help]Easy Global hotkeys[Solved]

    Sorry this is kinda my second question in the past 2 hours......but im workin on some pretty intense stuff!!!! (but not really ^^)

    anyways, i have searched google for hours and not been able to find an easy function to make global hotkeys... some of them are too long to even understand what they are, some of em dont even work....

    yeahhh havent been able to find anything that is a simple to use function for global hotkeys...

    creepy dancing monkeys to anyone who can help!! (most likely, nextgen will have an amazing answer, like always!! haha)

  2. #2
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    Below form1 write

    Code:
    Public Declare Function GetAsyncKeyState Lib "user64" (ByVal vKey As Long) As Integer
    Create a timer and enable it.

    On Timer1.Tick do something like..



    Code:
            Dim f1 As Boolean
        
            f1 = GetAsyncKeyState(Keys.F1)
    
            If f1 = True Then
               'your code here
            End If
    Whole code should look like this...

    Code:
    Public Class Form1
    
        Public Declare Function GetAsyncKeyState Lib "user64" (ByVal vKey As Long) As Intege
    
        Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
    
            Dim f1 As Boolean
         
            f1 = GetAsyncKeyState(Keys.F1)
    
            If f1 = True Then
                'your code here
            End If
        End Sub
    End Class



  3. #3
    jaake's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Up your ass
    Posts
    55
    Reputation
    13
    Thanks
    23
    My Mood
    Tired
    thank you thank you

    i saw one like that before but not exactly, ill try it out.

    if it works, ill put you in the credits of my next release cus without you, i wouldnt have a very good program now, would i

  4. #4
    Bombsaway707's Avatar
    Join Date
    Jun 2009
    Gender
    male
    Location
    Gym
    Posts
    8,799
    Reputation
    791
    Thanks
    4,004
    My Mood
    Amused
    Quote Originally Posted by jaake View Post
    thank you thank you

    i saw one like that before but not exactly, ill try it out.

    if it works, ill put you in the credits of my next release cus without you, i wouldnt have a very good program now, would i
    Hmm thank him? And btw the pic in ur sig has a ton of errors in the code lol

    Quote Originally Posted by jaake View Post
    hahaha bomb i know my sig has errors, its just random :P

    and blubb, just like the other ones i tried, it considers the keys always pressed, i dont know why but it thinks they are always active
    Lol and lemme give you my own hotkey code:
    Code:
    Private Declare Function GetAsyncKeyState Lib "user32.dll" (ByVal vKey As System.Int16) As Int16
        Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
            If GetAsyncKeyState(Keys.F1) <> 0 Then
                MsgBox("HI")
                'code here
            End If
        End Sub
    End Class
    Try that code and tell me results
    Last edited by NextGen1; 03-13-2010 at 04:06 PM.

  5. The Following User Says Thank You to Bombsaway707 For This Useful Post:

    jaake (03-13-2010)

  6. #5
    jaake's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Up your ass
    Posts
    55
    Reputation
    13
    Thanks
    23
    My Mood
    Tired
    alright i will, hope this one works

    ____________

    hahaha bomb i know my sig has errors, its just random :P

    and blubb, just like the other ones i tried, it thinks the keys always pressed, i dont know why but it thinks they are always active... the boolean is false unless i press a key, but it still thinks that they are pressed...

    _________________

    Quote Originally Posted by bombsaway707 View Post
    Lol and lemme give you my own hotkey code:
    first add this under public class:
    Code:
    Private Declare Function GetAsyncKeyState Lib "user32.dll" (ByVal vKey As System.Int16) As Int16
    then for the hotkey add(add this under a timer and enable the timer):
    Code:
    If GetAsyncKeyState(Keys.F1) <> 0 Then
    'code here
     End If
    Try that code and tell me results
    WORKS LIKE A CHARM!! Thank you so much I think its because your works on 64bit (mine) and other codes only work on 32bit, cus of that int16

    anyways, i will definately put you in the credits when i release it... yes its a tapper (im getting better though.. sometime soon ill release something better), and this isnt JUST a tapper, its the BEST tapper

    thanks again!

    EDIT: Sorry, double post :/
    Last edited by NextGen1; 03-13-2010 at 05:24 PM.

  7. #6
    hopefordope's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Location
    Herndon,VA
    Posts
    264
    Reputation
    9
    Thanks
    86
    My Mood
    Psychedelic
    so what exactly are u makeing

    Press Thank You[IMG]https://i45.tinypic.com/2hg8w0n.jpghttps://img1.UploadScreensho*****m/images/main/2/3203234450.jpg[/IMG]










    My Releases
    Injector 3G
    Injector 2G
    Injector 1G
    Super Spammer
    CA Cleaner
    My Tutorials
    How to Make a real Injector(PerX)
    How to Make a Calculator(leeched)

  8. #7
    jaake's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Up your ass
    Posts
    55
    Reputation
    13
    Thanks
    23
    My Mood
    Tired
    im mostly learning VB, but im making a tapper (yes, another..) but it is the most advanced that I have ever seen on mpgh or any other site...

    its almost done

  9. #8
    Invidus's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    2,167
    Reputation
    23
    Thanks
    650
    My Mood
    Bored
    AsyncKeyState is sometimes inaccurate.

    Global Hotkey - VB.NET Tutorials | Dream.In.Code

Similar Threads

  1. [Help] Global Hotkey [Solved]
    By karldeovbnet in forum Visual Basic Programming
    Replies: 6
    Last Post: 03-03-2011, 07:28 AM
  2. [HELP][EASY]Existing files[SOLVED]
    By QQmoar in forum Visual Basic Programming
    Replies: 7
    Last Post: 06-29-2010, 08:32 AM
  3. [Help]64Bit Hotkeys[Solved]
    By xsaban13x in forum Visual Basic Programming
    Replies: 27
    Last Post: 04-23-2010, 08:08 AM
  4. [HELP]Hotkeys[Solved]
    By dylan40 in forum Visual Basic Programming
    Replies: 16
    Last Post: 04-21-2010, 08:55 AM
  5. [HELP]Hotkeys[Solved]
    By luckie12 in forum Visual Basic Programming
    Replies: 3
    Last Post: 04-02-2010, 03:38 PM