Tim Porritt

Greenhorn
+ Follow
since Jul 22, 2012
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
3
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Tim Porritt

What i'm trying to do is get the keycode for a string.
e.g If the string says "a", i want to return the integer for that, which is KeyEvent.VK_A, or 65.
I already found a way to do this, but it's really long and i have to write out every letter of the alphabet 3 times.

11 years ago
Hi i'm not sure if this is possible or not, but i want to get a variable name from a string.
My code so far is as follows:



I'll add the rest of the alphabet later.

Thanks in advance for any help given.
11 years ago
I'm trying to add a letter from an array to the end of KeyEvent.VK_

My code so far is as follows:



There's probably a better way to do this, but i don't know how to do it.
I'll add the rest of the alphabet later.

Thank you in advance for any help.
11 years ago
I'm trying to change a string such as "Up", to the integer 38.
So far, i've gotten all the lines from a file and added them to an ArrayList called "controls".

The file that I get the strings from looks like this:



The code that i've tried using to convert it is as follows:



When i try this, the ifs don't work (as in, the strings don't match), and they just return the 0, and i don't know why.

Please help...

PS. I'll find a way to add all keys to the keycode method later on.
11 years ago