input list for keyboard keys ??

I am using some Normally Open (NO) switched with a joystick and buttons for a RetroPie/RaspberryPi setup. Is there a list that shows keyboard inputs??

So if a switch is closed, and I want that switch to be a KEY_ALT for example.

Where is this list ???

Thanks!

It's not clear to me what you're asking.

Perhaps this is what you're looking for?

I have a bunch of video game buttons that need to correspond to keyboard inputs for the Raspberry Pi.

So if I hit a button, that button needs to be a CTRL_ALT, so the RP can understand it.

This is what I have so far, but I need to change my code so that Button1 at Pin 4 will be a CTRL_ALT.

Where is that list?

And also, how do I change my code to get Button1 so that it translates to a CTRL_ALT ?

Thanks !!

code:

void setup() {
Keyboard.begin();

//Joystick and buttons pin allocations
pinMode(0, INPUT_PULLUP); //Joystick Up
pinMode(1, INPUT_PULLUP); //Joystick Down
pinMode(2, INPUT_PULLUP); //Joystick Left
pinMode(3, INPUT_PULLUP); //Joystick Right
pinMode(4, INPUT_PULLUP); //Button 1
pinMode(5, INPUT_PULLUP); //Button 2
pinMode(6, INPUT_PULLUP); //Button 3
pinMode(7, INPUT_PULLUP); //Button 4
pinMode(8, INPUT_PULLUP); //Coin
pinMode(9, INPUT_PULLUP); //Start
}

void loop() {

// Button labels:
int joystickUp = digitalRead(0);
int joystickDown = digitalRead(1);
int joystickLeft = digitalRead(2);
int joystickRight = digitalRead(3);
int button1 = digitalRead(4);
int button2 = digitalRead(5);
int button3 = digitalRead(6);
int button4 = digitalRead(7);
int coin = digitalRead(8);
int start = digitalRead(9);

// Joystick Up - Arrow Up Key
if (joystickUp == LOW) {
Keyboard.press(218);
}
else {
Keyboard.release(218);
}

// Joystick Down - Arrow Down Key
if (joystickDown == LOW) {
Keyboard.press(217);
}
else {
Keyboard.release(217);
}

// Joystick Left - Arrow Left Key
if (joystickLeft == LOW) {
Keyboard.press(216);
}
else {
Keyboard.release(216);
}

// Joystick Right - Arrow Right Key
if (joystickRight == LOW) {
Keyboard.press(215);
}
else {
Keyboard.release(215);
}

// Button 1 - Left CTRL
if (button1 == LOW) {
Keyboard.press(128);
}
else {
Keyboard.release(128);
}

// Button 2 - Left ALT
if (button2 == LOW) {
Keyboard.press(130);
}
else {
Keyboard.release(130);
}

// Button 3 - Left CTRL
if (button3 == LOW) {
Keyboard.press(32);
}
else {
Keyboard.release(32);
}

// Button 4 - Left CTRL
if (button4 == LOW) {
Keyboard.press(129);
}
else {
Keyboard.release(129);
}

// Coin - 5
if (coin == LOW) {
Keyboard.press(53);
}
else {
Keyboard.release(53);
}

// Start - 1
if (start == LOW) {
Keyboard.press(49); delay(100);
}
else {
Keyboard.release(49);
}

}

There is no "CTRL_ALT". The list I already provided is all there is. Think about it: Do you have a "CTRL_ALT" button on your keyboard? No. You press and hold the Ctrl key, then you press the Alt key, then you release the Ctrl key. You need to do the same thing in your code.

Take some time to study File > Examples > 09.USB > Keyboard > KeyboardLogout and I think you'll understand how this can be done.