I am creating a text adventure game in eclipse. I would like to know how while you are in the console you can press a key such as '1' or '2' and the computer registers this as 'attack' or 'block' being typed out. So basically what i'm asking here is: how can you press a key and instead of that one character, a whole word is entered. So when I press '1', i'm really just saying to the computer that I would like to attack. That way I wouldn't have to type out 'attack'. I can just press 1 and 'attack' is typed out for me. This would prevent people from typing out the wrong word. That's really it. People don't really seem to understand me whenever I ask questions like this so if you need me to elaborate, just say so. Thanks for any help :)
And one more thing. I don't know how this works, but please don't say that there's another question similar to this one. I think there actually is. I looked at that question though, and wow. Is it confusing as f*ck, excuse my language.
Also, btw, I don't know but i'm going into 12th grade and I believe my computer programming teacher is teaching us java. I think that's what i'm using. Again, not sure, but I think it's java.
No one knows? I feel like my programming teacher wouldn't know. No one knows anything about how to do this?