MCPcopy Create free account
hub / github.com/EasyIME/PIME / updatePreservedKeys

Method updatePreservedKeys

PIMETextService/PIMEClient.cpp:274–301  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

272}
273
274void Client::updatePreservedKeys(Json::Value& msg) {
275 const auto& addPreservedKeyVal = msg["addPreservedKey"];
276 if (addPreservedKeyVal.isArray()) {
277 // preserved keys
278 for (auto& key : addPreservedKeyVal) {
279 if (key.isObject()) {
280 UINT keyCode = key["keyCode"].asUInt();
281 UINT modifiers = key["modifiers"].asUInt();
282 UUID guid = { 0 };
283 if (uuidFromString(key["guid"].asCString(), guid)) {
284 textService_->addPreservedKey(keyCode, modifiers, guid);
285 }
286 }
287 }
288 }
289
290 const auto& removePreservedKeyVal = msg["removePreservedKey"];
291 if (removePreservedKeyVal.isArray()) {
292 for (auto& item : removePreservedKeyVal) {
293 if (item.isString()) {
294 UUID guid = { 0 };
295 if (uuidFromString(item.asCString(), guid)) {
296 textService_->removePreservedKey(guid);
297 }
298 }
299 }
300 }
301}
302
303void Client::updateKeyboardStatus(Json::Value& msg) {
304 const auto& openKeyboardVal = msg["openKeyboard"];

Callers

nothing calls this directly

Calls 3

uuidFromStringFunction · 0.85
addPreservedKeyMethod · 0.80
removePreservedKeyMethod · 0.80

Tested by

no test coverage detected