Lines Matching refs:in

4  * you may not use this file except in compliance with the License.
9 * Unless required by applicable law or agreed to in writing, software
26 napi_status KeyEventNapi::CreateKeyEvent(napi_env env, const std::shared_ptr<KeyEvent> &in, napi_value &out)
28 CHKPR(in, napi_invalid_arg);
29 auto status = SetNameProperty(env, out, "action", in->GetKeyAction() - KeyEvent::KEY_ACTION_CANCEL);
32 CHECK_RETURN(in->GetKeyItem(), "get key item", status);
33 auto keyItem = in->GetKeyItem();
37 status = SetNameProperty(env, out, "unicodeChar", in->GetKeyItem()->GetUnicode());
40 auto keyItems = in->GetKeyItems();
44 status = WriteKeyStatusToJs(env, in->GetPressedKeys(), out);
47 status = WriteFunctionKeyStatusToJs(env, in, out);
51 status = SetNameProperty(env, out, "vkeyboardAction", in->GetVKeyboardAction());
54 status = SetNameProperty(env, out, "keyName", in->GetKeyName());
61 napi_status KeyEventNapi::GetKeyEvent(napi_env env, napi_value in, std::shared_ptr<KeyEvent> &out)
64 auto status = napi_typeof(env, in, &valueType);
67 KeyEvent::KeyItem item = GetNamePropertyKeyItem(env, in, "key");
70 uint32_t unicode = GetNamePropertyUint32(env, in, "unicodeChar");
73 int32_t keyAction = GetNamePropertyInt32(env, in, "action");
76 std::vector<KeyEvent::KeyItem> keyItems = GetNamePropertyKeyItems(env, in, "keys");
81 bool lock = GetNamePropertyBool(env, in, "capsLock");
83 lock = GetNamePropertyBool(env, in, "numLock");
85 lock = GetNamePropertyBool(env, in, "scrollLock");
89 int32_t vkeyboardAction = GetNamePropertyInt32(env, in, "vkeyboardAction");
92 std::string keyName = GetNamePropertyString(env, in, "keyName");
99 napi_status KeyEventNapi::CreateKeyItem(napi_env env, const std::optional<KeyEvent::KeyItem> in, napi_value &out)
101 auto status = SetNameProperty(env, out, "code", in->GetKeyCode());
104 status = SetNameProperty(env, out, "pressedTime", in->GetDownTime());
107 status = SetNameProperty(env, out, "deviceId", in->GetDeviceId());
113 napi_status KeyEventNapi::GetKeyItem(napi_env env, napi_value in, KeyEvent::KeyItem &out)
115 int32_t keyCode = GetNamePropertyInt32(env, in, "code");
117 int64_t downTime = GetNamePropertyInt64(env, in, "pressedTime");
119 int32_t deviceId = GetNamePropertyInt32(env, in, "deviceId");
153 napi_status KeyEventNapi::WriteFunctionKeyStatusToJs(napi_env env, const std::shared_ptr<KeyEvent> &in, napi_value &out)
155 auto status = SetNameProperty(env, out, "capsLock", in->GetFunctionKey(KeyEvent::CAPS_LOCK_FUNCTION_KEY));
158 status = SetNameProperty(env, out, "numLock", in->GetFunctionKey(KeyEvent::NUM_LOCK_FUNCTION_KEY));
161 status = SetNameProperty(env, out, "scrollLock", in->GetFunctionKey(KeyEvent::SCROLL_LOCK_FUNCTION_KEY));