Fix init for InputEvent (#8015)

This commit is contained in:
Markus 2025-09-18 13:32:56 +02:00 committed by Ben Meadors
parent 188283b382
commit 2567c03a3f
10 changed files with 15 additions and 15 deletions

View File

@ -188,7 +188,7 @@ void ExpressLRSFiveWay::determineAction(KeyType key, PressLength length)
// Feed input to the canned messages module
void ExpressLRSFiveWay::sendKey(input_broker_event key)
{
InputEvent e;
InputEvent e = {};
e.source = inputSourceName;
e.inputEvent = key;
notifyObservers(&e);

View File

@ -73,7 +73,7 @@ int32_t LinuxInput::runOnce()
int rd = read(events[i].data.fd, ev, sizeof(ev));
assert(rd > ((signed int)sizeof(struct input_event)));
for (int j = 0; j < rd / ((signed int)sizeof(struct input_event)); j++) {
InputEvent e;
InputEvent e = {};
e.inputEvent = INPUT_BROKER_NONE;
e.source = this->_originName;
e.kbchar = 0;

View File

@ -43,7 +43,7 @@ void RotaryEncoderInterruptBase::init(
int32_t RotaryEncoderInterruptBase::runOnce()
{
InputEvent e;
InputEvent e = {};
e.inputEvent = INPUT_BROKER_NONE;
e.source = this->_originName;

View File

@ -49,7 +49,7 @@ bool SeesawRotary::init()
int32_t SeesawRotary::runOnce()
{
InputEvent e;
InputEvent e = {};
e.inputEvent = INPUT_BROKER_NONE;
bool currentlyPressed = !ss.digitalRead(SS_SWITCH);

View File

@ -29,7 +29,7 @@ SerialKeyboard::SerialKeyboard(const char *name) : concurrency::OSThread(name)
void SerialKeyboard::erase()
{
InputEvent e;
InputEvent e = {};
e.inputEvent = INPUT_BROKER_BACK;
e.kbchar = 0x08;
e.source = this->_originName;
@ -80,7 +80,7 @@ int32_t SerialKeyboard::runOnce()
if (keys < prevKeys) { // a new key has been pressed (and not released), doesn't works for multiple presses at once but
// shouldn't be a limitation
InputEvent e;
InputEvent e = {};
e.inputEvent = INPUT_BROKER_NONE;
e.source = this->_originName;
// SELECT OR SEND OR CANCEL EVENT

View File

@ -47,7 +47,7 @@ bool TouchScreenImpl1::getTouch(int16_t &x, int16_t &y)
*/
void TouchScreenImpl1::onEvent(const TouchEvent &event)
{
InputEvent e;
InputEvent e = {};
e.source = event.source;
e.kbchar = 0;
e.touchX = event.x;

View File

@ -48,7 +48,7 @@ void TrackballInterruptBase::init(uint8_t pinDown, uint8_t pinUp, uint8_t pinLef
int32_t TrackballInterruptBase::runOnce()
{
InputEvent e;
InputEvent e = {};
e.inputEvent = INPUT_BROKER_NONE;
#if defined(T_DECK) // T-deck gets a super-simple debounce on trackball
if (this->action == TB_ACTION_PRESSED) {

View File

@ -40,7 +40,7 @@ void UpDownInterruptBase::init(uint8_t pinDown, uint8_t pinUp, uint8_t pinPress,
int32_t UpDownInterruptBase::runOnce()
{
InputEvent e;
InputEvent e = {};
e.inputEvent = INPUT_BROKER_NONE;
unsigned long now = millis();
if (this->action == UPDOWN_ACTION_PRESSED) {

View File

@ -90,7 +90,7 @@ int32_t KbI2cBase::runOnce()
while (keyCount--) {
const BBQ10Keyboard::KeyEvent key = Q10keyboard.keyEvent();
if ((key.key != 0x00) && (key.state == BBQ10Keyboard::StateRelease)) {
InputEvent e;
InputEvent e = {};
e.inputEvent = INPUT_BROKER_NONE;
e.source = this->_originName;
switch (key.key) {
@ -187,7 +187,7 @@ int32_t KbI2cBase::runOnce()
}
case 0x37: { // MPR121
MPRkeyboard.trigger();
InputEvent e;
InputEvent e = {};
while (MPRkeyboard.hasEvent()) {
char nextEvent = MPRkeyboard.dequeueEvent();
@ -250,7 +250,7 @@ int32_t KbI2cBase::runOnce()
}
case 0x84: { // Adafruit TCA8418
TCAKeyboard.trigger();
InputEvent e;
InputEvent e = {};
while (TCAKeyboard.hasEvent()) {
char nextEvent = TCAKeyboard.dequeueEvent();
e.inputEvent = INPUT_BROKER_ANYKEY;
@ -350,7 +350,7 @@ int32_t KbI2cBase::runOnce()
}
if (PrintDataBuf != 0) {
LOG_DEBUG("RAK14004 key 0x%x pressed", PrintDataBuf);
InputEvent e;
InputEvent e = {};
e.inputEvent = INPUT_BROKER_MATRIXKEY;
e.source = this->_originName;
e.kbchar = PrintDataBuf;
@ -365,7 +365,7 @@ int32_t KbI2cBase::runOnce()
if (i2cBus->available()) {
char c = i2cBus->read();
InputEvent e;
InputEvent e = {};
e.inputEvent = INPUT_BROKER_NONE;
e.source = this->_originName;
switch (c) {

View File

@ -72,7 +72,7 @@ int32_t KbMatrixBase::runOnce()
if (key != 0) {
LOG_DEBUG("Key 0x%x pressed", key);
// reset shift now that we have a keypress
InputEvent e;
InputEvent e = {};
e.inputEvent = INPUT_BROKER_NONE;
e.source = this->_originName;
switch (key) {