mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-07-26 08:16:02 -04:00
Show on_encoder delta in Buttons Test app (#1903)
This commit is contained in:
parent
b5ac792853
commit
24605777a6
2 changed files with 12 additions and 1 deletions
|
@ -323,6 +323,11 @@ bool ControlsSwitchesWidget::on_key(const KeyEvent key) {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool ControlsSwitchesWidget::on_encoder(const EncoderEvent delta) {
|
||||
last_delta = delta;
|
||||
return true;
|
||||
}
|
||||
|
||||
void ControlsSwitchesWidget::paint(Painter& painter) {
|
||||
const auto pos = screen_pos();
|
||||
|
||||
|
@ -405,6 +410,8 @@ void ControlsSwitchesWidget::paint(Painter& painter) {
|
|||
|
||||
switches_event >>= 1;
|
||||
}
|
||||
|
||||
painter.draw_string({5 * 8, 12 * 16}, Styles::light_grey, to_string_dec_int(last_delta, 3));
|
||||
}
|
||||
|
||||
void ControlsSwitchesWidget::on_frame_sync() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue