Compiling error. Doesn't think I'm including libraries that I am.

(I’m pretty new to this so please give me a break if this is a really dumb mistake.)

Okay so I was messing around on this website and came across the Mouse library listings and thought it looked interesting. I wrote up a little thing that would just spam clicks when I pressed a button.

#include <Mouse.h>
void setup() {
 
pinMode(2,INPUT);
Mouse.begin();
}

void loop() {
  int x = digitalRead(2);
  if(digitalRead(x==HIGH)){
Mouse.click();
delay(100);
  }
}

However, when I tried compiling it, I get the error

exit status 1
‘Mouse’ not found. Does your sketch include the line ‘#include <Mouse.h>’?

It finds a problem with both Mouse.click(); and Mouse.begin();. I don’t understand at all what could be going wrong. I can compile and upload to the board if I just exclude anything related to the mouse library but when I try to include it it does this. No idea what could be going wrong, everything seems fine. I’m on Win10, Arduino UNO R3.

erer1243:
I'm on Win10, Arduino UNO R3.

From the mouse library docs:

These core libraries allow a 32u4 based boards or Due and Zero board to appear as a native Mouse and/or Keyboard to a connected computer.

It only works with Leonardo, Due, and Zero boards. Won't work with an UNO.

This is why reading is such an important part of coding.