mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
Implemented switching A and B buttons, closing #2034
getButtonState() now have an option int/bool argument to swap the result via XOR
This commit is contained in:
@@ -44,7 +44,7 @@ OperatingMode handle_post_init_state();
|
||||
OperatingMode guiHandleDraw(void) {
|
||||
OLED::clearScreen(); // Clear ready for render pass
|
||||
// Read button state
|
||||
ButtonState buttons = getButtonState();
|
||||
ButtonState buttons = getButtonState(getSettingValue(SettingsOptions::ReverseButtonNavEnabled));
|
||||
// Enforce screen on if buttons pressed, movement, hot tip etc
|
||||
if (buttons != BUTTON_NONE) {
|
||||
OLED::setDisplayState(OLED::DisplayState::ON);
|
||||
|
||||
@@ -55,7 +55,7 @@ OperatingMode gui_solderingTempAdjust(const ButtonState buttonIn, guiContext *cx
|
||||
(*autoRepeatAcceleration) = PRESS_ACCEL_INTERVAL_MAX - PRESS_ACCEL_INTERVAL_MIN;
|
||||
}
|
||||
// If buttons are flipped; flip the delta
|
||||
if (getSettingValue(SettingsOptions::ReverseButtonTempChangeEnabled)) {
|
||||
if (getSettingValue(SettingsOptions::ReverseButtonTempChangeEnabled) xor getSettingValue(SettingsOptions::ReverseButtonNavEnabled)) {
|
||||
delta = -delta;
|
||||
}
|
||||
if (delta != 0) {
|
||||
|
||||
@@ -17,7 +17,7 @@ bool shouldShutdown(void) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (getButtonState() == BUTTON_B_LONG) { // allow also if back button is pressed long
|
||||
if (getButtonState(getSettingValue(SettingsOptions::ReverseButtonNavEnabled)) == BUTTON_B_LONG) { // allow also if back button is pressed long
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user