I have the library on the code but it keeps asking me to add it

Arduino: 1.8.13 (Windows Store 1.8.42.0) (Windows 10), Board: "Arduino Uno"

In file included from C:\Users\vovxb\Documents\Arduino__.ino:3:0:

C:\Users\vovxb\Documents\Arduino\libraries\Keyboard\src/Keyboard.h:29:2: warning: #warning "Using legacy HID core (non pluggable)" [-Wcpp]

#warning "Using legacy HID core (non pluggable)"

^~~~~~~

C:\Users\vovxb\Documents\Arduino__.ino: In function 'void setup()':

_:19:3: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?

Keyboard.begin();

^~~~~~~~

C:\Users\vovxb\Documents\Arduino__.ino:19:3: note: suggested alternative: 'Keypad'

Keyboard.begin();

^~~~~~~~

Keypad

C:\Users\vovxb\Documents\Arduino__.ino: In function 'void loop()':

_:32:14: error: 'FFA857' was not declared in this scope

case FFA857: Keyboard.press(KEY_LEFT_ARROW); //left key

^~~~~~

_:32:23: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?

case FFA857: Keyboard.press(KEY_LEFT_ARROW); //left key

^~~~~~~~

C:\Users\vovxb\Documents\Arduino__.ino:32:23: note: suggested alternative: 'Keypad'

case FFA857: Keyboard.press(KEY_LEFT_ARROW); //left key

^~~~~~~~

Keypad

_:32:38: error: 'KEY_LEFT_ARROW' was not declared in this scope

case FFA857: Keyboard.press(KEY_LEFT_ARROW); //left key

^~~~~~~~~~~~~~

_:37:14: error: 'FF629D' was not declared in this scope

case FF629D: Keyboard.press(KEY_RIGHT_ARROW); //right key

^~~~~~

_:37:38: error: 'KEY_RIGHT_ARROW' was not declared in this scope

case FF629D: Keyboard.press(KEY_RIGHT_ARROW); //right key

^~~~~~~~~~~~~~~

Multiple libraries were found for "Keyboard.h"

Used: C:\Users\vovxb\Documents\Arduino\libraries\Keyboard

Not used: C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\libraries\Keyboard

Not used: C:\Users\vovxb\Documents\Arduino\libraries\Keyboard-master

Multiple libraries were found for "IRremote.h"

Used: C:\Users\vovxb\Documents\Arduino\libraries\IRremote

Not used: C:\Users\vovxb\Documents\Arduino\libraries\Arduino-IRremote-master

exit status 1

'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

AND HERES THE CODE

#include <Key.h>
#include <Keypad.h>
#include <Keyboard.h>

//this is sample code that shows some example keyboard operaions
#include <IRremote.h>
#include <Keyboard.h>

int RECV_PIN = 16;

IRrecv irrecv(RECV_PIN);

decode_results results;

void setup()
{
Serial.begin(9600);
irrecv.enableIRIn(); // Start the receiver
Keyboard.begin();
}

void loop() {
if (irrecv.decode(&results))
{

switch(results.value)
{

//Backward key is used for left key operation
case FFA857: Keyboard.press(KEY_LEFT_ARROW); //left key
delay(100);
Keyboard.releaseAll();
break;
//Forward Key is used for right key operation
case FF629D: Keyboard.press(KEY_RIGHT_ARROW); //right key
delay(100);
Keyboard.releaseAll();
break;

}
irrecv.resume(); // Receive the next value
}
}

_.ino (1.04 KB)

Did you do a search?

https://forum.arduino.cc/?topic=710031

The UNO does not support the keyboard library, you need a 32u4 based board, like the Leonardo.

Thanks