Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    Golden.'s Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    156
    Reputation
    10
    Thanks
    3
    My Mood
    Amazed

    [CODE] Button Pressed[Solved]

    Complete this:

    Label1.text = ( whatever button i just pressed ) ?

    Eg, if i pressed F6, The label text would be " F6 "

  2. #2
    'Bruno's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Portugal
    Posts
    2,883
    Reputation
    290
    Thanks
    1,036
    My Mood
    Busy
    this topic on the very first page of VB section.. why asking again dude?

    https://www.mpgh.net/forum/33-visual-...p-hotkeys.html
    Light travels faster than sound. That's why most people seem bright until you hear them speak.

  3. #3
    Golden.'s Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    156
    Reputation
    10
    Thanks
    3
    My Mood
    Amazed
    Quote Originally Posted by Brinuz View Post
    this topic on the very first page of VB section.. why asking again dude?

    Visual Basics - MPGH - MultiPlayer Game Hacking
    No.. If you read the topic, thats not what im looking for
    i need the Label text to be whatever button i pressed..
    So if i pressed " W "
    the label text would be " W "
    and if i pressed " T "
    the label text would be " T "
    Get it?

  4. #4
    'Bruno's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Portugal
    Posts
    2,883
    Reputation
    290
    Thanks
    1,036
    My Mood
    Busy
    Quote Originally Posted by Golden. View Post
    No.. If you read the topic, thats not what im looking for
    i need the Label text to be whatever button i pressed..
    So if i pressed " W "
    the label text would be " W "
    and if i pressed " T "
    the label text would be " T "
    Get it?
    yes i do, and it the same... if you dont want to focus..

    otherwise just use the keypress event on the label.. :\
    Light travels faster than sound. That's why most people seem bright until you hear them speak.

  5. #5
    /b/oss's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Posts
    13,651
    Reputation
    795
    Thanks
    3,547
    learn hotkeys then'll be easy there's lot of TUTs

  6. #6
    Golden.'s Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    156
    Reputation
    10
    Thanks
    3
    My Mood
    Amazed
    I need a code..I Am a complete newb. :P

  7. #7
    /b/oss's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Posts
    13,651
    Reputation
    795
    Thanks
    3,547
    Quote Originally Posted by Golden. View Post
    I need a code..I Am a complete newb. :P
    YouTube - Broadcast Yourself. you'll get code for sure, its pretty long/yea

  8. #8
    'Bruno's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Portugal
    Posts
    2,883
    Reputation
    290
    Thanks
    1,036
    My Mood
    Busy
    dude.. its all about events... you should really try to do it yourself.. Search around MSDN for returns and use intellisense to find functions, proprieties.. etc.
    Light travels faster than sound. That's why most people seem bright until you hear them speak.

  9. #9
    /b/oss's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Posts
    13,651
    Reputation
    795
    Thanks
    3,547

  10. #10
    Golden.'s Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    156
    Reputation
    10
    Thanks
    3
    My Mood
    Amazed
    OMG!
    I KNOW HOW DO HOTKEYS, THATS NOT WHAT IM LOOKING FOR!!!!!!
    Right
    When you are making the settings for a game
    it will say

    Shoot : [ Left Mouse ]

    Then you click it

    Shoot : [ ]

    Then you put what you want the shoot button to be

    Shoot : [ F Key ]

    It detects which key you just pressed..
    I Want a label to detect which key i pressed and then tell me.

  11. #11
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    .......Ok, watch the rage.

    Next on the list, what everyone is saying is correct, You just not getting it.

    But....there is an easier way

    really all you want to do is use keydown (keeping in mind that in the Keydown Event
    e = System.Windows.Forms.KeyEvenArgs (KeyEvents)

    Code:
    Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e
    As System.Windows.Forms.KeyEventArgs) Handles
    MyBase.KeyDown
    
    If e.KeyCode = 37 Then 
    label1.text = "cursor left"
    end if
    
    If e.KeyCode = 39 Then ' Cursor right
    label1.text = "cursor right"
    end if
    
    End Sub
    go online and look up the "Key
    Enumeration" list.

    ----
    e.Key = Key.Return etc.


    Last edited by NextGen1; 07-27-2010 at 11:13 PM.

  12. #12
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    [php]If getasynckeystate(keys.f6) then
    label1.text = "F6"
    End if[/php]

    I just did that for 240 keys not gonna give you though, it takes some time. I don't support copy & paste. You better use select case though.

    We do know what you want and with the information given above you can figure it out.

    Or you convert the key pressed to string, google for a method.
    Last edited by Blubb1337; 07-27-2010 at 11:17 PM.



  13. #13
    Golden.'s Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    156
    Reputation
    10
    Thanks
    3
    My Mood
    Amazed
    Problem is, i am doing this becuase i bought a USB game controller off ebay, i need to make sure the buttons work, and the buttons are called Button1, Button 2, that kind of thing..

  14. #14
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    Just go into a game and check it out x.x



  15. #15
    .Celtics's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    148
    Reputation
    10
    Thanks
    5
    My Mood
    Crappy
    Quote Originally Posted by Blubb1337 View Post
    Just go into a game and check it out x.x
    or..
    Control Panel > Game Controllers > Properties > TEST

Page 1 of 2 12 LastLast

Similar Threads

  1. [Help] Button Clicking [solved]
    By WTFXD185 in forum Visual Basic Programming
    Replies: 6
    Last Post: 04-14-2011, 08:46 PM
  2. [Help With My Injector Code] VB 08 [Solved]
    By h40xer in forum Visual Basic Programming
    Replies: 12
    Last Post: 09-18-2010, 07:36 PM
  3. Cycling through threads on button press
    By Azureum in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 0
    Last Post: 09-06-2010, 12:55 AM
  4. [Help]Change Button Text[Solved]
    By [PA]nts in forum Visual Basic Programming
    Replies: 7
    Last Post: 06-29-2010, 02:48 PM
  5. I cant load up Combat Arms EU error code -2, 10013[Solved]
    By blake0648 in forum Combat Arms EU Discussions
    Replies: 8
    Last Post: 04-25-2010, 02:55 PM