Magnum::Platform::EmscriptenApplication::KeyEvent class

Key event.

Base classes

class InputEvent
Base for input events.

Public types

using Key = EmscriptenApplication::Key deprecated in Git master
Key.

Public functions

auto key() const -> EmscriptenApplication::Key
Key.
auto keyName() const -> Containers::StringView
Key name.
auto scanCodeName() const -> Containers::StringView new in Git master
Scancode name.
auto modifiers() const -> EmscriptenApplication::Modifiers
Keyboard modifiers.
auto event() const -> const EmscriptenKeyboardEvent&
Underlying Emscripten event.

Typedef documentation

typedef EmscriptenApplication::Key Magnum::Platform::EmscriptenApplication::KeyEvent::Key

Key.

Function documentation

EmscriptenApplication::Key Magnum::Platform::EmscriptenApplication::KeyEvent::key() const

Key.

Layout-dependent name of given key. Mapped from EmscriptenKeyboardEvent::code in all cases except A–Z, which are mapped from EmscriptenkeyboardEvent::key, which respects the keyboard layout. Note that, unlike e.g. Sdl2Application::KeyEvent::scanCode(), there's no numeric layout-independent identifier of given key, you have to use scanCodeName() instead.

Containers::StringView Magnum::Platform::EmscriptenApplication::KeyEvent::keyName() const

Key name.

Layout-dependent name of given key. Returns EmscriptenkeyboardEvent::key for keys A–Z and EmscriptenKeyboardEvent::code for other keys, the view is always Containers::StringViewFlag::NullTerminated and is valid until the event is destroyed. Use scanCodeName() to get a platform-specific but layout-independent identifier of given key.

Containers::StringView Magnum::Platform::EmscriptenApplication::KeyEvent::scanCodeName() const new in Git master

Scancode name.

Platform-specific but layout-independent identifier of given key. Returns EmscriptenKeyboardEvent::code, the view is always Containers::StringViewFlag::NullTerminated and is valid until the event is destroyed. Use keyName() to get a key name in the currently used layout.