fix: Shortcuts not working correctly with non-western keyboards

This commit is contained in:
WerWolv
2023-11-17 20:27:42 +01:00
parent e7bfa483f8
commit 2d45dce075
3 changed files with 31 additions and 35 deletions

View File

@@ -1044,7 +1044,7 @@ namespace hex {
#if !defined(OS_WEB)
// Register key press callback
glfwSetKeyCallback(this->m_window, [](GLFWwindow *window, int key, int scancode, int action, int mods) {
glfwSetKeyCallback(this->m_window, [](GLFWwindow *window, int key, int, int action, int mods) {
hex::unused(mods);
auto win = static_cast<Window *>(glfwGetWindowUserPointer(window));
@@ -1057,10 +1057,6 @@ namespace hex {
if (key == GLFW_KEY_UNKNOWN) return;
auto keyName = glfwGetKeyName(key, scancode);
if (keyName != nullptr)
key = std::toupper(keyName[0]);
if (action == GLFW_PRESS || action == GLFW_REPEAT) {
if (key != GLFW_KEY_LEFT_CONTROL && key != GLFW_KEY_RIGHT_CONTROL &&
key != GLFW_KEY_LEFT_ALT && key != GLFW_KEY_RIGHT_ALT &&