Glfw: GLFW_PRESS in key callback after holding key for some time and releasing it

Created on 7 Mar 2017  ·  4Comments  ·  Source: glfw/glfw

Linux Ubuntu
glfw compile time info: 3.1.2 X11 GLX clock_gettime /dev/js XI Xf86vm shared
runtime glfw version: 3.1.2

void App::key_callback(GLFWwindow*, int key, int, int action, int)
{
    if(action == GLFW_PRESS)
        keys.pressEvent(key);
    else if(action == GLFW_RELEASE)
        keys.releaseEvent(key);
}

Afrer pressing any key i get GLFW_PRESS (action) as expected then after holding it and releasing there are following actions in given order:
-GLFW_RELEASE
-GLFW_PRESS
-GLFW RELEASE

additional press and release actions are causing some lag in my application. i dont have this issue on windows and mac os.

glfw compile time info: 3.3.0 X11 GLX EGL clock_gettime /dev/js shared
runtime glfw version: 3.3.0

still not working

X11 bug duplicate verified

All 4 comments

Possibly related to https://github.com/glfw/glfw/issues/747. Can you see if the problem occurs in the glfw events test program?

0000007a to 1 at 12,784: Key 0x0041 Scancode 0x0026 (A) (a) (with no mods) was pressed
0000007b to 1 at 12,788: Character 0x00000061 (a) with modifiers (with no mods) input
0000007c to 1 at 12,788: Character 0x00000061 (a) input
0000007d to 1 at 13,284: Key 0x0041 Scancode 0x0026 (A) (a) (with no mods) was repeated
0000007e to 1 at 13,288: Character 0x00000061 (a) with modifiers (with no mods) input
0000007f to 1 at 13,288: Character 0x00000061 (a) input
00000080 to 1 at 13,316: Key 0x0041 Scancode 0x0026 (A) (a) (with no mods) was repeated
00000081 to 1 at 13,320: Character 0x00000061 (a) with modifiers (with no mods) input
00000082 to 1 at 13,320: Character 0x00000061 (a) input
00000083 to 1 at 13,347: Key 0x0041 Scancode 0x0026 (A) (a) (with no mods) was repeated
00000084 to 1 at 13,352: Character 0x00000061 (a) with modifiers (with no mods) input
00000085 to 1 at 13,352: Character 0x00000061 (a) input
00000086 to 1 at 13,377: Key 0x0041 Scancode 0x0026 (A) (a) (with no mods) was repeated
00000087 to 1 at 13,382: Character 0x00000061 (a) with modifiers (with no mods) input
00000088 to 1 at 13,382: Character 0x00000061 (a) input
00000089 to 1 at 13,408: Key 0x0041 Scancode 0x0026 (A) (a) (with no mods) was repeated
0000008a to 1 at 13,413: Character 0x00000061 (a) with modifiers (with no mods) input
0000008b to 1 at 13,413: Character 0x00000061 (a) input
0000008c to 1 at 13,439: Key 0x0041 Scancode 0x0026 (A) (a) (with no mods) was repeated
0000008d to 1 at 13,443: Character 0x00000061 (a) with modifiers (with no mods) input
0000008e to 1 at 13,444: Character 0x00000061 (a) input
0000008f to 1 at 13,470: Key 0x0041 Scancode 0x0026 (A) (a) (with no mods) was repeated
00000090 to 1 at 13,475: Character 0x00000061 (a) with modifiers (with no mods) input
00000091 to 1 at 13,475: Character 0x00000061 (a) input
00000092 to 1 at 13,501: Key 0x0041 Scancode 0x0026 (A) (a) (with no mods) was repeated
00000093 to 1 at 13,506: Character 0x00000061 (a) with modifiers (with no mods) input
00000094 to 1 at 13,506: Character 0x00000061 (a) input
00000095 to 1 at 13,532: Key 0x0041 Scancode 0x0026 (A) (a) (with no mods) was repeated
00000096 to 1 at 13,537: Character 0x00000061 (a) with modifiers (with no mods) input
00000097 to 1 at 13,537: Character 0x00000061 (a) input
00000098 to 1 at 13,565: Key 0x0041 Scancode 0x0026 (A) (a) (with no mods) was repeated
00000099 to 1 at 13,571: Character 0x00000061 (a) with modifiers (with no mods) input
0000009a to 1 at 13,571: Character 0x00000061 (a) input
0000009b to 1 at 13,594: Key 0x0041 Scancode 0x0026 (A) (a) (with no mods) was repeated
0000009c to 1 at 13,596: Character 0x00000061 (a) with modifiers (with no mods) input
0000009d to 1 at 13,596: Character 0x00000061 (a) input
0000009e to 1 at 13,611: Key 0x0041 Scancode 0x0026 (A) (a) (with no mods) was released

hmm it seems to work correctly in events test.

This should be fixed now with 4ff66a7818e3eaa5362c828a18220b12f1cd9bc8.

works! :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MarcoLizza picture MarcoLizza  ·  4Comments

elmindreda picture elmindreda  ·  4Comments

christianparpart picture christianparpart  ·  4Comments

opengl-tutorial picture opengl-tutorial  ·  3Comments

leo150 picture leo150  ·  4Comments