Only reserve hotkeys for focused textCtrls that are editabled.
Otherwise just send Ctrl-C to the disabled control, and everything else to the tool framework. Fixes https://gitlab.com/kicad/code/kicad/issues/4801
This commit is contained in:
@@ -26,31 +26,18 @@
|
||||
#include <textentry_tricks.h>
|
||||
#include <dialog_shim.h>
|
||||
|
||||
bool TEXTENTRY_TRICKS::isCtrl( int aChar, const wxKeyEvent& e )
|
||||
{
|
||||
return e.GetKeyCode() == aChar && e.ControlDown() && !e.AltDown() &&
|
||||
!e.ShiftDown() && !e.MetaDown();
|
||||
}
|
||||
|
||||
|
||||
bool TEXTENTRY_TRICKS::isShiftCtrl( int aChar, const wxKeyEvent& e )
|
||||
{
|
||||
return e.GetKeyCode() == aChar && e.ControlDown() && !e.AltDown() &&
|
||||
e.ShiftDown() && !e.MetaDown();
|
||||
}
|
||||
|
||||
|
||||
void TEXTENTRY_TRICKS::OnCharHook( wxTextEntry* aTextEntry, wxKeyEvent& aEvent )
|
||||
{
|
||||
if( isCtrl( 'X', aEvent ) )
|
||||
if( aEvent.GetModifiers() == wxMOD_CONTROL && aEvent.GetKeyCode() == 'X' )
|
||||
{
|
||||
aTextEntry->Cut();
|
||||
}
|
||||
else if( isCtrl( 'C', aEvent ) )
|
||||
else if( aEvent.GetModifiers() == wxMOD_CONTROL && aEvent.GetKeyCode() == 'C' )
|
||||
{
|
||||
aTextEntry->Copy();
|
||||
}
|
||||
else if( isCtrl( 'V', aEvent ) )
|
||||
else if( aEvent.GetModifiers() == wxMOD_CONTROL && aEvent.GetKeyCode() == 'V' )
|
||||
{
|
||||
aTextEntry->Paste();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user