How to switch input indev

I only have three HW keys
sometimes I want to use “BUTTON”, but sometimes I neet to use “KEYPAD”
how can i change the input indev??

I have tried
lv_indev_enable(lv_indev_t * indev, bool en)
but when i switch back, it will trigger clicked