spine-editor icon indicating copy to clipboard operation
spine-editor copied to clipboard

Ctrl/cmd prevents to properly switch tool in edit mesh mode

Open davidetan opened this issue 6 months ago • 3 comments

A user reported on the forum that when setting hotkeys cmd + 1 and cmd + 2 to activate Edit Mesh - Modify and Edit Mesh - Create respectively, a strange behaviour occurs as if the UI updated the tool, but the application state holds the previous tool.

I was able to track down the problem to the keyUp method method of MeshEditMode where lastTool is restored when ctrl/cmd is released. This is because while ctrl/cmd is pressed in MeshEditMode, a different tool is activated, and the previous one has to be restored upon ctrl/cmd release.

The issue is of the same nature as https://github.com/EsotericSoftware/spine-editor/issues/803#issuecomment-2219846313, but in another piece of code.

Should we consider and mark ctrl/cmd not usable for certain hotkeys, or should we find a way to fix the code so that those keys are usable as hotkeys? If we choose the former, we should probably add a validation for those hotkeys that cannot use ctrl/cmd so that when the users reload the hotkeys, a dialog lists the names of the actions associated to the invalid hotkeys.

davidetan avatar Aug 01 '24 09:08 davidetan