In order to have, say, on-demand QWERTY keyboard support, we need to be able to add input devices at any point - not just when ZPUI starts. InputListener isn't really capable of that yet, but it's the exact place where we would need to add support for it.
[x] Add input device hotplug to InputListener
[x] Add methods to list, add and remove devices at any moment
[x] Make sure that, if devices are spontaneously inaccessible, exceptions are handled properly (for now, with HID devices)
[x] Make sure that available_keys are regenerated after adding/removing a device
[ ] Add a mechanism to init and add input drivers dynamically from the UI - it's OK if the implementation involves a whitelist of drivers with hardcoded parameters, but a hotplug.py-per-driver (each driver can have a file you'd use for hotplug, with code having all the init logic and menus) is a better idea
[x] Make sure the HID device is un-grab-bed after removing the associated HID driver
[ ] Add hooks to UI elements (like NumpadCharInput) to add/remove devices, make sure that new available_keys are accounted for in some way
[x] Make sure that any devices in config.json can't be removed
In order to have, say, on-demand QWERTY keyboard support, we need to be able to add input devices at any point - not just when ZPUI starts.
InputListener
isn't really capable of that yet, but it's the exact place where we would need to add support for it.available_keys
are regenerated after adding/removing a devicegrab
-bed after removing the associated HID driveravailable_keys
are accounted for in some wayconfig.json
can't be removed