diff --git a/src/ButtonThread.cpp b/src/ButtonThread.cpp index 22212cdc8..6279a09cc 100644 --- a/src/ButtonThread.cpp +++ b/src/ButtonThread.cpp @@ -165,7 +165,8 @@ int32_t ButtonThread::runOnce() LOG_BUTTON("Mulitipress! %hux", multipressClickCount); switch (multipressClickCount) { #if HAS_GPS -#ifndef RAK14014 //The power supply of the GPS of RAK14014 cannot be turned off. Once turned off, the screen will not be used,They are the same power source +#ifndef RAK14014 // The power supply of the GPS of RAK14014 cannot be turned off. Once turned off, the screen will not be + // used,They are the same power source // 3 clicks: toggle GPS case 3: if (!config.device.disable_triple_click && (gps != nullptr)) { @@ -174,7 +175,7 @@ int32_t ButtonThread::runOnce() screen->forceDisplay(true); // Force a new UI frame, then force an EInk update } break; -#endif +#endif #endif #if defined(USE_EINK) && defined(PIN_EINK_EN) // i.e. T-Echo // 4 clicks: toggle backlight diff --git a/src/input/TouchScreenBase.cpp b/src/input/TouchScreenBase.cpp index c6ad9babc..a63203362 100644 --- a/src/input/TouchScreenBase.cpp +++ b/src/input/TouchScreenBase.cpp @@ -109,20 +109,18 @@ int32_t TouchScreenBase::runOnce() #if defined RAK14014 // Speed up the processing speed of the keyboard in virtual keyboard mode auto state = cannedMessageModule->getRunState(); - if ( state == CANNED_MESSAGE_RUN_STATE_FREETEXT ) { - if(_tapped) - { + if (state == CANNED_MESSAGE_RUN_STATE_FREETEXT) { + if (_tapped) { _tapped = false; e.touchEvent = static_cast(TOUCH_ACTION_TAP); LOG_DEBUG("action TAP(%d/%d)\n", _last_x, _last_y); - } - } else - { - if (_tapped && (time_t(millis()) - _start) > TIME_LONG_PRESS - 50) { + } + } else { + if (_tapped && (time_t(millis()) - _start) > TIME_LONG_PRESS - 50) { _tapped = false; e.touchEvent = static_cast(TOUCH_ACTION_TAP); LOG_DEBUG("action TAP(%d/%d)\n", _last_x, _last_y); - } + } } #else // fire TAP event when no 2nd tap occured within time @@ -131,7 +129,7 @@ int32_t TouchScreenBase::runOnce() e.touchEvent = static_cast(TOUCH_ACTION_TAP); LOG_DEBUG("action TAP(%d/%d)", _last_x, _last_y); } -#endif +#endif // fire LONG_PRESS event without the need for release if (touched && (time_t(millis()) - _start) > TIME_LONG_PRESS) { diff --git a/src/modules/CannedMessageModule.cpp b/src/modules/CannedMessageModule.cpp index 83f6b7fd6..37409b43b 100644 --- a/src/modules/CannedMessageModule.cpp +++ b/src/modules/CannedMessageModule.cpp @@ -325,9 +325,9 @@ int CannedMessageModule::handleInputEvent(const InputEvent *event) this->shift = !this->shift; } else if (keyTapped == "⌫") { - #ifndef RAK14014 +#ifndef RAK14014 this->highlight = keyTapped[0]; - #endif +#endif this->payload = 0x08; @@ -343,10 +343,10 @@ int CannedMessageModule::handleInputEvent(const InputEvent *event) validEvent = true; } else if (keyTapped == " ") { - #ifndef RAK14014 +#ifndef RAK14014 this->highlight = keyTapped[0]; - #endif - +#endif + this->payload = keyTapped[0]; validEvent = true; @@ -365,9 +365,9 @@ int CannedMessageModule::handleInputEvent(const InputEvent *event) this->shift = false; } else if (keyTapped != "") { - #ifndef RAK14014 +#ifndef RAK14014 this->highlight = keyTapped[0]; - #endif +#endif this->payload = this->shift ? keyTapped[0] : std::tolower(keyTapped[0]); @@ -836,9 +836,8 @@ void CannedMessageModule::drawKeyboard(OLEDDisplay *display, OLEDDisplayUiState Letter updatedLetter = {letter.character, letter.width, xOffset, yOffset, cellWidth, cellHeight}; -#ifdef RAK14014 //Optimize the touch range of the virtual keyboard in the bottom row - if(outerIndex == outerSize - 1) - { +#ifdef RAK14014 // Optimize the touch range of the virtual keyboard in the bottom row + if (outerIndex == outerSize - 1) { updatedLetter.rectHeight = 240 - yOffset; } #endif diff --git a/src/modules/CannedMessageModule.h b/src/modules/CannedMessageModule.h index 5d02daf57..4427be144 100644 --- a/src/modules/CannedMessageModule.h +++ b/src/modules/CannedMessageModule.h @@ -69,9 +69,7 @@ class CannedMessageModule : public SinglePortModule, public Observable