Undo/Redo in dialogs

 From:  Michael Gibson
7286.3 In reply to 7286.1 
Hi Strube - it's built into MoI's keyboard input processing that when it sees that an edit control has focus, it makes Ctrl+C, Ctrl+V, Ctrl+X and Ctrl+A execute text editing functions in that edit control rather than processing them as regular MoI command shortcuts.

But right now that does not include Ctrl+Y and Ctrl+Z mostly because MoI does not have any multi-line textarea input in any of its regular UI currently, so it just had not come up before. For v4 I could modify this to additionally look if the edit control is a multi-line control or maybe if it's marked with a particular attribute and then also have those keys handled in a similar way.

For now the only way that I can see is to have an event loop like Max shows above where you could register a command specific shortcut key and have it handled by the script itself since it will generate a UI event once it is registered. Then you could call document.execCommand( 'undo' ); to make the text edit do an undo. This may be difficult to use well though since you have to be in a modal type of event loop to do it, you won't be able to do it in a modeless dialog.

- Michael