0

This might be a very simple question but I don't know which key represents KEY_LEFT_GUI on my keyboard. I thought it was the windows key but when I program Arduino Micro to execute it. Run does not open and it prints powershell on the "Search Programs and Files" section in Windows7 VM.

  Keyboard.press(KEY_LEFT_GUI);
  delay(1000);
  Keyboard.press('r');
  delay(1000);
  Keyboard.releaseAll();

  delay(500);

  Keyboard.print("powershell");
  typeKey(KEY_RETURN);

2 Answers 2

0

KEY_LEFT_GUI is the left Windows key. I think the problem may be that your code is only holding those keys down for microseconds. You need to give the computer a little bit of time to recognize the keypresses because it's expecting a human using a keyboard, not a microcontroller running at 16MHz. Try adding a delay before Keyboard.releaseAll();.

2
  • it's still just opening the start menu and typing it there instead of opening run I added a 1000 delay before releaseAll and a 1000 delay above press('r') but it is only detecting the windows press not the r
    – Katz
    Dec 17, 2016 at 4:24
  • I guess I just didn't know how fast a millisecond really is. I changed the delay to 4000 and it's working now.
    – Katz
    Dec 17, 2016 at 4:28
1

I know it's a late answer, but you can use to open the run window:

Keyboard.press(KEY_LEFT_GUI); Keyboard.press(114); Keyboard.releaseAll();

And yes, as per1234 says, KEY_LEFT_GUI is the left windows key

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.