mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-31 15:10:40 +00:00
Adding support for Chatter keypad (#4022)
* Adding support for Chatter keypad * Remove user button mapping since full keypad is now useable * Adding TAB key and RIGHT to allow selecting a destination * Fix shift bug (there's only three levels, not four) * reformat file * Fix bug with fast repeated keypresses --------- Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
25
src/input/SerialKeyboard.h
Normal file
25
src/input/SerialKeyboard.h
Normal file
@@ -0,0 +1,25 @@
|
||||
#pragma once
|
||||
|
||||
#include "InputBroker.h"
|
||||
#include "concurrency/OSThread.h"
|
||||
|
||||
class SerialKeyboard : public Observable<const InputEvent *>, public concurrency::OSThread
|
||||
{
|
||||
public:
|
||||
explicit SerialKeyboard(const char *name);
|
||||
|
||||
protected:
|
||||
virtual int32_t runOnce() override;
|
||||
void erase();
|
||||
|
||||
private:
|
||||
const char *_originName;
|
||||
bool firstTime = 1;
|
||||
int prevKeys = 0;
|
||||
int keys = 0;
|
||||
int shift = 0;
|
||||
int keyPressed = 13;
|
||||
int lastKeyPressed = 13;
|
||||
int quickPress = 0;
|
||||
unsigned long lastPressTime = 0;
|
||||
};
|
||||
Reference in New Issue
Block a user