Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I'm bad at syncing branches #31

Merged
merged 5 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/arduino-cli-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 7 additions & 13 deletions SamcoEnhanced/SamcoEnhanced.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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.
}
}
Expand All @@ -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.
}
Expand Down