MCPcopy Create free account
hub / github.com/MaaXYZ/MaaFramework / key_up

Method key_up

source/MaaWin32ControlUnit/Input/BackgroundManagedKeyInput.cpp:124–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122}
123
124bool BackgroundManagedKeyInput::key_up(int keycode)
125{
126 if (!is_valid_keycode(keycode)) {
127 LogError << "Invalid managed keycode" << VAR(keycode);
128 return false;
129 }
130
131 uint64_t generation = 0;
132 {
133 std::lock_guard lock(mutex_);
134 if (!managed_keys_.contains(keycode)) {
135 LogError << "Key is not in background managed domain" << VAR(keycode);
136 return false;
137 }
138
139 if (!desired_pressed_keys_.erase(keycode)) {
140 return true;
141 }
142 generation = ++desired_generation_;
143 }
144
145 guard_cv_.notify_all();
146 return wait_until_applied(generation);
147}
148
149bool BackgroundManagedKeyInput::inactive()
150{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected