KeyboardEvent::KeyboardEvent(const PlatformKeyboardEvent& key, DOMWindow* view) : UIEventWithKeyState(eventTypeForKeyboardEventType(key.type()) , true, true, key.timestamp(), view, 0, key.ctrlKey(), key.altKey(), key.shiftKey() , key.metaKey(), false, key.modifiers().contains(PlatformEvent::Modifier::CapsLockKey)) , m_keyEvent(std::make_unique<PlatformKeyboardEvent>(key)) #if ENABLE(KEYBOARD_KEY_ATTRIBUTE) , m_key(key.key()) #endif #if ENABLE(KEYBOARD_CODE_ATTRIBUTE) , m_code(key.code()) #endif , m_keyIdentifier(key.keyIdentifier()) , m_location(keyLocationCode(key)) , m_repeat(key.isAutoRepeat()) , m_isComposing(view && view->frame() && view->frame()->editor().hasComposition()) #if PLATFORM(COCOA) #if USE(APPKIT) , m_handledByInputMethod(key.handledByInputMethod()) , m_keypressCommands(key.commands()) #else , m_handledByInputMethod(false) #endif #endif { }
KeyboardEvent::KeyboardEvent(const PlatformKeyboardEvent& key, AbstractView* view) : UIEventWithKeyState(eventTypeForKeyboardEventType(key.type()), true, true, view, 0, key.modifiers(), InputDeviceCapabilities::doesntFireTouchEventsSourceCapabilities()) , m_keyEvent(adoptPtr(new PlatformKeyboardEvent(key))) , m_keyIdentifier(key.keyIdentifier()) , m_code(key.code()) , m_key(key.key()) , m_location(keyLocationCode(key)) { setPlatformTimeStamp(key.timestamp()); initLocationModifiers(m_location); }
KeyboardEvent::KeyboardEvent(const PlatformKeyboardEvent& key, AbstractView* view) : UIEventWithKeyState(eventTypeForKeyboardEventType(key.type()), true, true, view, 0, key.ctrlKey(), key.altKey(), key.shiftKey(), key.metaKey()) , m_keyEvent(adoptPtr(new PlatformKeyboardEvent(key))) , m_keyIdentifier(key.keyIdentifier()) , m_location(keyLocationCode(key)) , m_altGraphKey(false) , m_isAutoRepeat(key.isAutoRepeat()) { ScriptWrappable::init(this); }
KeyboardEvent::KeyboardEvent(const PlatformKeyboardEvent& key, AbstractView* view) : UIEventWithKeyState(eventTypeForKeyboardEventType(key.type()), true, true, view, 0, key.ctrlKey(), key.altKey(), key.shiftKey(), key.metaKey(), InputDevice::doesntFireTouchEventsInputDevice()) , m_keyEvent(adoptPtr(new PlatformKeyboardEvent(key))) , m_keyIdentifier(key.keyIdentifier()) , m_code(key.code()) , m_key(key.key()) , m_location(keyLocationCode(key)) , m_isAutoRepeat(key.isAutoRepeat()) , m_bbIsNumLock(key.bbIsNumLock()) { setUICreateTime(key.timestamp()); }
KeyboardEvent::KeyboardEvent(const PlatformKeyboardEvent& key, AbstractView* view) : UIEventWithKeyState(eventTypeForKeyboardEventType(key.type()), true, true, key.timestamp(), view, 0, key.ctrlKey(), key.altKey(), key.shiftKey(), key.metaKey()) , m_keyEvent(std::make_unique<PlatformKeyboardEvent>(key)) , m_keyIdentifier(key.keyIdentifier()) , m_location(keyLocationCode(key)) , m_altGraphKey(false) #if PLATFORM(COCOA) #if USE(APPKIT) , m_handledByInputMethod(key.handledByInputMethod()) , m_keypressCommands(key.commands()) #else , m_handledByInputMethod(false) #endif #endif { }
KeyboardEvent::KeyboardEvent(const WebKeyboardEvent& key, LocalDOMWindow* domWindow) : UIEventWithKeyState( eventTypeForKeyboardEventType(key.type), true, true, domWindow, 0, static_cast<PlatformEvent::Modifiers>(key.modifiers), key.timeStampSeconds, InputDeviceCapabilities::doesntFireTouchEventsSourceCapabilities()), m_keyEvent(WTF::makeUnique<WebKeyboardEvent>(key)), // TODO(crbug.com/482880): Fix this initialization to lazy initialization. m_code(Platform::current()->domCodeStringFromEnum(key.domCode)), m_key(Platform::current()->domKeyStringFromEnum(key.domKey)), m_location(keyLocationCode(key)), m_isComposing(hasCurrentComposition(domWindow)) { initLocationModifiers(m_location); }