Skip to content

Commit

Permalink
- add some missing keybinds
Browse files Browse the repository at this point in the history
  • Loading branch information
kaffeewolf committed Nov 28, 2024
1 parent f951531 commit fc3b4e2
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 82 deletions.
20 changes: 10 additions & 10 deletions code/input/input/key.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ Key::ToString(Code code)
case Accept: return "Accept";
case ModeChange: return "ModeChange";
case Space: return "Space";
case Prior: return "Prior";
case Next: return "Next";
case PageUp: return "PageUp";
case PageDown: return "PageDown";
case End: return "End";
case Home: return "Home";
case Left: return "Left";
Expand Down Expand Up @@ -414,8 +414,8 @@ Key::ToRocket(Code key)

case Escape: return 81;

case Prior: return 86;
case Next: return 87;
case PageUp: return 86;
case PageDown: return 87;
case End: return 88;
case Home: return 89;
case Left: return 90;
Expand Down Expand Up @@ -568,8 +568,8 @@ Key::Code Key::FromRocket(uint key)
case 73: return Pause;
case 74: return Capital;
case 81: return Escape;
case 86: return Prior;
case 87: return Next;
case 86: return PageUp;
case 87: return PageDown;
case 88: return End;
case 89: return Home;
case 90: return Left;
Expand Down Expand Up @@ -779,8 +779,8 @@ Key::KeyCodesByGroup(Key::Group group)
}
break;
case Key::HomeBlock:
keys.Append(Key::Prior);
keys.Append(Key::Next);
keys.Append(Key::PageUp);
keys.Append(Key::PageDown);
keys.Append(Key::Home);
keys.Append(Key::End);
keys.Append(Key::Insert);
Expand Down Expand Up @@ -830,8 +830,8 @@ Key::SetupDict()
dict.Add("Accept", Accept);
dict.Add("ModeChange", ModeChange);
dict.Add("Space", Space);
dict.Add("Prior", Prior);
dict.Add("Next", Next);
dict.Add("PageUp", PageUp);
dict.Add("PageDown", PageDown);
dict.Add("End", End);
dict.Add("Home", Home);
dict.Add("Left", Left);
Expand Down
4 changes: 2 additions & 2 deletions code/input/input/key.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ class Key
Accept,
ModeChange,
Space,
Prior,
Next,
PageUp,
PageDown,
End,
Home,
Left,
Expand Down
143 changes: 73 additions & 70 deletions code/render/coregraphics/glfw/glfwdisplaydevice.cc
Original file line number Diff line number Diff line change
Expand Up @@ -243,42 +243,44 @@ GLFWDisplayDevice::TranslateKeyCode(int inkey)
{
switch (inkey)
{
case GLFW_KEY_BACKSPACE: return Input::Key::Back;
case GLFW_KEY_BACKSPACE: return Input::Key::Back;
case GLFW_KEY_TAB: return Input::Key::Tab;
case GLFW_KEY_ENTER: return Input::Key::Return;
case GLFW_KEY_ENTER: return Input::Key::Return;
case GLFW_KEY_MENU: return Input::Key::Menu;
case GLFW_KEY_PAUSE: return Input::Key::Pause;
case GLFW_KEY_CAPS_LOCK: return Input::Key::Capital;
case GLFW_KEY_CAPS_LOCK: return Input::Key::Capital;
case GLFW_KEY_ESCAPE: return Input::Key::Escape;
case GLFW_KEY_SPACE: return Input::Key::Space;
case GLFW_KEY_END: return Input::Key::End;
case GLFW_KEY_HOME: return Input::Key::Home;
case GLFW_KEY_PAGE_UP: return Input::Key::PageUp;
case GLFW_KEY_PAGE_DOWN: return Input::Key::PageDown;
case GLFW_KEY_LEFT: return Input::Key::Left;
case GLFW_KEY_RIGHT: return Input::Key::Right;
case GLFW_KEY_UP: return Input::Key::Up;
case GLFW_KEY_DOWN: return Input::Key::Down;
case GLFW_KEY_INSERT: return Input::Key::Insert;
case GLFW_KEY_DELETE: return Input::Key::Delete;
case GLFW_KEY_LEFT_SUPER: return Input::Key::LeftWindows;
case GLFW_KEY_RIGHT_SUPER: return Input::Key::RightWindows;
case GLFW_KEY_KP_0: return Input::Key::NumPad0;
case GLFW_KEY_KP_1: return Input::Key::NumPad1;
case GLFW_KEY_KP_2: return Input::Key::NumPad2;
case GLFW_KEY_KP_3: return Input::Key::NumPad3;
case GLFW_KEY_KP_4: return Input::Key::NumPad4;
case GLFW_KEY_KP_5: return Input::Key::NumPad5;
case GLFW_KEY_KP_6: return Input::Key::NumPad6;
case GLFW_KEY_KP_7: return Input::Key::NumPad7;
case GLFW_KEY_KP_8: return Input::Key::NumPad8;
case GLFW_KEY_KP_9: return Input::Key::NumPad9;
case GLFW_KEY_KP_MULTIPLY: return Input::Key::Multiply;
case GLFW_KEY_KP_ADD: return Input::Key::Add;
case GLFW_KEY_KP_SUBTRACT: return Input::Key::Subtract;
case GLFW_KEY_COMMA: return Input::Key::Comma;
case GLFW_KEY_PERIOD: return Input::Key::Period;
case GLFW_KEY_APOSTROPHE: return Input::Key::Separator;
case GLFW_KEY_KP_DECIMAL: return Input::Key::Decimal;
case GLFW_KEY_KP_DIVIDE: return Input::Key::Divide;
case GLFW_KEY_DELETE: return Input::Key::Delete;
case GLFW_KEY_LEFT_SUPER: return Input::Key::LeftWindows;
case GLFW_KEY_RIGHT_SUPER: return Input::Key::RightWindows;
case GLFW_KEY_KP_0: return Input::Key::NumPad0;
case GLFW_KEY_KP_1: return Input::Key::NumPad1;
case GLFW_KEY_KP_2: return Input::Key::NumPad2;
case GLFW_KEY_KP_3: return Input::Key::NumPad3;
case GLFW_KEY_KP_4: return Input::Key::NumPad4;
case GLFW_KEY_KP_5: return Input::Key::NumPad5;
case GLFW_KEY_KP_6: return Input::Key::NumPad6;
case GLFW_KEY_KP_7: return Input::Key::NumPad7;
case GLFW_KEY_KP_8: return Input::Key::NumPad8;
case GLFW_KEY_KP_9: return Input::Key::NumPad9;
case GLFW_KEY_KP_MULTIPLY: return Input::Key::Multiply;
case GLFW_KEY_KP_ADD: return Input::Key::Add;
case GLFW_KEY_KP_SUBTRACT: return Input::Key::Subtract;
case GLFW_KEY_COMMA: return Input::Key::Comma;
case GLFW_KEY_PERIOD: return Input::Key::Period;
case GLFW_KEY_APOSTROPHE: return Input::Key::Separator;
case GLFW_KEY_KP_DECIMAL: return Input::Key::Decimal;
case GLFW_KEY_KP_DIVIDE: return Input::Key::Divide;
case GLFW_KEY_F1: return Input::Key::F1;
case GLFW_KEY_F2: return Input::Key::F2;
case GLFW_KEY_F3: return Input::Key::F3;
Expand All @@ -303,52 +305,53 @@ GLFWDisplayDevice::TranslateKeyCode(int inkey)
case GLFW_KEY_F22: return Input::Key::F22;
case GLFW_KEY_F23: return Input::Key::F23;
case GLFW_KEY_F24: return Input::Key::F24;
case GLFW_KEY_NUM_LOCK: return Input::Key::NumLock;
case GLFW_KEY_SCROLL_LOCK: return Input::Key::Scroll;
case GLFW_KEY_LEFT_SHIFT: return Input::Key::LeftShift;
case GLFW_KEY_RIGHT_SHIFT: return Input::Key::RightShift;
case GLFW_KEY_LEFT_CONTROL: return Input::Key::LeftControl;
case GLFW_KEY_RIGHT_CONTROL: return Input::Key::RightControl;
case GLFW_KEY_LEFT_ALT: return Input::Key::LeftMenu;
case GLFW_KEY_RIGHT_ALT: return Input::Key::RightMenu;
//case VK_OEM_3: return Input::Key::Tilde;
case GLFW_KEY_0: return Input::Key::Key0;
case GLFW_KEY_1: return Input::Key::Key1;
case GLFW_KEY_2: return Input::Key::Key2;
case GLFW_KEY_3: return Input::Key::Key3;
case GLFW_KEY_4: return Input::Key::Key4;
case GLFW_KEY_5: return Input::Key::Key5;
case GLFW_KEY_6: return Input::Key::Key6;
case GLFW_KEY_7: return Input::Key::Key7;
case GLFW_KEY_8: return Input::Key::Key8;
case GLFW_KEY_9: return Input::Key::Key9;
case GLFW_KEY_A: return Input::Key::A;
case GLFW_KEY_B: return Input::Key::B;
case GLFW_KEY_C: return Input::Key::C;
case GLFW_KEY_D: return Input::Key::D;
case GLFW_KEY_E: return Input::Key::E;
case GLFW_KEY_F: return Input::Key::F;
case GLFW_KEY_G: return Input::Key::G;
case GLFW_KEY_H: return Input::Key::H;
case GLFW_KEY_I: return Input::Key::I;
case GLFW_KEY_J: return Input::Key::J;
case GLFW_KEY_K: return Input::Key::K;
case GLFW_KEY_L: return Input::Key::L;
case GLFW_KEY_M: return Input::Key::M;
case GLFW_KEY_N: return Input::Key::N;
case GLFW_KEY_O: return Input::Key::O;
case GLFW_KEY_P: return Input::Key::P;
case GLFW_KEY_Q: return Input::Key::Q;
case GLFW_KEY_R: return Input::Key::R;
case GLFW_KEY_S: return Input::Key::S;
case GLFW_KEY_T: return Input::Key::T;
case GLFW_KEY_U: return Input::Key::U;
case GLFW_KEY_V: return Input::Key::V;
case GLFW_KEY_W: return Input::Key::W;
case GLFW_KEY_X: return Input::Key::X;
case GLFW_KEY_Y: return Input::Key::Y;
case GLFW_KEY_Z: return Input::Key::Z;
default: return Input::Key::InvalidKey;
case GLFW_KEY_NUM_LOCK: return Input::Key::NumLock;
case GLFW_KEY_SCROLL_LOCK: return Input::Key::Scroll;
case GLFW_KEY_LEFT_SHIFT: return Input::Key::LeftShift;
case GLFW_KEY_RIGHT_SHIFT: return Input::Key::RightShift;
case GLFW_KEY_LEFT_CONTROL: return Input::Key::LeftControl;
case GLFW_KEY_RIGHT_CONTROL: return Input::Key::RightControl;
case GLFW_KEY_LEFT_ALT: return Input::Key::LeftMenu;
case GLFW_KEY_RIGHT_ALT: return Input::Key::RightMenu;
case GLFW_KEY_GRAVE_ACCENT: return Input::Key::Tilde;
case GLFW_KEY_0: return Input::Key::Key0;
case GLFW_KEY_1: return Input::Key::Key1;
case GLFW_KEY_2: return Input::Key::Key2;
case GLFW_KEY_3: return Input::Key::Key3;
case GLFW_KEY_4: return Input::Key::Key4;
case GLFW_KEY_5: return Input::Key::Key5;
case GLFW_KEY_6: return Input::Key::Key6;
case GLFW_KEY_7: return Input::Key::Key7;
case GLFW_KEY_8: return Input::Key::Key8;
case GLFW_KEY_9: return Input::Key::Key9;
case GLFW_KEY_A: return Input::Key::A;
case GLFW_KEY_B: return Input::Key::B;
case GLFW_KEY_C: return Input::Key::C;
case GLFW_KEY_D: return Input::Key::D;
case GLFW_KEY_E: return Input::Key::E;
case GLFW_KEY_F: return Input::Key::F;
case GLFW_KEY_G: return Input::Key::G;
case GLFW_KEY_H: return Input::Key::H;
case GLFW_KEY_I: return Input::Key::I;
case GLFW_KEY_J: return Input::Key::J;
case GLFW_KEY_K: return Input::Key::K;
case GLFW_KEY_L: return Input::Key::L;
case GLFW_KEY_M: return Input::Key::M;
case GLFW_KEY_N: return Input::Key::N;
case GLFW_KEY_O: return Input::Key::O;
case GLFW_KEY_P: return Input::Key::P;
case GLFW_KEY_Q: return Input::Key::Q;
case GLFW_KEY_R: return Input::Key::R;
case GLFW_KEY_S: return Input::Key::S;
case GLFW_KEY_T: return Input::Key::T;
case GLFW_KEY_U: return Input::Key::U;
case GLFW_KEY_V: return Input::Key::V;
case GLFW_KEY_W: return Input::Key::W;
case GLFW_KEY_X: return Input::Key::X;
case GLFW_KEY_Y: return Input::Key::Y;
case GLFW_KEY_Z: return Input::Key::Z;
case GLFW_KEY_SEMICOLON: return Input::Key::Semicolon;
default: return Input::Key::InvalidKey;
}
return Input::Key::InvalidKey;
}
Expand Down

0 comments on commit fc3b4e2

Please sign in to comment.