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:
@@ -2154,21 +2154,37 @@ void wxTextCtrl::OnKeyDown(wxKeyEvent& event)
|
|||||||
// from working. So we work around it by intercepting these shortcuts
|
// from working. So we work around it by intercepting these shortcuts
|
||||||
// ourselves and emitting clipboard events (which richedit will handle,
|
// ourselves and emitting clipboard events (which richedit will handle,
|
||||||
// so everything works as before, including pasting of rich text):
|
// 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':
|
switch ( event.GetKeyCode() )
|
||||||
Copy();
|
{
|
||||||
return;
|
case 'C':
|
||||||
case 'X':
|
case WXK_INSERT:
|
||||||
Cut();
|
Copy();
|
||||||
return;
|
return;
|
||||||
case 'V':
|
case 'X':
|
||||||
Paste();
|
Cut();
|
||||||
return;
|
return;
|
||||||
default:
|
case 'V':
|
||||||
break;
|
Paste();
|
||||||
|
return;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ( event.GetModifiers() == wxMOD_SHIFT )
|
||||||
|
{
|
||||||
|
switch ( event.GetKeyCode() )
|
||||||
|
{
|
||||||
|
case WXK_INSERT:
|
||||||
|
Paste();
|
||||||
|
return;
|
||||||
|
case WXK_DELETE:
|
||||||
|
Cut();
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user