diff --git a/.github/workflows/arduino-cli-builds.yml b/.github/workflows/arduino-cli-builds.yml index 4a7d44b..7d635bf 100644 --- a/.github/workflows/arduino-cli-builds.yml +++ b/.github/workflows/arduino-cli-builds.yml @@ -62,7 +62,7 @@ jobs: submodules: true - name: Install Arduino-cli - uses: arduino/setup-arduino-cli@v1 + uses: arduino/setup-arduino-cli@v2 # arduino nano uses this just to access LEDs, grr... - name: Install Arduino Nano Connect library diff --git a/SamcoEnhanced/SamcoEnhanced.ino b/SamcoEnhanced/SamcoEnhanced.ino index ebb98b8..fa6a93e 100644 --- a/SamcoEnhanced/SamcoEnhanced.ino +++ b/SamcoEnhanced/SamcoEnhanced.ino @@ -3789,12 +3789,12 @@ void TriggerFireSimple() if(!buttonPressed && // Have we not fired the last cycle, offscreenButtonSerial && buttons.offScreen) { // and are pointing the gun off screen WITH the offScreen button mode set? if(buttons.analogOutput) { Gamepad16.press(LightgunButtons::ButtonDesc[BtnIdx_A].reportCode3); } - else { AbsMouse5.press(MOUSE_RIGHT); } + else { AbsMouse5.press(MOUSE_RIGHT); } offscreenBShot = true; // Mark we pressed the right button via offscreen shot mode, buttonPressed = true; // Mark so we're not spamming these press events. } else if(!buttonPressed) { // Else, have we simply not fired the last cycle? - if(buttons.analogOutput) { Gamepad16.press(LightgunButtons::ButtonDesc[BtnIdx_Trigger].reportCode3); } - else { AbsMouse5.press(MOUSE_LEFT); } + if(buttons.analogOutput) { Gamepad16.press(LightgunButtons::ButtonDesc[BtnIdx_Trigger].reportCode3); } + else { AbsMouse5.press(MOUSE_LEFT); } buttonPressed = true; // Set this so we won't spam a repeat press event again. } } @@ -3804,18 +3804,12 @@ void TriggerNotFireSimple() { if(buttonPressed) { // Just to make sure we aren't spamming mouse button events. if(offscreenBShot) { // if it was marked as an offscreen button shot, - if(buttons.analogOutput) { //Check if gamepad mode is enabled - Gamepad16.release(LightgunButtons::ButtonDesc[BtnIdx_A].reportCode3); //If gamepad mode is enabled release A Button - } else { - AbsMouse5.release(MOUSE_RIGHT); // Release the right mouse, - } + if(buttons.analogOutput) { Gamepad16.release(LightgunButtons::ButtonDesc[BtnIdx_A].reportCode3); } + else { AbsMouse5.release(MOUSE_RIGHT); } offscreenBShot = false; // And set it off. } else { // Else, - if(buttons.analogOutput) { //Check if gamepad mode is enabled - Gamepad16.release(LightgunButtons::ButtonDesc[BtnIdx_Trigger].reportCode3); // If gamepad mode is enabled release the Trigger button - } else { - AbsMouse5.release(MOUSE_LEFT); // It was a normal shot, so just release the left mouse button. - } + if(buttons.analogOutput) { Gamepad16.release(LightgunButtons::ButtonDesc[BtnIdx_Trigger].reportCode3); } + else { AbsMouse5.release(MOUSE_LEFT); } } buttonPressed = false; // Unset the button pressed bit. }