i have encountered few obstacles:
1. when switching to control mode, keystrokes need to not alter the edited text. i have workaround lack of support in such feature by using showInputPanel to open an input panel, so all keystrokes are sent to it rather than the edited text.
2. i found that i need a callback from sublime each time a keybind is triggered
* to be able to exit the control mode before the keybinded-action takes place (else, the user is still with my special keybinding, which is not good).
* to be able to exit or clear the control mode after the keybinded-action already finished.
* to be able to print the key stokes of the user, including the actual keys used to trigger the action
not related to this special mode, i have thought of the following:
* it could also be nice if sublime could export the keybindings it knows, so i can get this list with a function.
* it would be nice if sublime would show key strokes sequence which match a keybinding, as i type them, for example on the status bar. so if i bind x,1,2 i will see as i press:
- Code: Select all
x -see-on-status-bar-> x
x1 -see-on-status-bar-> x,1
x12 x -see-on-status-bar-> x,1,2 and trigger keybinded action
or
- Code: Select all
x -see-on-status-bar-> x
xy -see-on-status-bar-> <nothing to show>
i guess i can implement this feature if the above API (2) was exposed.