refactor: KeyState::updateModifierState, use std::ranges::set_difference in place of std::set_difference
This commit is contained in:
parent
0cbc922478
commit
d20887f34a
1 changed files with 2 additions and 8 deletions
|
|
@ -1110,14 +1110,8 @@ void KeyState::updateModifierKeyState(
|
||||||
// get the modifier buttons that were pressed or released
|
// get the modifier buttons that were pressed or released
|
||||||
deskflow::KeyMap::ButtonToKeyMap pressed;
|
deskflow::KeyMap::ButtonToKeyMap pressed;
|
||||||
deskflow::KeyMap::ButtonToKeyMap released;
|
deskflow::KeyMap::ButtonToKeyMap released;
|
||||||
std::set_difference(
|
std::ranges::set_difference(oldKeys, newKeys, std::inserter(released, released.end()), ButtonToKeyLess());
|
||||||
oldKeys.begin(), oldKeys.end(), newKeys.begin(), newKeys.end(), std::inserter(released, released.end()),
|
std::ranges::set_difference(newKeys, oldKeys, std::inserter(pressed, pressed.end()), ButtonToKeyLess());
|
||||||
ButtonToKeyLess()
|
|
||||||
);
|
|
||||||
std::set_difference(
|
|
||||||
newKeys.begin(), newKeys.end(), oldKeys.begin(), oldKeys.end(), std::inserter(pressed, pressed.end()),
|
|
||||||
ButtonToKeyLess()
|
|
||||||
);
|
|
||||||
|
|
||||||
// update state
|
// update state
|
||||||
for (deskflow::KeyMap::ButtonToKeyMap::const_iterator i = released.begin(); i != released.end(); ++i) {
|
for (deskflow::KeyMap::ButtonToKeyMap::const_iterator i = released.begin(); i != released.end(); ++i) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue