• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to combine a set of keys function

 
WarrenII Pan
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, everyone!
I am interested in designing Java games. I got a problem recently. We all have the experience that when controlling an actor to do a certain action, we sometimes require to press the up and right arrow buttons simultaneously.
In order to help users get easier operation, my question is how to press a single button, say "F8", to perform the same function mentioned above?

Thanks in advance!

Regards, WarrenII Pan
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the recommended way seems to be to use key bindings

http://java.sun.com/docs/books/tutorial/uiswing/misc/keybinding.html

but here's another way

 
WarrenII Pan
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you, Michael! You do give me a lot of help in resolving my questions!

Regards, WarrenII Pan
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!