From 948f66b0650e21db346f7f6955fb04ad1d0b5e9e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 29 Nov 2016 20:30:52 +0530 Subject: [PATCH] Forgot to wrap a function --- kitty/glfw.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/kitty/glfw.c b/kitty/glfw.c index 7baae141a..1c26ac27e 100644 --- a/kitty/glfw.c +++ b/kitty/glfw.c @@ -218,6 +218,13 @@ get_clipboard_string(Window *self) { return Py_BuildValue("s", glfwGetClipboardString(self->window)); } +static PyObject* +get_cursor_pos(Window *self) { + double x=0, y=0; + glfwGetCursorPos(self->window, &x, &y); + return Py_BuildValue("dd", x, y); +} + static PyObject* set_should_close(Window *self, PyObject *args) { int c; @@ -257,6 +264,7 @@ _set_title(Window *self, PyObject *args) { static PyMethodDef methods[] = { MND(swap_buffers, METH_NOARGS), MND(get_clipboard_string, METH_NOARGS), + MND(get_cursor_pos, METH_NOARGS), MND(should_close, METH_NOARGS), MND(set_should_close, METH_VARARGS), MND(is_key_pressed, METH_VARARGS),