mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-07-26 16:26:06 -04:00
Send ASCII chars from USB serial to selected widget (#1708)
* Initial commit for keyboard emulation * Added on_keyboard to some widgets * TextEdit partly * Multi key send at once * Frequency control support * Fix encoder emulation * Add keyboard to geomap * More widgets
This commit is contained in:
parent
1b5125b0a8
commit
8761b9d7e0
15 changed files with 232 additions and 5 deletions
|
@ -171,12 +171,13 @@ static bool encoder_update(const uint8_t raw) {
|
|||
}
|
||||
|
||||
static bool encoder_read() {
|
||||
const auto delta = encoder.update(
|
||||
encoder_debounce[0].state() | (injected_encoder == 1),
|
||||
encoder_debounce[1].state() | (injected_encoder == 2));
|
||||
auto delta = encoder.update(encoder_debounce[0].state(), encoder_debounce[1].state());
|
||||
|
||||
if (injected_encoder > 0)
|
||||
if (injected_encoder > 0) {
|
||||
if (injected_encoder == 1) delta = -1;
|
||||
if (injected_encoder == 2) delta = 1;
|
||||
injected_encoder = 0;
|
||||
}
|
||||
|
||||
if (delta != 0) {
|
||||
encoder_position += delta;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue