Send clipboard events for Ctrl/Shift-{Ins,Del} in rich edit too
The corresponding wxClipboardTextEvent was generated for Ctrl-{C,V,X}
key combinations, but not Shift-{Ins,Del} or Ctrl-Ins ones, which are
also handled by the native control by default.
This commit is contained in:
parent
2f6cb20d2c
commit
7a9e969dca
1 changed files with 29 additions and 13 deletions
|
|
@ -2154,21 +2154,37 @@ void wxTextCtrl::OnKeyDown(wxKeyEvent& event)
|
|||
// from working. So we work around it by intercepting these shortcuts
|
||||
// ourselves and emitting clipboard events (which richedit will handle,
|
||||
// so everything works as before, including pasting of rich text):
|
||||
if ( event.GetModifiers() == wxMOD_CONTROL && IsRich() )
|
||||
if ( IsRich() )
|
||||
{
|
||||
switch ( event.GetKeyCode() )
|
||||
if ( event.GetModifiers() == wxMOD_CONTROL )
|
||||
{
|
||||
case 'C':
|
||||
Copy();
|
||||
return;
|
||||
case 'X':
|
||||
Cut();
|
||||
return;
|
||||
case 'V':
|
||||
Paste();
|
||||
return;
|
||||
default:
|
||||
break;
|
||||
switch ( event.GetKeyCode() )
|
||||
{
|
||||
case 'C':
|
||||
case WXK_INSERT:
|
||||
Copy();
|
||||
return;
|
||||
case 'X':
|
||||
Cut();
|
||||
return;
|
||||
case 'V':
|
||||
Paste();
|
||||
return;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if ( event.GetModifiers() == wxMOD_SHIFT )
|
||||
{
|
||||
switch ( event.GetKeyCode() )
|
||||
{
|
||||
case WXK_INSERT:
|
||||
Paste();
|
||||
return;
|
||||
case WXK_DELETE:
|
||||
Cut();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue