Browse Source

Platform: added a bunch of missing keys.

pull/403/head
Vladimír Vondruš 7 years ago
parent
commit
3379051ed5
  1. 16
      doc/changelog.dox
  2. 4
      src/Magnum/Platform/EmscriptenApplication.cpp
  3. 20
      src/Magnum/Platform/EmscriptenApplication.h
  4. 49
      src/Magnum/Platform/GlfwApplication.h
  5. 35
      src/Magnum/Platform/Sdl2Application.h

16
doc/changelog.dox

@ -82,6 +82,16 @@ See also:
@ref Platform::AbstractXApplication::mainLoopIteration() for consistency
with @ref Platform::Sdl2Application (see
[mosra/magnum#387](https://github.com/mosra/magnum/pull/387))
- Added @ref Platform::Sdl2Application::KeyEvent::Key::Quote "Key::Quote",
@ref Platform::Sdl2Application::KeyEvent::Key::LeftBracket "Key::LeftBracket",
@ref Platform::Sdl2Application::KeyEvent::Key::RightBracket "Key::RightBracket",
@ref Platform::Sdl2Application::KeyEvent::Key::Backslash "Key::Backslash" and
@ref Platform::Sdl2Application::KeyEvent::Key::Backquote "Key::Backquote"
keys to @ref Platform::Sdl2Application::KeyEvent and
@ref Platform::GlfwApplication::KeyEvent
- Added @ref Platform::GlfwApplication::KeyEvent::Key::World1 and
@ref Platform::GlfwApplication::KeyEvent::Key::World2
- Added @ref Platform::EmscriptenApplication::KeyEvent::Key::Semicolon
@subsection changelog-latest-changes Changes and improvements
@ -133,6 +143,12 @@ See also:
- @ref Platform::Sdl2Application::Configuration::WindowFlag::Vulkan was
enabled conditionally only for SDL >= 2.0.6, but the version defines were
never included so it was always disabled
- Fixed missing handling of
@ref Platform::EmscriptenApplication::KeyEvent::Key::LeftBracket "Key::LeftBracket",
@ref Platform::EmscriptenApplication::KeyEvent::Key::RightBracket "Key::RightBracket",
@ref Platform::EmscriptenApplication::KeyEvent::Key::Semicolon "Key::Semicolon" and
@ref Platform::EmscriptenApplication::KeyEvent::Key::Backquote "Key::Backquote"
in @ref Platform::EmscriptenApplication
@subsection changelog-latest-deprecated Deprecated APIs

4
src/Magnum/Platform/EmscriptenApplication.cpp

@ -62,8 +62,11 @@ namespace {
{"ArrowLeft", Key::Left},
{"ArrowRight", Key::Right},
{"ArrowUp", Key::Up},
{"Backquote", Key::Backquote},
{"Backslash", Key::Backslash},
{"Backspace", Key::Backspace},
{"BracketLeft", Key::LeftBracket},
{"BracketRight", Key::RightBracket},
{"CapsLock", Key::CapsLock},
{"Comma", Key::Comma},
{"ContextMenu", Key::Menu},
@ -88,6 +91,7 @@ namespace {
{"PrintScreen", Key::PrintScreen},
{"Quote", Key::Quote},
{"ScrollLock", Key::ScrollLock},
{"Semicolon", Key::Semicolon},
{"ShiftLeft", Key::LeftShift},
{"ShiftRight", Key::RightShift},
{"Slash", Key::Slash},

20
src/Magnum/Platform/EmscriptenApplication.h

@ -1586,6 +1586,8 @@ class EmscriptenApplication::KeyEvent: public EmscriptenApplication::InputEvent
*/
RightSuper,
/* no equivalent for Sdl2Application's AltGr */
Enter, /**< Enter */
Esc, /**< Escape */
@ -1654,6 +1656,7 @@ class EmscriptenApplication::KeyEvent: public EmscriptenApplication::InputEvent
Space, /**< Space */
Tab, /**< Tab */
Quote, /**< Quote (`'`) */
Comma, /**< Comma */
Period, /**< Period */
Minus, /**< Minus */
@ -1662,13 +1665,20 @@ class EmscriptenApplication::KeyEvent: public EmscriptenApplication::InputEvent
Slash, /**< Slash */
/* Note: This may only be represented as SHIFT + 5 */
Percent, /**< Percent */
/**
* Semicolon (`;`)
* @m_since_latest
*/
Semicolon,
Equal, /**< Equal */
LeftBracket, /**< Left bracket (`[`) */
RightBracket, /**< Right bracket (`]`) */
Backslash, /**< Backslash (`\`) */
Backquote, /**< Backquote (<tt>`</tt>) */
Backquote, /**< Backquote */
Backslash, /**< Backslash */
Quote, /**< Quote */
BracketRight, /**< BracketRight */
BracketLeft, /**< BracketLeft */
/* no equivalent for GlfwApplication's World1 / World2 */
CapsLock, /**< Caps lock */
ScrollLock, /**< Scroll lock */

49
src/Magnum/Platform/GlfwApplication.h

@ -1469,6 +1469,8 @@ class GlfwApplication::KeyEvent: public GlfwApplication::InputEvent {
*/
RightSuper = GLFW_KEY_RIGHT_SUPER,
/* no equivalent for Sdl2Application's AltGr */
Enter = GLFW_KEY_ENTER, /**< Enter */
Esc = GLFW_KEY_ESCAPE, /**< Escape */
@ -1499,6 +1501,13 @@ class GlfwApplication::KeyEvent: public GlfwApplication::InputEvent {
Space = GLFW_KEY_SPACE, /**< Space */
Tab = GLFW_KEY_TAB, /**< Tab */
/**
* Quote (`'`)
* @m_since_latest
*/
Quote = GLFW_KEY_APOSTROPHE,
Comma = GLFW_KEY_COMMA, /**< Comma */
Period = GLFW_KEY_PERIOD, /**< Period */
Minus = GLFW_KEY_MINUS, /**< Minus */
@ -1507,10 +1516,10 @@ class GlfwApplication::KeyEvent: public GlfwApplication::InputEvent {
Slash = GLFW_KEY_SLASH, /**< Slash */
/* Note: This may only be represented as SHIFT + 5 */
Percent = '%', /**< Percent */
Semicolon = GLFW_KEY_SEMICOLON, /**< Semicolon */
Semicolon = GLFW_KEY_SEMICOLON, /**< Semicolon (`;`) */
#ifdef MAGNUM_BUILD_DEPRECATED
/** Semicolon
/** Semicolon (`;`)
* @m_deprecated_since{2019,01} Use @ref Key::Semicolon instead.
*/
Smicolon CORRADE_DEPRECATED_ENUM("use Key::Semicolon instead") = Semicolon,
@ -1518,6 +1527,42 @@ class GlfwApplication::KeyEvent: public GlfwApplication::InputEvent {
Equal = GLFW_KEY_EQUAL, /**< Equal */
/**
* Left bracket (`[`)
* @m_since_latest
*/
LeftBracket = GLFW_KEY_LEFT_BRACKET,
/**
* Right bracket (`]`)
* @m_since_latest
*/
RightBracket = GLFW_KEY_RIGHT_BRACKET,
/**
* Backslash (`\`)
* @m_since_latest
*/
Backslash = GLFW_KEY_BACKSLASH,
/**
* Backquote (<tt>`</tt>)
* @m_since_latest
*/
Backquote = GLFW_KEY_GRAVE_ACCENT,
/**
* Non-US \#1
* @m_since_latest
*/
World1 = GLFW_KEY_WORLD_1,
/**
* Non-US \#2
* @m_since_latest
*/
World2 = GLFW_KEY_WORLD_2,
Zero = GLFW_KEY_0, /**< Zero */
One = GLFW_KEY_1, /**< One */
Two = GLFW_KEY_2, /**< Two */

35
src/Magnum/Platform/Sdl2Application.h

@ -2099,15 +2099,48 @@ class Sdl2Application::KeyEvent: public Sdl2Application::InputEvent {
Space = SDLK_SPACE, /**< Space */
Tab = SDLK_TAB, /**< Tab */
/**
* Quote (`'`)
* @m_since_latest
*/
Quote = SDLK_QUOTE,
Comma = SDLK_COMMA, /**< Comma */
Period = SDLK_PERIOD, /**< Period */
Minus = SDLK_MINUS, /**< Minus */
Plus = SDLK_PLUS, /**< Plus */
Slash = SDLK_SLASH, /**< Slash */
Percent = SDLK_PERCENT, /**< Percent */
Semicolon = SDLK_SEMICOLON, /**< Semicolon */
Semicolon = SDLK_SEMICOLON, /**< Semicolon (`;`) */
Equal = SDLK_EQUALS, /**< Equal */
/**
* Left bracket (`[`)
* @m_since_latest
*/
LeftBracket = SDLK_LEFTBRACKET,
/**
* Right bracket (`]`)
* @m_since_latest
*/
RightBracket = SDLK_RIGHTBRACKET,
/**
* Backslash (`\`)
* @m_since_latest
*/
Backslash = SDLK_BACKSLASH,
/**
* Backquote (<tt>`</tt>)
* @m_since_latest
*/
Backquote = SDLK_BACKQUOTE,
/* no equivalent for GlfwApplication's World1 / World2 */
Zero = SDLK_0, /**< Zero */
One = SDLK_1, /**< One */
Two = SDLK_2, /**< Two */

Loading…
Cancel
Save