Lines Matching refs:KeyEvent
26 napi_status KeyEventNapi::CreateKeyEvent(napi_env env, const std::shared_ptr<KeyEvent> &in, napi_value &out)
29 auto status = SetNameProperty(env, out, "action", in->GetKeyAction() - KeyEvent::KEY_ACTION_CANCEL);
61 napi_status KeyEventNapi::GetKeyEvent(napi_env env, napi_value in, std::shared_ptr<KeyEvent> &out)
67 KeyEvent::KeyItem item = GetNamePropertyKeyItem(env, in, "key");
74 out->SetKeyAction(keyAction + KeyEvent::KEY_ACTION_CANCEL);
76 std::vector<KeyEvent::KeyItem> keyItems = GetNamePropertyKeyItems(env, in, "keys");
82 out->SetFunctionKey(KeyEvent::CAPS_LOCK_FUNCTION_KEY, lock);
84 out->SetFunctionKey(KeyEvent::NUM_LOCK_FUNCTION_KEY, lock);
86 out->SetFunctionKey(KeyEvent::SCROLL_LOCK_FUNCTION_KEY, lock);
90 out->SetVKeyboardAction(static_cast<KeyEvent::VKeyboardAction>(vkeyboardAction));
99 napi_status KeyEventNapi::CreateKeyItem(napi_env env, const std::optional<KeyEvent::KeyItem> in, napi_value &out)
113 napi_status KeyEventNapi::GetKeyItem(napi_env env, napi_value in, KeyEvent::KeyItem &out)
126 bool isExists = HasKeyCode(pressedKeys, KeyEvent::KEYCODE_CTRL_LEFT)
127 || HasKeyCode(pressedKeys, KeyEvent::KEYCODE_CTRL_RIGHT);
131 isExists = HasKeyCode(pressedKeys, KeyEvent::KEYCODE_ALT_LEFT)
132 || HasKeyCode(pressedKeys, KeyEvent::KEYCODE_ALT_RIGHT);
136 isExists = HasKeyCode(pressedKeys, KeyEvent::KEYCODE_SHIFT_LEFT)
137 || HasKeyCode(pressedKeys, KeyEvent::KEYCODE_SHIFT_RIGHT);
141 isExists = HasKeyCode(pressedKeys, KeyEvent::KEYCODE_META_LEFT)
142 || HasKeyCode(pressedKeys, KeyEvent::KEYCODE_META_RIGHT);
146 isExists = HasKeyCode(pressedKeys, KeyEvent::KEYCODE_FN);
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));