| 178 | } |
| 179 | |
| 180 | void Keyboard::clearChanges() { |
| 181 | if (!_changedKeys.empty()) { |
| 182 | for (auto symKey : _changedKeys) { |
| 183 | if ((symKey & SDLK_SCANCODE_MASK) != 0) { |
| 184 | uint32_t code = s_cast<uint32_t>(symKey) & ~SDLK_SCANCODE_MASK; |
| 185 | _oldCodeStates[code] = _newCodeStates[code]; |
| 186 | } else { |
| 187 | _oldKeyStates[symKey] = _newKeyStates[symKey]; |
| 188 | } |
| 189 | } |
| 190 | _changedKeys.clear(); |
| 191 | } |
| 192 | } |
| 193 | |
| 194 | void Keyboard::attachIME(const KeyboardHandler& handler) { |
| 195 | if (_imeHandler) { |