Skip to content

Commit

Permalink
fix: prevent emit rotary encoder keystroke when output is locked
Browse files Browse the repository at this point in the history
  • Loading branch information
DriftKingTW committed Dec 9, 2023
1 parent 902822b commit 043a20e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -580,21 +580,21 @@ void encoderTask(void *pvParameters) {

if (direction.equals("CCW")) {
resetIdle();
if (isUsbMode) {
if (isUsbMode && !isOutputLocked) {
usbKeyboard.release(onboardRotaryEncoders[0].rotaryCCW);
usbKeyboard.write(onboardRotaryEncoders[0].rotaryCCW);
} else {
} else if (!isOutputLocked) {
bleKeyboard.release(onboardRotaryEncoders[0].rotaryCCW);
bleKeyboard.write(onboardRotaryEncoders[0].rotaryCCW);
}
updateKeyInfo = true;
currentKeyInfo = onboardRotaryEncoders[0].rotaryCCWInfo;
} else if (direction.equals("CW")) {
resetIdle();
if (isUsbMode) {
if (isUsbMode && !isOutputLocked) {
usbKeyboard.release(onboardRotaryEncoders[0].rotaryCW);
usbKeyboard.write(onboardRotaryEncoders[0].rotaryCW);
} else {
} else if (!isOutputLocked) {
bleKeyboard.release(onboardRotaryEncoders[0].rotaryCW);
bleKeyboard.write(onboardRotaryEncoders[0].rotaryCW);
}
Expand Down Expand Up @@ -652,21 +652,21 @@ void encoderExtBoardTask(void *pvParameters) {
if (trigger) {
resetIdle();
if (direction.equals("CW")) {
if (isUsbMode) {
if (isUsbMode && !isOutputLocked) {
usbKeyboard.write(
rotaryExtRotaryEncoders[0].rotaryCW);
} else {
} else if (!isOutputLocked) {
bleKeyboard.write(
rotaryExtRotaryEncoders[0].rotaryCW);
}
updateKeyInfo = true;
currentKeyInfo =
rotaryExtRotaryEncoders[0].rotaryCWInfo;
} else if (direction.equals("CCW")) {
if (isUsbMode) {
if (isUsbMode && !isOutputLocked) {
usbKeyboard.write(
rotaryExtRotaryEncoders[0].rotaryCCW);
} else {
} else if (!isOutputLocked) {
bleKeyboard.write(
rotaryExtRotaryEncoders[0].rotaryCCW);
}
Expand Down

0 comments on commit 043a20e

Please sign in to comment.