I am trying to program my Arduino press and hold the mac left ‘option’ key down immediately once I plug it in. Here’s my current code after consulting various Q&A discussions:
#include <usb_keyboard.h>
//Code to press and hold the left Option key in Mac OS X (not sure if it is the right one)
keyboard_modifier_keys = KEY_LEFT_ALT;
keyboard_keys[0] = 0;
keyboard_keys[1] = 0;
keyboard_keys[2] = 0;
keyboard_keys[3] = 0;
keyboard_keys[4] = 0;
keyboard_keys[5] = 0;
usb_keyboard_send();
_delay_ms(5000);
However, an error message occurs when I try to verify this code, and states that ‘keyboard_modifier keys’ does not name a type. Can someone please let me know what I did wrong to program a seemingly easy task?
Thanks!