UIEventWithKeyState.h [plain text]
#pragma once
#include "EventModifierInit.h"
#include "UIEvent.h"
namespace WebCore {
class UIEventWithKeyState : public UIEvent {
public:
bool ctrlKey() const { return m_ctrlKey; }
bool shiftKey() const { return m_shiftKey; }
bool altKey() const { return m_altKey; }
bool metaKey() const { return m_metaKey; }
bool altGraphKey() const { return m_altGraphKey; }
bool capsLockKey() const { return m_capsLockKey; }
protected:
UIEventWithKeyState() = default;
UIEventWithKeyState(const AtomicString& type, bool canBubble, bool cancelable, RefPtr<WindowProxy>&& view, int detail, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey)
: UIEvent(type, canBubble, cancelable, WTFMove(view), detail)
, m_ctrlKey(ctrlKey)
, m_altKey(altKey)
, m_shiftKey(shiftKey)
, m_metaKey(metaKey)
{
}
UIEventWithKeyState(const AtomicString& type, bool canBubble, bool cancelable, MonotonicTime timestamp, RefPtr<WindowProxy>&& view,
int detail, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool altGraphKey, bool capsLockKey)
: UIEvent(type, canBubble, cancelable, timestamp, WTFMove(view), detail)
, m_ctrlKey(ctrlKey)
, m_altKey(altKey)
, m_shiftKey(shiftKey)
, m_metaKey(metaKey)
, m_altGraphKey(altGraphKey)
, m_capsLockKey(capsLockKey)
{
}
UIEventWithKeyState(const AtomicString& type, const EventModifierInit& initializer, IsTrusted isTrusted)
: UIEvent(type, initializer, isTrusted)
, m_ctrlKey(initializer.ctrlKey)
, m_altKey(initializer.altKey)
, m_shiftKey(initializer.shiftKey)
, m_metaKey(initializer.metaKey)
, m_altGraphKey(initializer.modifierAltGraph)
, m_capsLockKey(initializer.modifierCapsLock)
{
}
bool m_ctrlKey { false };
bool m_altKey { false };
bool m_shiftKey { false };
bool m_metaKey { false };
bool m_altGraphKey { false };
bool m_capsLockKey { false };
};
UIEventWithKeyState* findEventWithKeyState(Event*);
}