diff --git a/docs/overview/object.md b/docs/overview/object.md index e34337d6a..d5850c02f 100644 --- a/docs/overview/object.md +++ b/docs/overview/object.md @@ -171,6 +171,7 @@ A new screen can be loaded with animation by using `lv_scr_load_anim(scr, transi Setting `auto_del` to `true` will automatically delete the old screen when the animation is finished. The new screen will become active (returned by `lv_scr_act()`) when the animation starts after `delay` time. +All inputs are disabled during the screen animation. ### Handling multiple displays Screens are created on the currently selected *default display*. diff --git a/src/core/lv_indev.c b/src/core/lv_indev.c index 58e9d85db..6932e172b 100644 --- a/src/core/lv_indev.c +++ b/src/core/lv_indev.c @@ -122,9 +122,18 @@ void lv_indev_read_timer_cb(lv_timer_t * timer) void lv_indev_enable(lv_indev_t * indev, bool en) { - if(!indev) return; + uint8_t enable = en ? 0 : 1; - indev->proc.disabled = en ? 0 : 1; + if(indev) { + indev->proc.disabled = enable; + } + else { + lv_indev_t * i = lv_indev_get_next(NULL); + while(i) { + indev->proc.disabled = enable; + i = lv_indev_get_next(i); + } + } } lv_indev_t * lv_indev_get_act(void) diff --git a/src/core/lv_indev.h b/src/core/lv_indev.h index 5d0158766..a98df86ef 100644 --- a/src/core/lv_indev.h +++ b/src/core/lv_indev.h @@ -36,8 +36,8 @@ extern "C" { void lv_indev_read_timer_cb(lv_timer_t * timer); /** - * Enable or disable an input device (default enabled) - * @param indev pointer to an input device + * Enable or disable one or all input devices (default enabled) + * @param indev pointer to an input device or NULL to enable/disable all of them * @param en true to enable, false to disable */ void lv_indev_enable(lv_indev_t * indev, bool en);