mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 05:19:56 +00:00
[Common] Fixes from Unknown W. Brackets: <checkins@unknownbrackets.org>
This commit is contained in:
parent
efa742322b
commit
4ef014cb73
@ -42,7 +42,7 @@ std::vector<InputMapping> tabRightKeys;
|
||||
static std::unordered_map<InputDeviceID, int> uiFlipAnalogY;
|
||||
|
||||
static void AppendKeys(std::vector<InputMapping> &keys, const std::vector<InputMapping> &newKeys) {
|
||||
for (auto key : newKeys) {
|
||||
for (const auto &key : newKeys) {
|
||||
keys.push_back(key);
|
||||
}
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ void DoList(PointerWrap &p, std::list<T> &x, T &default_val) {
|
||||
Do(p, list_size);
|
||||
x.resize(list_size, default_val);
|
||||
|
||||
for (T elem : x)
|
||||
for (T &elem : x)
|
||||
Do(p, elem);
|
||||
}
|
||||
|
||||
|
@ -353,21 +353,21 @@ static void ProcessHeldKeys(ViewGroup *root) {
|
||||
double now = time_now_d();
|
||||
|
||||
restart:
|
||||
for (const auto &hk : heldKeys) {
|
||||
if (hk.triggerTime < now) {
|
||||
for (std::set<HeldKey>::iterator iter = heldKeys.begin(); iter != heldKeys.end(); ++iter) {
|
||||
if (iter->triggerTime < now) {
|
||||
KeyInput key;
|
||||
key.keyCode = hk.key;
|
||||
key.deviceId = hk.deviceId;
|
||||
key.keyCode = iter->key;
|
||||
key.deviceId = iter->deviceId;
|
||||
key.flags = KEY_DOWN;
|
||||
KeyEvent(key, root);
|
||||
|
||||
focusMoves.push_back(key.keyCode);
|
||||
|
||||
// Cannot modify the current item when looping over a set, so let's do this instead.
|
||||
HeldKey k = hk;
|
||||
heldKeys.erase(k);
|
||||
k.triggerTime = now + repeatInterval;
|
||||
heldKeys.insert(k);
|
||||
HeldKey hk = *iter;
|
||||
heldKeys.erase(hk);
|
||||
hk.triggerTime = now + repeatInterval;
|
||||
heldKeys.insert(hk);
|
||||
goto restart;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user