feat: Use rotary encoder velocity only on specific components (#2356)
* feature: use rotary encoder velocity iff LV_OBJ_FLAG_ENCODER_ACCEL * chore: bump libopenui
This commit is contained in:
@@ -246,11 +246,21 @@ static void rotaryDriverRead(lv_indev_drv_t *drv, lv_indev_data_t *data)
|
||||
if (diff != 0) {
|
||||
reset_inactivity();
|
||||
|
||||
bool use_accel = false;
|
||||
auto i = lv_indev_get_act();
|
||||
if (i) {
|
||||
auto g = i->group;
|
||||
if (g && lv_group_get_editing(g)) {
|
||||
auto obj = lv_group_get_focused(g);
|
||||
use_accel = obj && lv_obj_has_flag(obj, LV_OBJ_FLAG_ENCODER_ACCEL);
|
||||
}
|
||||
}
|
||||
|
||||
int8_t dir = 0;
|
||||
if (diff < 0) dir = -1;
|
||||
else if (diff > 0) dir = 1;
|
||||
|
||||
if (dir == prevDir) {
|
||||
if (use_accel && (dir == prevDir)) {
|
||||
if (g_tmr10ms - lastEvent <= ROTENC_DELAY_HIGHSPEED) { // 160 ms
|
||||
// below ROTENC_DELAY_HIGHSPEED btw. events: accelerate
|
||||
accel += abs(diff);
|
||||
|
||||
Vendored
+1
-1
Submodule radio/src/thirdparty/libopenui updated: 88128a21d3...e3f6e2d12e
Reference in New Issue
Block a user