@Maelstorm said:
I've never liked this, either. Hit ctrl+1 will also bring the patch back to Edit Mode.
This just looks like a bug in the textarea implementation, that fails to destroy the Ctrl-a event after receiving it (regardless of whether the textarea does anything with it). Or at least a bug in the enclosing window that fails to identify the target of the keypress event as the textarea, and then do nothing. Probably both bugs, while the textarea should destroy the event instead of bubbling it up the GUI container hierarchy and the containing window should ignore the event (or just continue bubbling it) because the event was targeting the textarea.
Generally in GUI design, and specifically in Tcl/Tk design, if the textarea widget doesn't consume Ctrl-a key events for some functionality, the widget will just destroy that event rather than bubble it up, if the cursor focus is in the textarea. It is highly unconventional for the textarea to ignore the event and bubble it up to its container.
Semantically, you are telling the textarea where you have an active cursor to "select all" or whatever Ctrl-a means. If it doesn't do that, it should do nothing. You are not indicating its enclosing scope as the message target when you press Ctrl-a, so you are not telling the enclosing scope anything. Only when the enclosing scope is where the action is performed that is requested of the enclosed scope would the enclosed scope bubble the event to the enclosing scope. Such as when both enclosed and enclosing scope must act, to keep their states consistent with each other, or for the enclosing scope to pass the message (that the textarea received the Ctrl-a) to other enclosed scopes, so they can maintain their own states' consistency with the originally targeted textarea. That is why the key event contains the original target object, the textarea, even in any case where that event is passed around the event hierarchy.