mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-02 13:01:18 +12:00
UI: Disable Ctrl+Q shortcut on non-macOS platforms to prevent accidental exits during gameplay (#1565)
This commit is contained in:
parent
996539fce8
commit
bed5fdb195
1 changed files with 17 additions and 9 deletions
|
@ -1448,15 +1448,23 @@ void MainWindow::OnKeyUp(wxKeyEvent& event)
|
||||||
|
|
||||||
void MainWindow::OnKeyDown(wxKeyEvent& event)
|
void MainWindow::OnKeyDown(wxKeyEvent& event)
|
||||||
{
|
{
|
||||||
if ((event.AltDown() && event.GetKeyCode() == WXK_F4) ||
|
#if defined(__APPLE__)
|
||||||
(event.CmdDown() && event.GetKeyCode() == 'Q'))
|
// On macOS, allow Cmd+Q to quit the application
|
||||||
{
|
if (event.CmdDown() && event.GetKeyCode() == 'Q')
|
||||||
Close(true);
|
{
|
||||||
}
|
Close(true);
|
||||||
else
|
}
|
||||||
{
|
#else
|
||||||
event.Skip();
|
// On Windows/Linux, only Alt+F4 is allowed for quitting
|
||||||
}
|
if (event.AltDown() && event.GetKeyCode() == WXK_F4)
|
||||||
|
{
|
||||||
|
Close(true);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
else
|
||||||
|
{
|
||||||
|
event.Skip();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::OnChar(wxKeyEvent& event)
|
void MainWindow::OnChar(wxKeyEvent& event)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue