0

Hey,

I am now programming in a MacBook Pro and for the KeyCodes in the Robot Class, there is no set key for Command. Can I set a KeyCode to do the actions of the Command key?

Thanks

3
Contributors
4
Replies
6
Views
6 Years
Discussion Span
Last Post by caswimmer2011
0

The list of VK_... key codes can be found in the JavaDoc for KeyEvent. eg the control key is VK_CONTROL.
I don't know about how the Mac Command key is coded, maybe its its the same as VK_WINDOWS? (easy to try!), but you could write a very small program with a KeyListener and print out the key code that is passed into your keyPressed method,

0

Good idea with the VK_WINDOWS key, but it did not work :( I was trying to avoid that, but I think it is the only way. Would you have any idea how to get started?

1

Write a small program, implementing keyListener. On the key pressed method, you print out te character.

0

I actually found one online and modified it. Turns out to be keycode 157. Thanks for helping!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.