trackball center = button

This commit is contained in:
richonguzman 2024-10-29 12:45:34 -03:00
parent 4121ae2b9d
commit 87967c8a66
2 changed files with 2 additions and 3 deletions

View File

@ -158,6 +158,7 @@
#define RADIO_DIO1_PIN 45
#define RADIO_BUSY_PIN 13
#define TrackBallCenter 0
#define BUTTON_PIN TrackBallCenter
#define TrackBallUp 3 // G S1
#define TrackBallDown 15 // G S3
#define TrackBallLeft 1 // G S4

View File

@ -725,9 +725,7 @@ namespace KEYBOARD_Utils {
int ballLeft = digitalRead(TrackBallLeft);
int ballRight = digitalRead(TrackBallRight);
if (!digitalRead(TrackBallCenter)) {
processPressedKey(13);
} else if (ballUp != mouseUpState && ballDown == mouseDownState && ballLeft == mouseLeftState && ballRight == mouseRightState) {
if (ballUp != mouseUpState && ballDown == mouseDownState && ballLeft == mouseLeftState && ballRight == mouseRightState) {
if (millis() - lastDebounceTime > debounceInterval) {
lastDebounceTime = millis();
mouseUpState = ballUp;