Restore the ability for add-ons to register custom touch modes in availableTouchModes (#20416)
Link to issue number:
Resolves #20114
Summary of the issue:
PR #19414 changed availableTouchModes from list[str] to list[TouchMode] and _curTouchMode to store TouchMode enum instances. This broke add-ons that previously appended plain strings to availableTouchModes to register custom touch modes (e.g., Enhanced Touch Gestures add-on).
Description of user facing changes:
For the user-facing side, there's no direct impact since this is really about restoring functionality for add-on developers.
Description of developer facing changes:
On the developer side, I'm making availableTouchModes accept both TouchMode enum members and strings, and updating setMode to handle both types as well, so add-ons can register custom modes the way they used to.
Description of development approach:
The fix involves updating the type annotations to allow TouchMode | str in the relevant places and adjusting the internal logic to handle both types properly.