mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-07 14:12:31 -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
|
@ -92,6 +92,28 @@ void FreqManUIList::on_blur() {
|
|||
set_dirty();
|
||||
}
|
||||
|
||||
bool FreqManUIList::on_keyboard(const KeyboardEvent key) {
|
||||
if (!db_ || db_->empty())
|
||||
return false;
|
||||
|
||||
auto delta = 0;
|
||||
if (key == '-' && get_index() > 0) delta = -1;
|
||||
if (key == '+' && get_index() < db_->entry_count() - 1) delta = 1;
|
||||
if (delta != 0) {
|
||||
adjust_selected_index(delta);
|
||||
set_dirty();
|
||||
return true;
|
||||
}
|
||||
if (key == 10) {
|
||||
if (on_select) {
|
||||
on_select(get_index());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool FreqManUIList::on_key(const KeyEvent key) {
|
||||
if (!db_ || db_->empty())
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue