Browse Source

input: fix a very old bug in input handling that would miss some keys.

legacy
Sam Hocevar 6 years ago
parent
commit
f2d7fa0549
2 changed files with 3 additions and 4 deletions
  1. +3
    -3
      src/ui/input.cpp
  2. +0
    -1
      src/ui/keys.inc

+ 3
- 3
src/ui/input.cpp View File

@@ -93,7 +93,7 @@ void InputDeviceInternal::AddKey(int index, const char* name)


while (index >= (int)m_key_names.size()) while (index >= (int)m_key_names.size())
{ {
m_key_names.push_back(name);
m_key_names.push_back("");
m_keys.push_back(false); m_keys.push_back(false);
} }


@@ -107,7 +107,7 @@ void InputDeviceInternal::AddAxis(int index, const char* name, float sensitivity


while (index >= (int)m_axis_names.size()) while (index >= (int)m_axis_names.size())
{ {
m_axis_names.push_back(name);
m_axis_names.push_back("");
m_axis.push(0.0f, 1.0f); m_axis.push(0.0f, 1.0f);
} }


@@ -123,7 +123,7 @@ void InputDeviceInternal::AddCursor(int index, const char* name)


while (index >= (int)m_cursor_names.size()) while (index >= (int)m_cursor_names.size())
{ {
m_cursor_names.push_back(name);
m_cursor_names.push_back("");
m_cursors.push(vec2::zero, ivec2::zero); m_cursors.push(vec2::zero, ivec2::zero);
} }




+ 0
- 1
src/ui/keys.inc View File

@@ -22,7 +22,6 @@ _SC(0, "", Unknown)


/* Usage page 0x07 */ /* Usage page 0x07 */


_SC(3, "", Whatever) // FIXME: if this isn’t here, we can’t bind key A; WTF?
_SC(4, "A", A) _SC(4, "A", A)
_SC(5, "B", B) _SC(5, "B", B)
_SC(6, "C", C) _SC(6, "C", C)


Loading…
Cancel
Save