mirror of
https://github.com/glfw/glfw.git
synced 2026-09-22 16:52:57 +00:00
Removed Unicode character actions, updated events test.
This commit is contained in:
+1
-1
@@ -276,7 +276,7 @@ void _glfwClearWindowHints(void);
|
||||
void _glfwClearInput(_GLFWwindow* window);
|
||||
void _glfwInputDeactivation(_GLFWwindow* window);
|
||||
void _glfwInputKey(_GLFWwindow* window, int key, int action);
|
||||
void _glfwInputChar(_GLFWwindow* window, int character, int action);
|
||||
void _glfwInputChar(_GLFWwindow* window, int character);
|
||||
void _glfwInputMouseClick(_GLFWwindow* window, int button, int action);
|
||||
|
||||
// OpenGL extensions (glext.c)
|
||||
|
||||
+2
-30
@@ -149,7 +149,7 @@ void _glfwInputKey(_GLFWwindow* window, int key, int action)
|
||||
// Register (keyboard) character activity
|
||||
//========================================================================
|
||||
|
||||
void _glfwInputChar(_GLFWwindow* window, int character, int action)
|
||||
void _glfwInputChar(_GLFWwindow* window, int character)
|
||||
{
|
||||
int keyrepeat = 0;
|
||||
|
||||
@@ -157,36 +157,8 @@ void _glfwInputChar(_GLFWwindow* window, int character, int action)
|
||||
if (!((character >= 32 && character <= 126) || character >= 160))
|
||||
return;
|
||||
|
||||
// Is this a key repeat?
|
||||
if (action == GLFW_PRESS && window->lastChar == character)
|
||||
keyrepeat = 1;
|
||||
|
||||
// Store this character as last character (or clear it, if released)
|
||||
if (action == GLFW_PRESS)
|
||||
window->lastChar = character;
|
||||
else
|
||||
window->lastChar = 0;
|
||||
|
||||
if (action != GLFW_PRESS)
|
||||
{
|
||||
// This intentionally breaks release notifications for Unicode
|
||||
// characters, partly to see if anyone cares but mostly because it's
|
||||
// a nonsensical concept to begin with
|
||||
//
|
||||
// It will remain broken either until its removal in the 3.0 API or
|
||||
// until someone explains, in a way that makes sense to people outside
|
||||
// the US and Scandinavia, what "Unicode character up" actually means
|
||||
//
|
||||
// If what you want is "physical key up" then you should be using the
|
||||
// key functions and/or the key callback, NOT the Unicode input
|
||||
//
|
||||
// However, if your particular application uses this misfeature for...
|
||||
// something, you can re-enable it by removing this if-statement
|
||||
return;
|
||||
}
|
||||
|
||||
if (window->charCallback && (window->keyRepeat || !keyrepeat))
|
||||
window->charCallback(window, character, action);
|
||||
window->charCallback(window, character);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1027,7 +1027,7 @@ static GLboolean processSingleEvent(void)
|
||||
_glfwInputKey(window, translateKey(event.xkey.keycode), GLFW_PRESS);
|
||||
|
||||
// Translate and report character input
|
||||
_glfwInputChar(window, translateChar(&event.xkey), GLFW_PRESS);
|
||||
_glfwInputChar(window, translateChar(&event.xkey));
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -1065,9 +1065,6 @@ static GLboolean processSingleEvent(void)
|
||||
// Translate and report key release
|
||||
_glfwInputKey(window, translateKey(event.xkey.keycode), GLFW_RELEASE);
|
||||
|
||||
// Translate and report character input
|
||||
_glfwInputChar(window, translateChar(&event.xkey), GLFW_RELEASE);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user