remove bad hardcoded keybinds #298 #334

Remove esc to quit key bind #298.

Remove ctrl+x (cmd+x on mac) to quit key bind #334.

Remove FilterEvent app method, it is no longer being used anyway as key binds
work correctly.
This commit is contained in:
Rafael Kitover 2019-01-05 12:32:10 -08:00
parent 6462ce59b5
commit f6ad9a8ca7
3 changed files with 28 additions and 23 deletions

View File

@ -45,8 +45,13 @@ const wxAcceleratorEntry default_accels[] = {
// maybe make alt-f4 universal as well...
// FIXME: ctrl-Q does not work on wxMSW
// FIXME: esc does not work on wxMSW
wxAcceleratorEntry(wxMOD_NONE, WXK_ESCAPE, wxID_EXIT),
wxAcceleratorEntry(wxMOD_CMD, wxT('X'), wxID_EXIT),
// this was annoying people A LOT #334
//wxAcceleratorEntry(wxMOD_NONE, WXK_ESCAPE, wxID_EXIT),
// this was annoying people #298
//wxAcceleratorEntry(wxMOD_CMD, wxT('X'), wxID_EXIT),
wxAcceleratorEntry(wxMOD_CMD, wxT('Q'), wxID_EXIT),
// FIXME: ctrl-W does not work on wxMSW
wxAcceleratorEntry(wxMOD_CMD, wxT('W'), wxID_CLOSE),

View File

@ -1048,23 +1048,23 @@ void MainFrame::IdentifyRom()
// ctrl-w does not work for close). It's possible another entity is
// grabbing those keys, but I can't track it down.
// FIXME: move this to MainFrame
int wxvbamApp::FilterEvent(wxEvent& event)
{
//if(frame && frame->IsPaused(true))
return -1;
if (event.GetEventType() == wxEVT_KEY_DOWN) {
wxKeyEvent& ke = (wxKeyEvent&)event;
for (int i = 0; i < accels.size(); i++) {
if (accels[i].GetKeyCode() == ke.GetKeyCode() && accels[i].GetFlags() == ke.GetModifiers()) {
wxCommandEvent ev(wxEVT_COMMAND_MENU_SELECTED, accels[i].GetCommand());
ev.SetEventObject(this);
frame->GetEventHandler()->ProcessEvent(ev);
return 1;
}
}
}
return -1;
}
//int wxvbamApp::FilterEvent(wxEvent& event)
//{
// //if(frame && frame->IsPaused(true))
// return -1;
//
// if (event.GetEventType() == wxEVT_KEY_DOWN) {
// wxKeyEvent& ke = (wxKeyEvent&)event;
//
// for (int i = 0; i < accels.size(); i++) {
// if (accels[i].GetKeyCode() == ke.GetKeyCode() && accels[i].GetFlags() == ke.GetModifiers()) {
// wxCommandEvent ev(wxEVT_COMMAND_MENU_SELECTED, accels[i].GetCommand());
// ev.SetEventObject(this);
// frame->GetEventHandler()->ProcessEvent(ev);
// return 1;
// }
// }
// }
//
// return -1;
//}

View File

@ -102,7 +102,7 @@ public:
};
#endif
// without this, global accels don't always work
int FilterEvent(wxEvent& event);
//int FilterEvent(wxEvent& event);
wxAcceleratorEntry_v accels;
// the main configuration