@@ -1959,8 +1959,19 @@ static int on_libinput_ready(sd_event_source *s, int fd, uint32_t revents, void
1959
1959
};
1960
1960
}
1961
1961
} else if (libinput_device_has_capability (device , LIBINPUT_DEVICE_CAP_KEYBOARD )) {
1962
- data -> keyboard_state = keyboard_state_new (flutterpi .input .keyboard_config , NULL , NULL );
1962
+ if (flutterpi .input .disable_text_input == false) {
1963
+ data -> keyboard_state = keyboard_state_new (flutterpi .input .keyboard_config , NULL , NULL );
1964
+ }
1965
+ }
1966
+ } else if (type == LIBINPUT_EVENT_DEVICE_REMOVED ) {
1967
+ device = libinput_event_get_device (event );
1968
+ data = libinput_device_get_user_data (device );
1969
+
1970
+ if (data -> keyboard_state ) {
1971
+ free (data -> keyboard_state );
1963
1972
}
1973
+ free (data );
1974
+ libinput_device_set_user_data (device , NULL );
1964
1975
} else if (LIBINPUT_EVENT_IS_TOUCH (type )) {
1965
1976
touch_event = libinput_event_get_touch_event (event );
1966
1977
data = libinput_device_get_user_data (libinput_event_get_device (event ));
@@ -2150,7 +2161,7 @@ static int on_libinput_ready(sd_event_source *s, int fd, uint32_t revents, void
2150
2161
} else if (type == LIBINPUT_EVENT_POINTER_AXIS ) {
2151
2162
2152
2163
}
2153
- } else if (LIBINPUT_EVENT_IS_KEYBOARD (type )) {
2164
+ } else if (LIBINPUT_EVENT_IS_KEYBOARD (type ) && ! flutterpi . input . disable_text_input ) {
2154
2165
struct keyboard_modifier_state mods ;
2155
2166
enum libinput_key_state key_state ;
2156
2167
xkb_keysym_t keysym ;
0 commit comments