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, 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 { }