Browse Source

Platform: these aren't TODOs, mere notes.

Partially reverts 589b3e594d -- I got it
backwards. It actually makes more sense from a user perspective to have
layout-dependent key identifiers, because for for e.g. using Ctrl-Z as
the "Undo" shortcut it's the most important what key the user perceives
as Z, not where that key is placed on some (again, from the user PoV
basically arbitrary) layout. For game-y usage, e.g. the WASD movement,
scancodes matter (and appropriate getters will get added), but for 90%
of actual user interfaces the local layout is how the keys should be
defined. This is consistent with e.g. how Qt does it (and it has
scancodes as an additional, completely untyped getter), another data
point that's in favor of keycodes is that SDL's SDLK_* defines are far
shorter than the corresponding SDL_SCANCODE_* scancodes.
pull/651/head
Vladimír Vondruš 2 years ago
parent
commit
3547203233
  1. 20
      src/Magnum/Platform/EmscriptenApplication.h
  2. 20
      src/Magnum/Platform/GlfwApplication.h
  3. 20
      src/Magnum/Platform/Sdl2Application.h

20
src/Magnum/Platform/EmscriptenApplication.h

@ -2369,26 +2369,18 @@ class EmscriptenApplication::KeyEvent: public EmscriptenApplication::InputEvent
Minus, /**< Minus */
/**
* 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. On the US keyboard layout this may only be representable
* as @m_class{m-label m-warning} **Shift**
* @m_class{m-label m-default} **=**.
*/
Plus,
Slash, /**< Slash */
/**
* 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. On the US keyboard layout this may only be
* representable as @m_class{m-label m-warning} **Shift**
* @m_class{m-label m-default} **5**.
*/
Percent,

20
src/Magnum/Platform/GlfwApplication.h

@ -1933,26 +1933,18 @@ class GlfwApplication::KeyEvent: public GlfwApplication::InputEvent {
Minus = GLFW_KEY_MINUS, /**< Minus */
/**
* 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. On the US keyboard layout this may only be representable
* as @m_class{m-label m-warning} **Shift**
* @m_class{m-label m-default} **=**.
*/
Plus = '+',
Slash = GLFW_KEY_SLASH, /**< Slash */
/**
* 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. On the US keyboard layout this may only be
* representable as @m_class{m-label m-warning} **Shift**
* @m_class{m-label m-default} **5**.
*/
Percent = '%',

20
src/Magnum/Platform/Sdl2Application.h

@ -2602,26 +2602,18 @@ class Sdl2Application::KeyEvent: public Sdl2Application::InputEvent {
Minus = SDLK_MINUS, /**< Minus */
/**
* 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. On the US keyboard layout this may only be representable
* as @m_class{m-label m-warning} **Shift**
* @m_class{m-label m-default} **=**.
*/
Plus = SDLK_PLUS,
Slash = SDLK_SLASH, /**< Slash */
/**
* 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. On the US keyboard layout this may only be
* representable as @m_class{m-label m-warning} **Shift**
* @m_class{m-label m-default} **5**.
*/
Percent = SDLK_PERCENT,

Loading…
Cancel
Save