mirror of
https://github.com/libretro/ppsspp.git
synced 2025-01-20 23:54:48 +00:00
Fix bug with unthrottle as virtual key. Add button to restore default key mappings.
This commit is contained in:
parent
1256d5528d
commit
47dae8c004
@ -412,6 +412,9 @@ void SetKeyMapping(int map, int deviceId, int key, int btn)
|
||||
controllerMaps[map].keys[KeyDef(deviceId, key)] = btn;
|
||||
}
|
||||
|
||||
void RestoreDefault() {
|
||||
controllerMaps = DefaultKeyMap::KeyMap;
|
||||
}
|
||||
|
||||
// TODO: Make the ini format nicer.
|
||||
void LoadFromIni(IniFile &file) {
|
||||
|
@ -115,5 +115,6 @@ namespace KeyMap {
|
||||
|
||||
void LoadFromIni(IniFile &iniFile);
|
||||
void SaveToIni(IniFile &iniFile);
|
||||
void RestoreDefault();
|
||||
}
|
||||
|
||||
|
@ -207,11 +207,11 @@ void EmuScreen::key(const KeyInput &key) {
|
||||
int vk = result - VIRTKEY_FIRST;
|
||||
if (key.flags & KEY_DOWN) {
|
||||
virtKeys[vk] = true;
|
||||
onVKeyDown(key.keyCode);
|
||||
onVKeyDown(result);
|
||||
}
|
||||
if (key.flags & KEY_UP) {
|
||||
virtKeys[vk] = false;
|
||||
onVKeyUp(key.keyCode);
|
||||
onVKeyUp(result);
|
||||
}
|
||||
} else {
|
||||
if (key.flags & KEY_DOWN)
|
||||
|
@ -1548,6 +1548,9 @@ void ControlsScreen::render() {
|
||||
if (UIButton(GEN_ID, hlinear, 250, 0, c->T("Key Mapping"), ALIGN_LEFT)) {
|
||||
screenManager()->push(new KeyMappingScreen());
|
||||
}
|
||||
if (UIButton(GEN_ID, hlinear, 250, 0, c->T("Default Mapping"), ALIGN_LEFT)) {
|
||||
KeyMap::RestoreDefault();
|
||||
}
|
||||
|
||||
UIEnd();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user