mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-24 14:49:53 -06:00
try to cover right-mod keys under MacOS I guess
This commit is contained in:
@ -226,7 +226,6 @@ bool HotkeyPressed(int id) { return HotkeyPress & (1<<id); }
|
|||||||
bool HotkeyReleased(int id) { return HotkeyRelease & (1<<id); }
|
bool HotkeyReleased(int id) { return HotkeyRelease & (1<<id); }
|
||||||
|
|
||||||
|
|
||||||
// TODO: MacOS version of this!
|
|
||||||
// distinguish between left and right modifier keys (Ctrl, Alt, Shift)
|
// distinguish between left and right modifier keys (Ctrl, Alt, Shift)
|
||||||
// Qt provides no real cross-platform way to do this, so here we go
|
// Qt provides no real cross-platform way to do this, so here we go
|
||||||
// for Windows and Linux we can distinguish via scancodes (but both
|
// for Windows and Linux we can distinguish via scancodes (but both
|
||||||
@ -237,6 +236,12 @@ bool IsRightModKey(QKeyEvent* event)
|
|||||||
quint32 scan = event->nativeScanCode();
|
quint32 scan = event->nativeScanCode();
|
||||||
return (scan == 0x11D || scan == 0x138 || scan == 0x36);
|
return (scan == 0x11D || scan == 0x138 || scan == 0x36);
|
||||||
}
|
}
|
||||||
|
#elifdef __APPLE__
|
||||||
|
bool IsRightModKey(QKeyEvent* event)
|
||||||
|
{
|
||||||
|
quint32 scan = event->nativeVirtualKey();
|
||||||
|
return (scan == 0x37 || scan == 0x3A || scan == 0x3C || scan == 0x3E);
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
bool IsRightModKey(QKeyEvent* event)
|
bool IsRightModKey(QKeyEvent* event)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user