Input press doesnt work

So, i’m trying to accomplish an easy task: press a button on arduino, left mouse is pressed.

#include <Keyboard.h>
#include <Mouse.h>

void setup() {
  pinMode(left_pin, INPUT_PULLUP);
  pinMode(right_pin, INPUT_PULLUP);
  Keyboard.begin();
  Mouse.begin();

void loop(){
  if (digitalRead(left_pin)==LOW){
     Keyboard.press('a');
     //Mouse.press(MOUSE_LEFT);
  }
  else{
    //Mouse.release(MOUSE_LEFT);
    Keyboard.release('a');
  }
}

Neither mouse or keyboard produce any results on windows.
I already checked with the serial monitor, Arduino correctly receive the signal from the button.
It’s funny because i used a very similar piece of code in another projct and it worked fine.

Any hint on what’s going on here?

Which model Arduino are you trying this on?

Sorry, forgot about the details: Arduino Micro, API version 1.8.13, Windows 10

Turns out there was some problem computer side, i rebooted and it works now. Mysteries

A Standard Windoze Corrective Manoeuvre (SCWM) is a very useful thing, :grinning: