diff --git a/gltools/@include/glfwLib.pxd b/gltools/@include/glfwLib.pxd index 388b3e7..1696054 100644 --- a/gltools/@include/glfwLib.pxd +++ b/gltools/@include/glfwLib.pxd @@ -271,7 +271,7 @@ cdef extern from "GLFW/glfw3.h": ctypedef void (* GLFWcursorposfun)(GLFWwindow *,double,double) ctypedef void (* GLFWcursorenterfun)(GLFWwindow *,int) ctypedef void (* GLFWscrollfun)(GLFWwindow *,double,double) - ctypedef void (* GLFWkeyfun)(GLFWwindow *,int,int) + ctypedef void (* GLFWkeyfun)(GLFWwindow *,int,int,int,int) ctypedef void (* GLFWcharfun)(GLFWwindow *,int) ctypedef void (* GLFWmonitorfun)(c_GLFWmonitor,int) diff --git a/gltools/@src/GLFW.pxi b/gltools/@src/GLFW.pxi index aa0dfb1..b0cb864 100644 --- a/gltools/@src/GLFW.pxi +++ b/gltools/@src/GLFW.pxi @@ -280,8 +280,8 @@ cdef class Window: Callback on mouse button press or release ''' pass - - cpdef onKey(self, int key, int action): + + cpdef onKey(self, int key, int scancode, int action, int mods): ''' Callback on key press or relase. ''' @@ -355,11 +355,11 @@ cdef void cb_onMouseButton(GLFWwindow *window, int button, int action): except Exception as err: self.error = err -cdef void cb_onKey(GLFWwindow *window, int key, int action): +cdef void cb_onKey(GLFWwindow *window, int key, int scancode, int action, int mods): cdef Window self = glfwGetWindowUserPointer(window) try: - self.onKey(key, action) + self.onKey(key, scancode, action, mods) except Exception as err: self.error = err diff --git a/gltools/gltools.pxd b/gltools/gltools.pxd index 6afdb20..f4bd64b 100644 --- a/gltools/gltools.pxd +++ b/gltools/gltools.pxd @@ -77,7 +77,7 @@ cdef class Window: cpdef onRefresh(self) cpdef onCursorPos(self, double x, double y) cpdef onMouseButton(self, int button, int action) - cpdef onKey(self, int key, int action) + cpdef onKey(self, int key, int scancode, int action, int mods) cpdef onChar(self, ch) cpdef onFocus(self, int status) cpdef onEnter(self, int status) diff --git a/gltools/test.py b/gltools/test.py index e5f8b6c..8080b51 100644 --- a/gltools/test.py +++ b/gltools/test.py @@ -306,7 +306,7 @@ class MainWindow(gl.Window): self.onRefresh() - def onKey(self, key, action): + def onKey(self, key, scancode, action, mods): #print('onKey ', key, action) if key == gl.KEY.ESCAPE: self.running = False