Be more flexible about hotkey modifier permutations.

Open .ini files with TextEdit on OS X since wx has no binding.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6986 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Soren Jorvang
2011-01-30 14:20:20 +00:00
parent f41e5b3b85
commit 2622f86eb6
7 changed files with 72 additions and 53 deletions

View File

@ -138,22 +138,29 @@ const wxString WXKeyToString(int keycode)
return wxString((wxChar)keycode, 1);
}
return _T("");
return wxT("");
}
const wxString WXKeymodToString(int modifier)
{
switch (modifier)
{
case wxMOD_ALT: return wxT("Alt");
case wxMOD_CONTROL: return wxT("Ctrl");
case wxMOD_ALTGR: return wxT("Ctrl+Alt");
case wxMOD_SHIFT: return wxT("Shift");
// wxWidgets can only use Alt/Ctrl/Shift as menu accelerators,
// so Meta (Command on OS X) is simply made equivalent to Ctrl.
case wxMOD_META: return wxT("Ctrl");
default: return wxT("");
}
wxString mods;
if (modifier & wxMOD_META)
#ifdef __APPLE__
mods += wxT("Cmd+");
#elif defined _WIN32
mods += wxT("Win+");
#else
mods += wxT("Meta+");
#endif
if (modifier & wxMOD_CONTROL)
mods += wxT("Ctrl+");
if (modifier & wxMOD_ALT)
mods += wxT("Alt+");
if (modifier & wxMOD_SHIFT)
mods += wxT("Shift+");
return mods;
}
}