Teensy Keyboard Mac command key

Status
Not open for further replies.

C0keq

New member
I have my teensy acting as a keyboard, but I need it to perform the "command" key on a mac. I am working in the arduino IDE and I have teensyduino. I have used the following to try and emulate the key "type(KEY_LEFT_GUI,false);". However, this does not perform the function of "command". Any suggestions?
 
I don't have a mac, so I can't confirm this works on OSX, but this sketch opens and closes my start menu every second, and based on what I read in the USB keyboard section of the PJRC website, it should also press the command button.
Code:
void setup() {}
void loop() {
  Keyboard.set_modifier(MODIFIERKEY_GUI);
  Keyboard.send_now();
  Keyboard.set_modifier(0);
  Keyboard.send_now();
  delay(1000);
}
 
Status
Not open for further replies.
Back
Top