mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-11 01:25:07 +02:00
Search: Skip spaces and control characters, code cleanup, fix minor issue on desktop
This commit is contained in:
@@ -387,7 +387,13 @@ std::string NormalizeForSearch(std::string_view input) {
|
||||
while (index < size) {
|
||||
uint32_t codepoint = u8_nextchar(input.data(), &index, size);
|
||||
|
||||
// Skip spaces and control characters.
|
||||
if (codepoint <= 0x20) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 1. Convert Fullwidth Roman/Numbers to ASCII
|
||||
// These are common in Japanese game names.
|
||||
// Range: U+FF01 (!) to U+FF5E (~)
|
||||
if (codepoint >= 0xFF01 && codepoint <= 0xFF5E) {
|
||||
codepoint -= 0xFEE0;
|
||||
|
||||
@@ -212,6 +212,7 @@ void UpdateNativeMenuKeys() {
|
||||
RemoveKeyboardLetterKeys(tabRight);
|
||||
RemoveKeyboardLetterKeys(confirmKeys);
|
||||
RemoveKeyboardLetterKeys(cancelKeys);
|
||||
RemoveKeyboardLetterKeys(infoKeys);
|
||||
|
||||
SetDPadKeys(upKeys, downKeys, leftKeys, rightKeys);
|
||||
SetConfirmCancelKeys(confirmKeys, cancelKeys);
|
||||
|
||||
+1
-6
@@ -515,18 +515,13 @@ void MainScreen::CreateViews() {
|
||||
|
||||
bool MainScreen::key(const KeyInput &key) {
|
||||
if (key.flags & KeyInputFlags::DOWN) {
|
||||
if (key.keyCode == NKCODE_CTRL_LEFT || key.keyCode == NKCODE_CTRL_RIGHT)
|
||||
searchKeyModifier_ = true;
|
||||
if (key.keyCode == NKCODE_F && searchKeyModifier_ && System_GetPropertyBool(SYSPROP_HAS_TEXT_INPUT_DIALOG)) {
|
||||
if (key.keyCode == NKCODE_F && (key.flags & KeyInputFlags::MOD_CTRL) && System_GetPropertyBool(SYSPROP_HAS_TEXT_INPUT_DIALOG)) {
|
||||
auto se = GetI18NCategory(I18NCat::SEARCH);
|
||||
System_InputBoxGetString(GetRequesterToken(), se->T("Search term"), searchFilter_, false, [&](const std::string &value, int) {
|
||||
searchFilter_ = StripSpaces(value);
|
||||
searchChanged_ = true;
|
||||
});
|
||||
}
|
||||
} else if (key.flags & KeyInputFlags::UP) {
|
||||
if (key.keyCode == NKCODE_CTRL_LEFT || key.keyCode == NKCODE_CTRL_RIGHT)
|
||||
searchKeyModifier_ = false;
|
||||
}
|
||||
|
||||
bool retval = UIBaseScreen::key(key);
|
||||
|
||||
@@ -92,7 +92,6 @@ protected:
|
||||
bool lockBackgroundAudio_ = false;
|
||||
bool lastVertical_ = false;
|
||||
bool confirmedTemporary_ = false;
|
||||
bool searchKeyModifier_ = false;
|
||||
bool searchChanged_ = false;
|
||||
std::string searchFilter_;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user