I am trying to make new keybindings to modify a game I play called Minecraft. But I need a map of the keyboard with the number codes (or whatever they are called). A downloadable image would be best so I can always have it. Please help me!
Printable View
I am trying to make new keybindings to modify a game I play called Minecraft. But I need a map of the keyboard with the number codes (or whatever they are called). A downloadable image would be best so I can always have it. Please help me!
For the KeyEvent codes, see the KeyEvent class API doc. It defines the variable names for the code values.
okay ill check that, if it is what i need, i will then mark as solved
well, I found something with stuff like VK_ALT, but i need actual numbers
The numbers for these constants should be outlined in the javadoc API.
Constant Field Values (Java Platform SE 6)
If you read the API doc you will see that all the VK_xxx variables are ints. IE they are all numbers.Quote:
i need actual numbers
Hardcoding magic numbers in a program is NOT a good style. Using named variables makes the code easier to understand and to maintain.
If you see: if( code == 65)
what letter is that refering to?
if you see: if (code == KeyEvent.VK_A)
you'd guess the A key
Thanks, everybody!
There's always the Java Tutorials: How To Use Key Bindings.
Key binding shows the action of the command as no confirmation is required. By providing a new key binding for the existing action. Key bindings are also use by mnemonics. Using a key binding is not a simple process.