gui: kb shortcuts: yet another fix for the ini parser

Apparently I logged the values incorrectly previously. I said
that shift-q  gets parsed as Q without shift, but actually the shift flag
is set correctly on such case (though the letter is still upper case for shift-q
and it's still lower case for plain q)

So I retested all the 8 modifiers combination, and noticed that the modifiers
are always parsed and set correctly, but the letter ends up upper case if any
modifiers are used, but lower case if no modifiers are used.

We still need to make lower if it's upper, but don't need to add the shift flag.
This commit is contained in:
Avi Halachmi (:avih) 2015-10-12 03:33:50 +03:00
parent efeb66c852
commit 69a978fe05
1 changed files with 4 additions and 5 deletions

View File

@ -614,12 +614,11 @@ void AcceleratorDictionary::Map( const KeyAcceleratorCode& _acode, const char *s
// Note that this needs to match the key event codes at Pcsx2App::PadKeyDispatch
// Our canonical representation is the char code (at lower case if
// applicable) with a separate modifier indicator, including shift.
// The parser deviates from this by parsing e.g. `shift-q` as 81 (Q) without shift, instead of 113 (q) with shift.
// (For plain `q` it does end up correctly with 113).
// The parser works correctly for symbols, e.g. `-` ends up as 45
// So we only need to change upper case letters to lower case and add the shift flag.
// The parser deviates from this by setting the keycode to upper case if
// modifiers are used with plain letters. Luckily, it sets the modifiers
// correctly, including shift (for letters without modifiers it parses lower case).
// So we only need to change upper case letters to lower case.
acode.keycode += 'a' - 'A';
acode.Shift();
}
if (_acode.ToString() != acode.ToString()) {
Console.WriteLn(Color_StrongGreen, L"Overriding '%s': assigning %s (instead of %s)",