| 122 | } |
| 123 | |
| 124 | bool 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 | |
| 149 | bool BackgroundManagedKeyInput::inactive() |
| 150 | { |
nothing calls this directly
no outgoing calls
no test coverage detected