Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • Need some help with Mnemonic in Java.


    Cardozz

    Recommended Posts

    Hi there.

     

    So i've had all this stuff sorted for my elective course for school (the guessing game program i talked about in another topic in this subforum).

     

    However, i'd like to add a Mnemonic to the buttons i have (HIGHER and LOWER). The user doesnt have to click the buttons but instead can press 'h' (for button higher) and 'l' for button lower.

     

    The only simple solution i found was using the Mnemonic(VK.H), but this requires the user to use ALT + H in order to execute the actionperformed of the button. I played around with it a bit but couldn't find a way to just let it have 'H' as Mnemonic. Is there any way i can simply (so without great workarounds) add a Mnemonic to a button without using VK (alt + key) ?

     

    Thanks in advance! And yes, i've searched google already.

    Link to comment
    Share on other sites

    Er

    are you just asking how to make an applet do X action when they push Y key?

    In which case just add it to a listener?

     

    I'm assuming this is in Java.

    Yes Nezz. But what will be the code to do that? been searching everywhere for it lol

    Yeah been there, but can't seem to find what i'm really looking for lol :P

     

    Nevermind, ill find it somehow just need to keep digging!

    Link to comment
    Share on other sites

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.