What are VK_META and META_MASK in the Java Robot class? Any example that explains what they are or what they do would be very helpful.
Also, VK_META gives me an invalid keycode error on my Windows 7 PC.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
VK_META and META_MASK are defined in KeyEvent and InputEvent classes. They both define the META key as a standalone key pressed and as a modifier used pressing another key respectively.
The META key is a key used in old keyboards and now can be emulated using the Windows Key.
Robot class allows to simulate key strokes (pressed, released, typed) and mouse movement, “acting” as a user using the keyboard and mouse. When you use the robot class, you define the sequence of “actions” to simulate, mouse movements and keyboard usage. If you want to simulate the META key pressed or used as a modifier, need to pass the keyCode and these two constants define the keyCode for META typed and modifier.
You can have problems using this key depending some factors, such your keyboard layout, keyboard configuration, operating system…
If you have problem, try avoid using this key except you need to simulate the Windows (PC) or Command (Mac) key.