Need help with the joystick library

My code:

#include <Joystick.h>

// Create the Joystick
Joystick_ Joystick;

// Constant that maps the phyical pin to the joystick button.
const int pin1 = 8;
const int pin0 = 3;

void setup() {
  // Initialize Button Pins
  pinMode(pin1, INPUT_PULLUP);
  pinMode(pin0, INPUT_PULLUP);

  // Initialize Joystick Library
  Joystick.begin();
}

// Last state of the button


void loop() {

  // Read pin values
  if (1==digitalRead(pin1)){
  Joystick.setButton(0,1); Joystick.setButton(1,0); Joystick.setButton(2,0);}
  else {
    if(1==digitalRead(pin0)){
  Joystick.setButton(0,0); Joystick.setButton(1,1); Joystick.setButton(2,0);}
  else{
  Joystick.setButton(0,0); Joystick.setButton(1,0); Joystick.setButton(2,1);}
  }
  
  delay(50);
}

The foundation comes from the simple example from the website of the joystick library. I tried to modify it for a 3way switch.

In theory, there should be a different output for each case, when pin0 is connected, when pin1 is connected and when nothing is connected. At the moment it works for pin1 and when nothing is connected, but not for pin0. I know that the problem lies somewhere here:

   if (1==digitalRead(pin1)){
  Joystick.setButton(0,1); Joystick.setButton(1,0); Joystick.setButton(2,0);}
  else {
    if(1==digitalRead(pin0)){
  Joystick.setButton(0,0); Joystick.setButton(1,1); Joystick.setButton(2,0);}
  else{
  Joystick.setButton(0,0); Joystick.setButton(1,0); Joystick.setButton(2,1);}
  }

because if I swap pin1 and pin0 in this part of the code it works for the latter but not for pin1.

Thanks for your help in advance.

Since you're using input_pullup on your pins, shouldn't you be looking for LOW (0) on your digital reads to indicate that a button is pressed?

To be honest with you, I don't know exactly what input_pullup means. I couldn't find anything on the website but since it was used in the example code and it worked there I rolled with it. I will give your advice a try, thanks.

    if (1==digitalRead(pin1)) {
        //  If pin1 is HIGH
        Joystick.setButton(0,1); Joystick.setButton(1,0); Joystick.setButton(2,0);
    } else { // If pin1 is LOW
        if(1==digitalRead(pin0) ) {
            // If pin1 is LOW and pin0 is HIGH
            Joystick.setButton(0,0); Joystick.setButton(1,1); Joystick.setButton(2,0);
        } else {  // If pin1 is LOW and pin0 is LOW
           Joystick.setButton(0,0); Joystick.setButton(1,0); Joystick.setButton(2,1);
        }
    }

So you have:
pin1/pin0
HIGH/Don't care: 1,0,0
LOW/HIGH 0,1,0
LOW/LOW: 0,0,1