Browse Source

Platform: add various *Application::KeyEvent::Key TODOs.

It's a far worse mess than I expected.
pull/638/head
Vladimír Vondruš 2 years ago
parent
commit
589b3e594d
  1. 29
      src/Magnum/Platform/EmscriptenApplication.h
  2. 38
      src/Magnum/Platform/GlfwApplication.h
  3. 28
      src/Magnum/Platform/Sdl2Application.h

29
src/Magnum/Platform/EmscriptenApplication.h

@ -1821,11 +1821,30 @@ class EmscriptenApplication::KeyEvent: public EmscriptenApplication::InputEvent
Comma, /**< Comma */
Period, /**< Period */
Minus, /**< Minus */
/* Note: This may only be represented as SHIFT + = */
Plus, /**< Plus */
/**
* Plus
* @todo Impossible to represent via a scancode on US layout
* (Shift + =). The reason this was included is that it was in
* Sdl2App which historically uses layout-dependent keycodes
* instead of scancodes because otherwise Z and Y would be
* swapped on QWERTZ layouts (unlike GLFW and HTML5), which is
* a far worse problem.
*/
Plus,
Slash, /**< Slash */
/* Note: This may only be represented as SHIFT + 5 */
Percent, /**< Percent */
/**
* Percent
* @todo Impossible to represent via a scancode on US layout
* (Shift + 5). The reason this was included is that it was in
* Sdl2App which historically uses layout-dependent keycodes
* instead of scancodes because otherwise Z and Y would be
* swapped on QWERTZ layouts (unlike GLFW and HTML5), which is
* a far worse problem.
*/
Percent,
/**
* Semicolon (`;`)
@ -1840,6 +1859,8 @@ class EmscriptenApplication::KeyEvent: public EmscriptenApplication::InputEvent
Backquote, /**< Backquote (<tt>`</tt>) */
/* no equivalent for GlfwApplication's World1 / World2 */
/** @todo there's IntlBackslash for World1, implement once there's
consensus about naming */
CapsLock, /**< Caps lock */
ScrollLock, /**< Scroll lock */

38
src/Magnum/Platform/GlfwApplication.h

@ -1704,11 +1704,31 @@ class GlfwApplication::KeyEvent: public GlfwApplication::InputEvent {
Comma = GLFW_KEY_COMMA, /**< Comma */
Period = GLFW_KEY_PERIOD, /**< Period */
Minus = GLFW_KEY_MINUS, /**< Minus */
/* Note: This may only be represented as SHIFT + = */
Plus = '+', /**< Plus */
/**
* Plus
* @todo Impossible to represent via a scancode on US layout
* (Shift + =). The reason this was included is that it was in
* Sdl2App which historically uses layout-dependent keycodes
* instead of scancodes because otherwise Z and Y would be
* swapped on QWERTZ layouts (unlike GLFW and HTML5), which is
* a far worse problem.
*/
Plus = '+',
Slash = GLFW_KEY_SLASH, /**< Slash */
/* Note: This may only be represented as SHIFT + 5 */
Percent = '%', /**< Percent */
/**
* Percent
* @todo Impossible to represent via a scancode on US layout
* (Shift + 5). The reason this was included is that it was in
* Sdl2App which historically uses layout-dependent keycodes
* instead of scancodes because otherwise Z and Y would be
* swapped on QWERTZ layouts (unlike GLFW and HTML5), which is
* a far worse problem.
*/
Percent = '%',
Semicolon = GLFW_KEY_SEMICOLON, /**< Semicolon (`;`) */
#ifdef MAGNUM_BUILD_DEPRECATED
@ -1734,6 +1754,7 @@ class GlfwApplication::KeyEvent: public GlfwApplication::InputEvent {
/**
* Backslash (`\`)
* @see @ref Key::World1, @ref Key::World2
* @m_since{2020,06}
*/
Backslash = GLFW_KEY_BACKSLASH,
@ -1745,13 +1766,20 @@ class GlfwApplication::KeyEvent: public GlfwApplication::InputEvent {
Backquote = GLFW_KEY_GRAVE_ACCENT,
/**
* Non-US \#1
* Non-US \#1. Can be for example a backslash (`\`) next to left
* Shift.
* @see @ref Key::Backslash
* @m_since{2020,06}
* @todo Revisit / rename together with World2 once
* https://github.com/glfw/glfw/issues/2481 is resolved. SDL
* scancode for this key is SDL_SCANCODE_NONUSBACKSLASH, HTML5
* names it IntlBackslash.
*/
World1 = GLFW_KEY_WORLD_1,
/**
* Non-US \#2
* @see @ref Key::Backslash
* @m_since{2020,06}
*/
World2 = GLFW_KEY_WORLD_2,

28
src/Magnum/Platform/Sdl2Application.h

@ -2166,6 +2166,7 @@ class Sdl2Application::InputEvent {
* AltGr
*
* @see @ref KeyEvent::Key::AltGr
* @todo AltGr gets reported as RightAlt, what's this for?
*/
AltGr = KMOD_MODE,
@ -2304,6 +2305,7 @@ class Sdl2Application::KeyEvent: public Sdl2Application::InputEvent {
* AltGr
*
* @see @ref InputEvent::Modifier::AltGr
* @todo AltGr gets reported as RightAlt, what's this for?
*/
AltGr = SDLK_MODE,
@ -2347,9 +2349,31 @@ class Sdl2Application::KeyEvent: public Sdl2Application::InputEvent {
Comma = SDLK_COMMA, /**< Comma */
Period = SDLK_PERIOD, /**< Period */
Minus = SDLK_MINUS, /**< Minus */
Plus = SDLK_PLUS, /**< Plus */
/**
* Plus
* @todo Impossible to represent via a scancode on US layout
* (Shift + =). The reason this was included is that Sdl2App
* historically uses layout-dependent keycodes instead of
* scancodes because otherwise Z and Y would be swapped on
* QWERTZ layouts (unlike GLFW and HTML5), which is a far
* worse problem.
*/
Plus = SDLK_PLUS,
Slash = SDLK_SLASH, /**< Slash */
Percent = SDLK_PERCENT, /**< Percent */
/**
* Percent
* @todo Impossible to represent via a scancode on US layout
* (Shift + 5). The reason this was included is that Sdl2App
* historically uses layout-dependent keycodes instead of
* scancodes because otherwise Z and Y would be swapped on
* QWERTZ layouts (unlike GLFW and HTML5), which is a far
* worse problem.
*/
Percent = SDLK_PERCENT,
Semicolon = SDLK_SEMICOLON, /**< Semicolon (`;`) */
Equal = SDLK_EQUALS, /**< Equal */

Loading…
Cancel
Save