Results 1 to 11 of 11
  1. #1
    killerld's Avatar
    Join Date
    Oct 2008
    Gender
    male
    Posts
    345
    Reputation
    11
    Thanks
    193
    My Mood
    Twisted

    [Help]Get a Key Press !?

    Hi,

    Here is my problem.
    I want to get the key that the user press in my label1.text

    Is that right ?

    Code:
                If (GetAsyncKeyState(65)) Then
                    Label1.Text = Label1.Text & "a"
                End If
    And if it is do I put it in form1_load sub ?
    Or like a While something True ?

    Thanks for help guyz !


    Sorry for my bad English ! I'm French Canadian !

    - When you use my hack, Please Thank Me

    Release some Hacks []
    Able to code in PhP / Mysql []
    Able to code in VB []
    Able to code in C# []
    Able to do VB Injector []
    Release an Injector []
    Active Member in the Community []
    Member who help small Hacker []

  2. #2
    freedompeace's Avatar
    Join Date
    Jul 2010
    Gender
    female
    Posts
    3,033
    Reputation
    340
    Thanks
    2,792
    My Mood
    Sad
    You do not use GetASyncKeyState for that.

    Use the Form.KeyDown event.

  3. #3
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Quote Originally Posted by freedompeace View Post
    You do not use GetASyncKeyState for that.

    Use the Form.KeyDown event.
    What if he wants it to appear even when the form isn't focused, or when he has other controls focused on the form though? :/

    I'll run through both methods though, you'd have to find a workaround for the Form_KeyDown if you have multiple controls as you can't select your actual form as if it were a control (i.e clicking on the blank form will not make it focused if there are other controls). Anywho:

    [php]
    Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
    Label1.Text = e.KeyCode.ToString
    End Sub
    [/php]

    And with GetAsyncKeyState (would require a timer!)

    [php]
    For i As Integer = 0 to 255
    If GetAsyncKeyState(i) Then
    Dim kCon As New KeysConverter
    Label1.Text = kCon.ConvertToString(i)
    TimerName.Stop
    Exit For
    End If
    Next
    [/php]

    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)

  4. #4
    freedompeace's Avatar
    Join Date
    Jul 2010
    Gender
    female
    Posts
    3,033
    Reputation
    340
    Thanks
    2,792
    My Mood
    Sad
    Quote Originally Posted by Jason View Post


    What if he wants it to appear even when the form isn't focused, or when he has other controls focused on the form though? :/

    I'll run through both methods though, you'd have to find a workaround for the Form_KeyDown if you have multiple controls as you can't select your actual form as if it were a control (i.e clicking on the blank form will not make it focused if there are other controls). Anywho:
    It doesn't look like he wants to do that from what he just posted O:

    And yes it will - use the System.Windows.Forms.Form.KeyPreview property.

  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
    Quote Originally Posted by freedompeace View Post
    It doesn't look like he wants to do that from what he just posted O:

    And yes it will - use the System.Windows.Forms.Form.KeyPreview property.
    I'm not seeing your point with the KeyPreview...

    Also, unless he has ONLY labels on his form (no buttons etc) handling only the form's keydown event won't work as expected (i.e not at all)

    EDIT. After reading the documentation it seems KeyPreview is the way to go after all

    [php]
    Me.KeyPreview = True
    [/php]

    Put the above code right before you need to display the next keypress in a label,

    Last edited by Jason; 10-18-2010 at 02:24 AM.

    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
    freedompeace's Avatar
    Join Date
    Jul 2010
    Gender
    female
    Posts
    3,033
    Reputation
    340
    Thanks
    2,792
    My Mood
    Sad
    Quote Originally Posted by Jason View Post


    I'm not seeing your point with the KeyPreview...

    Also, unless he has ONLY labels on his form (no buttons etc) handling only the form's keydown event won't work as expected (i.e not at all)

    EDIT. After reading the documentation it seems KeyPreview is the way to go after all

    [php]
    Me.KeyPreview = True
    [/php]

    Put the above code right before you need to display the next keypress in a label,


    Lol ! --"

    At least you've cleared up one thing, but your last point... Just set it at InitialiseComponent(). Repeatedly calling it kills performance (by a lil bit).

  7. #7
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Quote Originally Posted by freedompeace View Post
    Lol ! --"

    At least you've cleared up one thing, but your last point... Just set it at InitialiseComponent(). Repeatedly calling it kills performance (by a lil bit).
    But if you don't want to send all keypresses to the main form to be handled?

    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)

  8. #8
    'Bruno's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Portugal
    Posts
    2,883
    Reputation
    290
    Thanks
    1,036
    My Mood
    Busy
    Oh god... if he wants all KeyDown, KeyPress, KeyUp to be used, he uses KeyPreview propriety.. if not.. He will use the one that he feels like using. =D
    Light travels faster than sound. That's why most people seem bright until you hear them speak.

  9. #9
    killerld's Avatar
    Join Date
    Oct 2008
    Gender
    male
    Posts
    345
    Reputation
    11
    Thanks
    193
    My Mood
    Twisted
    The thing I want is :

    Code:
    If Key A Down Then
    Label1.Text = Label1.Text & "a"
    End if
    But i'm not **** able to do this !!


    Sorry for my bad English ! I'm French Canadian !

    - When you use my hack, Please Thank Me

    Release some Hacks []
    Able to code in PhP / Mysql []
    Able to code in VB []
    Able to code in C# []
    Able to do VB Injector []
    Release an Injector []
    Active Member in the Community []
    Member who help small Hacker []

  10. #10
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    Quote Originally Posted by Jason View Post


    What if he wants it to appear even when the form isn't focused, or when he has other controls focused on the form though? :/

    I'll run through both methods though, you'd have to find a workaround for the Form_KeyDown if you have multiple controls as you can't select your actual form as if it were a control (i.e clicking on the blank form will not make it focused if there are other controls). Anywho:

    [php]
    Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
    Label1.Text = e.KeyCode.ToString
    End Sub
    [/php]

    And with GetAsyncKeyState (would require a timer!)

    [php]
    For i As Integer = 0 to 255
    If GetAsyncKeyState(i) Then
    Dim kCon As New KeysConverter
    Label1.Text = kCon.ConvertToString(i)
    TimerName.Stop
    Exit For
    End If
    Next
    [/php]
    Quote Originally Posted by killerld View Post
    The thing I want is :

    Code:
    If Key A Down Then
    Label1.Text = Label1.Text & "a"
    End if
    But i'm not **** able to do this !!

    ????????????????????



  11. #11
    killerld's Avatar
    Join Date
    Oct 2008
    Gender
    male
    Posts
    345
    Reputation
    11
    Thanks
    193
    My Mood
    Twisted
    This work fine

    Code:
        Private Sub TextBox1_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
            Select Case e.KeyCode
                Case Keys.A
                    Label1.Text = "a"
            End Select
    
        End Sub
    But when I replace TextBox1 by Form1 nothing work ... :S


    Sorry for my bad English ! I'm French Canadian !

    - When you use my hack, Please Thank Me

    Release some Hacks []
    Able to code in PhP / Mysql []
    Able to code in VB []
    Able to code in C# []
    Able to do VB Injector []
    Release an Injector []
    Active Member in the Community []
    Member who help small Hacker []

Similar Threads

  1. [Help Request] Need help getting hacks to work
    By VpChris in forum Vindictus Help
    Replies: 5
    Last Post: 08-13-2011, 03:00 AM
  2. [Help Request] Need help, Get this when i start crossfire with injector.
    By -zZz- in forum CrossFire Help
    Replies: 4
    Last Post: 07-10-2011, 03:26 PM
  3. [Help] Tap Key Press Twice?
    By mastermods in forum Combat Arms Hack Coding / Programming / Source Code
    Replies: 4
    Last Post: 07-24-2010, 06:54 AM
  4. Need Help Get Beta Key Come in Here
    By Eviljamesh in forum Battlefield Heroes Hacks
    Replies: 1
    Last Post: 07-05-2009, 10:16 AM
  5. I get error key code already in use some one can help???
    By aprill27 in forum Call of Duty 4 - Modern Warfare (MW) Hacks
    Replies: 6
    Last Post: 01-11-2008, 09:37 PM