DigiSpark Keyboard library Windows key error

Hi everyone. I am using a Digispark with the Digikeyboard library and what I simply want to do at first, is automatically open the Windows menu by pressing the Windows key. In order to do that I wrote the following code:

#include "DigiKeyboard.h"
#define KEY_ESC 41
#define MOD_GUI_LEFT 227

void setup() {
    DigiKeyboard.update();
    DigiKeyboard.sendKeyStroke(0,MOD_GUI_LEFT);
    DigiKeyboard.delay(100);
}

I looked up several forums and documentation about this, and this code mostly works for everyone. It opens the Windows menu by pressing the Windows key. But when I plug my Digispark with the code loaded, instead of open the Windows menu, it opens the Office 365 app. I don't know why that's happening, I tried to do it in a different computer and the same occurs. I tried to uninstall the Office 365 app and what it does is open the Office 365 web on my navigator. The code is very simple and clear and I don't know what can happens.
Does someone knows what is happening, if I need to change something in my code?

Remove that line:

It's simply wrong. MOD_GUI_LEFT is 8 but you don't have to define it as it's defined in DigiKeyboard.h.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.