Handle standard Cmd-{Y,Z} key combinations in Mac wxTextCtrl
Use them to undo and redo, as expected.
This commit is contained in:
@@ -342,7 +342,7 @@ void wxTextCtrl::OnDropFiles(wxDropFilesEvent& event)
|
||||
|
||||
void wxTextCtrl::OnKeyDown(wxKeyEvent& event)
|
||||
{
|
||||
if ( event.GetModifiers() == wxMOD_CONTROL )
|
||||
if ( event.ControlDown() )
|
||||
{
|
||||
switch( event.GetKeyCode() )
|
||||
{
|
||||
@@ -361,6 +361,18 @@ void wxTextCtrl::OnKeyDown(wxKeyEvent& event)
|
||||
if ( CanCut() )
|
||||
Cut() ;
|
||||
return;
|
||||
case 'Z':
|
||||
if ( !event.ShiftDown() )
|
||||
{
|
||||
if ( CanUndo() )
|
||||
Undo() ;
|
||||
return;
|
||||
}
|
||||
// else fall through to Redo
|
||||
case 'Y':
|
||||
if ( CanRedo() )
|
||||
Redo() ;
|
||||
return;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user