mirror of
https://github.com/glfw/glfw.git
synced 2026-09-22 08:50:15 +00:00
Replaced repeat kluge with detectable auto repeat.
This commit is contained in:
@@ -470,6 +470,8 @@ static void detectEWMH(void)
|
||||
|
||||
static GLboolean initDisplay(void)
|
||||
{
|
||||
Bool supported;
|
||||
|
||||
_glfw.x11.display = XOpenDisplay(NULL);
|
||||
if (!_glfw.x11.display)
|
||||
{
|
||||
@@ -528,6 +530,14 @@ static GLboolean initDisplay(void)
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
XkbSetDetectableAutoRepeat(_glfw.x11.display, True, &supported);
|
||||
if (!supported)
|
||||
{
|
||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||
"X11: Detectable key repeat is not available");
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
// Update the key code LUT
|
||||
// FIXME: We should listen to XkbMapNotify events to track changes to
|
||||
// the keyboard mapping.
|
||||
|
||||
Reference in New Issue
Block a user