Browse Source

Rename ImGuiKey_LeftControl to ImGuiKey_LeftCtrl, ImGuiKey_RightControl to ImGuiKey_RightCtrl + made key order match mods order. (#4858)

pull/4923/head
ocornut 3 years ago
parent
commit
92c4ff1c2f
  1. 4
      backends/imgui_impl_allegro5.cpp
  2. 4
      backends/imgui_impl_android.cpp
  3. 4
      backends/imgui_impl_glfw.cpp
  4. 4
      backends/imgui_impl_glut.cpp
  5. 10
      backends/imgui_impl_osx.mm
  6. 4
      backends/imgui_impl_sdl.cpp
  7. 8
      backends/imgui_impl_win32.cpp
  8. 4
      imgui.cpp
  9. 6
      imgui.h

4
backends/imgui_impl_allegro5.cpp

@ -329,12 +329,12 @@ static ImGuiKey ImGui_ImplAllegro5_KeyCodeToImGuiKey(int key_code)
case ALLEGRO_KEY_PAD_PLUS: return ImGuiKey_KeypadAdd; case ALLEGRO_KEY_PAD_PLUS: return ImGuiKey_KeypadAdd;
case ALLEGRO_KEY_PAD_ENTER: return ImGuiKey_KeypadEnter; case ALLEGRO_KEY_PAD_ENTER: return ImGuiKey_KeypadEnter;
case ALLEGRO_KEY_PAD_EQUALS: return ImGuiKey_KeypadEqual; case ALLEGRO_KEY_PAD_EQUALS: return ImGuiKey_KeypadEqual;
case ALLEGRO_KEY_LCTRL: return ImGuiKey_LeftCtrl;
case ALLEGRO_KEY_LSHIFT: return ImGuiKey_LeftShift; case ALLEGRO_KEY_LSHIFT: return ImGuiKey_LeftShift;
case ALLEGRO_KEY_LCTRL: return ImGuiKey_LeftControl;
case ALLEGRO_KEY_ALT: return ImGuiKey_LeftAlt; case ALLEGRO_KEY_ALT: return ImGuiKey_LeftAlt;
case ALLEGRO_KEY_LWIN: return ImGuiKey_LeftSuper; case ALLEGRO_KEY_LWIN: return ImGuiKey_LeftSuper;
case ALLEGRO_KEY_RCTRL: return ImGuiKey_RightCtrl;
case ALLEGRO_KEY_RSHIFT: return ImGuiKey_RightShift; case ALLEGRO_KEY_RSHIFT: return ImGuiKey_RightShift;
case ALLEGRO_KEY_RCTRL: return ImGuiKey_RightControl;
case ALLEGRO_KEY_ALTGR: return ImGuiKey_RightAlt; case ALLEGRO_KEY_ALTGR: return ImGuiKey_RightAlt;
case ALLEGRO_KEY_RWIN: return ImGuiKey_RightSuper; case ALLEGRO_KEY_RWIN: return ImGuiKey_RightSuper;
case ALLEGRO_KEY_MENU: return ImGuiKey_Menu; case ALLEGRO_KEY_MENU: return ImGuiKey_Menu;

4
backends/imgui_impl_android.cpp

@ -101,12 +101,12 @@ static ImGuiKey ImGui_ImplAndroid_KeyCodeToImGuiKey(int32_t key_code)
case AKEYCODE_NUMPAD_ADD: return ImGuiKey_KeypadAdd; case AKEYCODE_NUMPAD_ADD: return ImGuiKey_KeypadAdd;
case AKEYCODE_NUMPAD_ENTER: return ImGuiKey_KeypadEnter; case AKEYCODE_NUMPAD_ENTER: return ImGuiKey_KeypadEnter;
case AKEYCODE_NUMPAD_EQUALS: return ImGuiKey_KeypadEqual; case AKEYCODE_NUMPAD_EQUALS: return ImGuiKey_KeypadEqual;
case AKEYCODE_CTRL_LEFT: return ImGuiKey_LeftCtrl;
case AKEYCODE_SHIFT_LEFT: return ImGuiKey_LeftShift; case AKEYCODE_SHIFT_LEFT: return ImGuiKey_LeftShift;
case AKEYCODE_CTRL_LEFT: return ImGuiKey_LeftControl;
case AKEYCODE_ALT_LEFT: return ImGuiKey_LeftAlt; case AKEYCODE_ALT_LEFT: return ImGuiKey_LeftAlt;
case AKEYCODE_META_LEFT: return ImGuiKey_LeftSuper; case AKEYCODE_META_LEFT: return ImGuiKey_LeftSuper;
case AKEYCODE_CTRL_RIGHT: return ImGuiKey_RightCtrl;
case AKEYCODE_SHIFT_RIGHT: return ImGuiKey_RightShift; case AKEYCODE_SHIFT_RIGHT: return ImGuiKey_RightShift;
case AKEYCODE_CTRL_RIGHT: return ImGuiKey_RightControl;
case AKEYCODE_ALT_RIGHT: return ImGuiKey_RightAlt; case AKEYCODE_ALT_RIGHT: return ImGuiKey_RightAlt;
case AKEYCODE_META_RIGHT: return ImGuiKey_RightSuper; case AKEYCODE_META_RIGHT: return ImGuiKey_RightSuper;
case AKEYCODE_MENU: return ImGuiKey_Menu; case AKEYCODE_MENU: return ImGuiKey_Menu;

4
backends/imgui_impl_glfw.cpp

@ -179,11 +179,11 @@ static ImGuiKey ImGui_ImplGlfw_KeyToImGuiKey(int key)
case GLFW_KEY_KP_ENTER: return ImGuiKey_KeypadEnter; case GLFW_KEY_KP_ENTER: return ImGuiKey_KeypadEnter;
case GLFW_KEY_KP_EQUAL: return ImGuiKey_KeypadEqual; case GLFW_KEY_KP_EQUAL: return ImGuiKey_KeypadEqual;
case GLFW_KEY_LEFT_SHIFT: return ImGuiKey_LeftShift; case GLFW_KEY_LEFT_SHIFT: return ImGuiKey_LeftShift;
case GLFW_KEY_LEFT_CONTROL: return ImGuiKey_LeftControl; case GLFW_KEY_LEFT_CONTROL: return ImGuiKey_LeftCtrl;
case GLFW_KEY_LEFT_ALT: return ImGuiKey_LeftAlt; case GLFW_KEY_LEFT_ALT: return ImGuiKey_LeftAlt;
case GLFW_KEY_LEFT_SUPER: return ImGuiKey_LeftSuper; case GLFW_KEY_LEFT_SUPER: return ImGuiKey_LeftSuper;
case GLFW_KEY_RIGHT_SHIFT: return ImGuiKey_RightShift; case GLFW_KEY_RIGHT_SHIFT: return ImGuiKey_RightShift;
case GLFW_KEY_RIGHT_CONTROL: return ImGuiKey_RightControl; case GLFW_KEY_RIGHT_CONTROL: return ImGuiKey_RightCtrl;
case GLFW_KEY_RIGHT_ALT: return ImGuiKey_RightAlt; case GLFW_KEY_RIGHT_ALT: return ImGuiKey_RightAlt;
case GLFW_KEY_RIGHT_SUPER: return ImGuiKey_RightSuper; case GLFW_KEY_RIGHT_SUPER: return ImGuiKey_RightSuper;
case GLFW_KEY_MENU: return ImGuiKey_Menu; case GLFW_KEY_MENU: return ImGuiKey_Menu;

4
backends/imgui_impl_glut.cpp

@ -93,12 +93,12 @@ static ImGuiKey ImGui_ImplGLUT_KeyToImGuiKey(int key)
case 43: return ImGuiKey_KeypadAdd; case 43: return ImGuiKey_KeypadAdd;
//case 13: return ImGuiKey_KeypadEnter; //case 13: return ImGuiKey_KeypadEnter;
//case 0: return ImGuiKey_KeypadEqual; //case 0: return ImGuiKey_KeypadEqual;
case 256 + 0x0072: return ImGuiKey_LeftCtrl;
case 256 + 0x0070: return ImGuiKey_LeftShift; case 256 + 0x0070: return ImGuiKey_LeftShift;
case 256 + 0x0072: return ImGuiKey_LeftControl;
case 256 + 0x0074: return ImGuiKey_LeftAlt; case 256 + 0x0074: return ImGuiKey_LeftAlt;
//case 0: return ImGuiKey_LeftSuper; //case 0: return ImGuiKey_LeftSuper;
case 256 + 0x0073: return ImGuiKey_RightCtrl;
case 256 + 0x0071: return ImGuiKey_RightShift; case 256 + 0x0071: return ImGuiKey_RightShift;
case 256 + 0x0073: return ImGuiKey_RightControl;
case 256 + 0x0075: return ImGuiKey_RightAlt; case 256 + 0x0075: return ImGuiKey_RightAlt;
//case 0: return ImGuiKey_RightSuper; //case 0: return ImGuiKey_RightSuper;
//case 0: return ImGuiKey_Menu; //case 0: return ImGuiKey_Menu;

10
backends/imgui_impl_osx.mm

@ -301,15 +301,15 @@ static ImGuiKey ImGui_ImplOSX_KeyCodeToImGuiKey(int key_code)
case kVK_Space: return ImGuiKey_Space; case kVK_Space: return ImGuiKey_Space;
case kVK_Delete: return ImGuiKey_Backspace; case kVK_Delete: return ImGuiKey_Backspace;
case kVK_Escape: return ImGuiKey_Escape; case kVK_Escape: return ImGuiKey_Escape;
case kVK_Command: return ImGuiKey_LeftSuper;
case kVK_Shift: return ImGuiKey_LeftShift;
case kVK_CapsLock: return ImGuiKey_CapsLock; case kVK_CapsLock: return ImGuiKey_CapsLock;
case kVK_Control: return ImGuiKey_LeftCtrl;
case kVK_Shift: return ImGuiKey_LeftShift;
case kVK_Option: return ImGuiKey_LeftAlt; case kVK_Option: return ImGuiKey_LeftAlt;
case kVK_Control: return ImGuiKey_LeftControl; case kVK_Command: return ImGuiKey_LeftSuper;
case kVK_RightCommand: return ImGuiKey_RightSuper; case kVK_RightControl: return ImGuiKey_RightCtrl;
case kVK_RightShift: return ImGuiKey_RightShift; case kVK_RightShift: return ImGuiKey_RightShift;
case kVK_RightOption: return ImGuiKey_RightAlt; case kVK_RightOption: return ImGuiKey_RightAlt;
case kVK_RightControl: return ImGuiKey_RightControl; case kVK_RightCommand: return ImGuiKey_RightSuper;
// case kVK_Function: return ImGuiKey_; // case kVK_Function: return ImGuiKey_;
// case kVK_F17: return ImGuiKey_; // case kVK_F17: return ImGuiKey_;
// case kVK_VolumeUp: return ImGuiKey_; // case kVK_VolumeUp: return ImGuiKey_;

4
backends/imgui_impl_sdl.cpp

@ -162,12 +162,12 @@ static ImGuiKey ImGui_ImplSDL2_KeycodeToImGuiKey(int keycode)
case SDLK_KP_PLUS: return ImGuiKey_KeypadAdd; case SDLK_KP_PLUS: return ImGuiKey_KeypadAdd;
case SDLK_KP_ENTER: return ImGuiKey_KeypadEnter; case SDLK_KP_ENTER: return ImGuiKey_KeypadEnter;
case SDLK_KP_EQUALS: return ImGuiKey_KeypadEqual; case SDLK_KP_EQUALS: return ImGuiKey_KeypadEqual;
case SDLK_LCTRL: return ImGuiKey_LeftCtrl;
case SDLK_LSHIFT: return ImGuiKey_LeftShift; case SDLK_LSHIFT: return ImGuiKey_LeftShift;
case SDLK_LCTRL: return ImGuiKey_LeftControl;
case SDLK_LALT: return ImGuiKey_LeftAlt; case SDLK_LALT: return ImGuiKey_LeftAlt;
case SDLK_LGUI: return ImGuiKey_LeftSuper; case SDLK_LGUI: return ImGuiKey_LeftSuper;
case SDLK_RCTRL: return ImGuiKey_RightCtrl;
case SDLK_RSHIFT: return ImGuiKey_RightShift; case SDLK_RSHIFT: return ImGuiKey_RightShift;
case SDLK_RCTRL: return ImGuiKey_RightControl;
case SDLK_RALT: return ImGuiKey_RightAlt; case SDLK_RALT: return ImGuiKey_RightAlt;
case SDLK_RGUI: return ImGuiKey_RightSuper; case SDLK_RGUI: return ImGuiKey_RightSuper;
case SDLK_MENU: return ImGuiKey_Menu; case SDLK_MENU: return ImGuiKey_Menu;

8
backends/imgui_impl_win32.cpp

@ -411,11 +411,11 @@ static ImGuiKey ImGui_ImplWin32_VirtualKeyToImGuiKey(WPARAM wParam)
case VK_ADD: return ImGuiKey_KeypadAdd; case VK_ADD: return ImGuiKey_KeypadAdd;
case IM_VK_KEYPAD_ENTER: return ImGuiKey_KeypadEnter; case IM_VK_KEYPAD_ENTER: return ImGuiKey_KeypadEnter;
case VK_LSHIFT: return ImGuiKey_LeftShift; case VK_LSHIFT: return ImGuiKey_LeftShift;
case VK_LCONTROL: return ImGuiKey_LeftControl; case VK_LCONTROL: return ImGuiKey_LeftCtrl;
case VK_LMENU: return ImGuiKey_LeftAlt; case VK_LMENU: return ImGuiKey_LeftAlt;
case VK_LWIN: return ImGuiKey_LeftSuper; case VK_LWIN: return ImGuiKey_LeftSuper;
case VK_RSHIFT: return ImGuiKey_RightShift; case VK_RSHIFT: return ImGuiKey_RightShift;
case VK_RCONTROL: return ImGuiKey_RightControl; case VK_RCONTROL: return ImGuiKey_RightCtrl;
case VK_RMENU: return ImGuiKey_RightAlt; case VK_RMENU: return ImGuiKey_RightAlt;
case VK_RWIN: return ImGuiKey_RightSuper; case VK_RWIN: return ImGuiKey_RightSuper;
case VK_APPS: return ImGuiKey_Menu; case VK_APPS: return ImGuiKey_Menu;
@ -588,8 +588,8 @@ IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hwnd, UINT msg, WPARA
} }
else if (vk == VK_CONTROL) else if (vk == VK_CONTROL)
{ {
if (IsVkDown(VK_LCONTROL) == is_key_down) { ImGui_ImplWin32_AddKeyEvent(ImGuiKey_LeftControl, is_key_down, VK_LCONTROL, scancode); } if (IsVkDown(VK_LCONTROL) == is_key_down) { ImGui_ImplWin32_AddKeyEvent(ImGuiKey_LeftCtrl, is_key_down, VK_LCONTROL, scancode); }
if (IsVkDown(VK_RCONTROL) == is_key_down) { ImGui_ImplWin32_AddKeyEvent(ImGuiKey_RightControl, is_key_down, VK_RCONTROL, scancode); } if (IsVkDown(VK_RCONTROL) == is_key_down) { ImGui_ImplWin32_AddKeyEvent(ImGuiKey_RightCtrl, is_key_down, VK_RCONTROL, scancode); }
} }
else if (vk == VK_MENU) else if (vk == VK_MENU)
{ {

4
imgui.cpp

@ -7414,8 +7414,8 @@ static const char* const GKeyNames[] =
"Backslash", "RightBracket", "GraveAccent", "CapsLock", "ScrollLock", "NumLock", "PrintScreen", "Backslash", "RightBracket", "GraveAccent", "CapsLock", "ScrollLock", "NumLock", "PrintScreen",
"Pause", "Keypad0", "Keypad1", "Keypad2", "Keypad3", "Keypad4", "Keypad5", "Keypad6", "Pause", "Keypad0", "Keypad1", "Keypad2", "Keypad3", "Keypad4", "Keypad5", "Keypad6",
"Keypad7", "Keypad8", "Keypad9", "KeypadDecimal", "KeypadDivide", "KeypadMultiply", "Keypad7", "Keypad8", "Keypad9", "KeypadDecimal", "KeypadDivide", "KeypadMultiply",
"KeypadSubtract", "KeypadAdd", "KeypadEnter", "KeypadEqual", "LeftShift", "LeftControl", "KeypadSubtract", "KeypadAdd", "KeypadEnter", "KeypadEqual", "LeftCtrl", "LeftShift",
"LeftAlt", "LeftSuper", "RightShift", "RightControl", "RightAlt", "RightSuper", "Menu", "LeftAlt", "LeftSuper", "RightCtrl", "RightShift", "RightAlt", "RightSuper", "Menu",
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H",
"I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z",
"F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12" "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12"

6
imgui.h

@ -65,7 +65,7 @@ Index of this file:
// Version // Version
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals. Work in progress versions typically starts at XYY99 then bounce up to XYY00, XYY01 etc. when release tagging happens) // (Integer encoded as XYYZZ for use in #if preprocessor conditionals. Work in progress versions typically starts at XYY99 then bounce up to XYY00, XYY01 etc. when release tagging happens)
#define IMGUI_VERSION "1.87 WIP" #define IMGUI_VERSION "1.87 WIP"
#define IMGUI_VERSION_NUM 18605 #define IMGUI_VERSION_NUM 18606
#define IMGUI_CHECKVERSION() ImGui::DebugCheckVersionAndDataLayout(IMGUI_VERSION, sizeof(ImGuiIO), sizeof(ImGuiStyle), sizeof(ImVec2), sizeof(ImVec4), sizeof(ImDrawVert), sizeof(ImDrawIdx)) #define IMGUI_CHECKVERSION() ImGui::DebugCheckVersionAndDataLayout(IMGUI_VERSION, sizeof(ImGuiIO), sizeof(ImGuiStyle), sizeof(ImVec2), sizeof(ImVec4), sizeof(ImDrawVert), sizeof(ImDrawIdx))
#define IMGUI_HAS_TABLE #define IMGUI_HAS_TABLE
@ -1391,12 +1391,12 @@ enum ImGuiKey_
ImGuiKey_KeypadAdd, ImGuiKey_KeypadAdd,
ImGuiKey_KeypadEnter, ImGuiKey_KeypadEnter,
ImGuiKey_KeypadEqual, ImGuiKey_KeypadEqual,
ImGuiKey_LeftCtrl,
ImGuiKey_LeftShift, ImGuiKey_LeftShift,
ImGuiKey_LeftControl,
ImGuiKey_LeftAlt, ImGuiKey_LeftAlt,
ImGuiKey_LeftSuper, ImGuiKey_LeftSuper,
ImGuiKey_RightCtrl,
ImGuiKey_RightShift, ImGuiKey_RightShift,
ImGuiKey_RightControl,
ImGuiKey_RightAlt, ImGuiKey_RightAlt,
ImGuiKey_RightSuper, ImGuiKey_RightSuper,
ImGuiKey_Menu, ImGuiKey_Menu,

Loading…
Cancel
Save