mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-22 10:42:49 +00:00
Initial Chatter 2.0 fix for baseUI (#8615)
* Initial Chatter 2.0 fix for baseUI * trunk fix --------- Co-authored-by: Jason P <applewiz@mac.com>
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
#include "configuration.h"
|
||||
#include <Throttle.h>
|
||||
|
||||
SerialKeyboard *globalSerialKeyboard = nullptr;
|
||||
|
||||
#ifdef INPUTBROKER_SERIAL_TYPE
|
||||
#define CANNED_MESSAGE_MODULE_ENABLE 1 // in case it's not set in the variant file
|
||||
|
||||
@@ -25,6 +27,8 @@ unsigned char KeyMap[3][4][10] = {{{'.', 'a', 'd', 'g', 'j', 'm', 'p', 't', 'w',
|
||||
SerialKeyboard::SerialKeyboard(const char *name) : concurrency::OSThread(name)
|
||||
{
|
||||
this->_originName = name;
|
||||
|
||||
globalSerialKeyboard = this;
|
||||
}
|
||||
|
||||
void SerialKeyboard::erase()
|
||||
@@ -85,9 +89,21 @@ int32_t SerialKeyboard::runOnce()
|
||||
e.source = this->_originName;
|
||||
// SELECT OR SEND OR CANCEL EVENT
|
||||
if (!(shiftRegister2 & (1 << 3))) {
|
||||
e.inputEvent = INPUT_BROKER_UP;
|
||||
if (shift > 0) {
|
||||
e.inputEvent = INPUT_BROKER_ANYKEY; // REQUIRED
|
||||
e.kbchar = 0x09; // TAB
|
||||
shift = 0; // reset shift after TAB
|
||||
} else {
|
||||
e.inputEvent = INPUT_BROKER_LEFT;
|
||||
}
|
||||
} else if (!(shiftRegister2 & (1 << 2))) {
|
||||
e.inputEvent = INPUT_BROKER_RIGHT;
|
||||
if (shift > 0) {
|
||||
e.inputEvent = INPUT_BROKER_ANYKEY; // REQUIRED
|
||||
e.kbchar = 0x09; // TAB
|
||||
shift = 0; // reset shift after TAB
|
||||
} else {
|
||||
e.inputEvent = INPUT_BROKER_RIGHT;
|
||||
}
|
||||
e.kbchar = 0;
|
||||
} else if (!(shiftRegister2 & (1 << 1))) {
|
||||
e.inputEvent = INPUT_BROKER_SELECT;
|
||||
|
||||
Reference in New Issue
Block a user