How To: Make Keyboard Keys To Execute A Method?

C

clusardi2k

Hello,

How do I get a sequence of keyboard keys to execute a method.

For example, if someone types the "control" key, "shift" key, and the "enter" key I want to execute a method called "keyboard_input". Do you also have a working example.

Thank you,
 
J

John B. Matthews

How do I get a sequence of keyboard keys to execute a method.

For example, if someone types the "control" key, "shift" key, and
the "enter" key I want to execute a method called "keyboard_input".
Do you also have a working example.
[/QUOTE]

To which I replied,

To which you replied,

KeyListener is fairly low-level; it might be appropriate for "a
sequence of keyboard keys." The rest of your question mentions keys
used as modifiers, for which key bindings are considerably more
convenient.

See also, How to Use Actions:

<http://docs.oracle.com/javase/tutorial/uiswing/misc/action.html>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,821
Latest member
AleidaSchi

Latest Threads

Top