Lines Matching refs:out
27 …us KeyEventNapi::CreateKeyEvent(napi_env env, const std::shared_ptr<KeyEvent> &in, napi_value &out) in CreateKeyEvent() argument
29 …auto status = SetNameProperty(env, out, "action", in->GetKeyAction() - KeyEvent::KEY_ACTION_CANCEL… in CreateKeyEvent()
34 status = SetNameProperty(env, out, "key", keyItem); in CreateKeyEvent()
37 status = SetNameProperty(env, out, "unicodeChar", in->GetKeyItem()->GetUnicode()); in CreateKeyEvent()
41 status = SetNameProperty(env, out, "keys", keyItems); in CreateKeyEvent()
44 status = WriteKeyStatusToJs(env, in->GetPressedKeys(), out); in CreateKeyEvent()
47 status = WriteFunctionKeyStatusToJs(env, in, out); in CreateKeyEvent()
53 napi_status KeyEventNapi::GetKeyEvent(napi_env env, napi_value in, std::shared_ptr<KeyEvent> &out) in GetKeyEvent() argument
60 out->SetKeyCode(item.GetKeyCode()); in GetKeyEvent()
63 out->GetKeyItem()->SetUnicode(unicode); in GetKeyEvent()
66 out->SetKeyAction(keyAction + KeyEvent::KEY_ACTION_CANCEL); in GetKeyEvent()
70 out->AddKeyItem(keyItem); in GetKeyEvent()
74 out->SetFunctionKey(KeyEvent::CAPS_LOCK_FUNCTION_KEY, lock); in GetKeyEvent()
76 out->SetFunctionKey(KeyEvent::NUM_LOCK_FUNCTION_KEY, lock); in GetKeyEvent()
78 out->SetFunctionKey(KeyEvent::SCROLL_LOCK_FUNCTION_KEY, lock); in GetKeyEvent()
83 …yEventNapi::CreateKeyItem(napi_env env, const std::optional<KeyEvent::KeyItem> in, napi_value &out) in CreateKeyItem() argument
85 auto status = SetNameProperty(env, out, "code", in->GetKeyCode()); in CreateKeyItem()
88 status = SetNameProperty(env, out, "pressedTime", in->GetDownTime()); in CreateKeyItem()
91 status = SetNameProperty(env, out, "deviceId", in->GetDeviceId()); in CreateKeyItem()
97 napi_status KeyEventNapi::GetKeyItem(napi_env env, napi_value in, KeyEvent::KeyItem &out) in GetKeyItem() argument
100 out.SetKeyCode(keyCode); in GetKeyItem()
102 out.SetDownTime(downTime); in GetKeyItem()
104 out.SetDeviceId(deviceId); in GetKeyItem()
108 …entNapi::WriteKeyStatusToJs(napi_env env, const std::vector<int32_t> &pressedKeys, napi_value &out) in WriteKeyStatusToJs() argument
112 auto status = SetNameProperty(env, out, "ctrlKey", isExists); in WriteKeyStatusToJs()
117 status = SetNameProperty(env, out, "altKey", isExists); in WriteKeyStatusToJs()
122 status = SetNameProperty(env, out, "shiftKey", isExists); in WriteKeyStatusToJs()
127 status = SetNameProperty(env, out, "logoKey", isExists); in WriteKeyStatusToJs()
131 status = SetNameProperty(env, out, "fnKey", isExists); in WriteKeyStatusToJs()
137 …api::WriteFunctionKeyStatusToJs(napi_env env, const std::shared_ptr<KeyEvent> &in, napi_value &out) in WriteFunctionKeyStatusToJs() argument
139 …auto status = SetNameProperty(env, out, "capsLock", in->GetFunctionKey(KeyEvent::CAPS_LOCK_FUNCTIO… in WriteFunctionKeyStatusToJs()
142 …status = SetNameProperty(env, out, "numLock", in->GetFunctionKey(KeyEvent::NUM_LOCK_FUNCTION_KEY)); in WriteFunctionKeyStatusToJs()
145 …status = SetNameProperty(env, out, "scrollLock", in->GetFunctionKey(KeyEvent::SCROLL_LOCK_FUNCTION… in WriteFunctionKeyStatusToJs()