Match key names

This commit is contained in:
Kovid Goyal 2021-05-08 10:29:42 +05:30
parent 417c81de60
commit e811f03011
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -123,10 +123,10 @@ encode_mouse_scroll(Window *w, bool upwards, int mods) {
// }}}
static inline void
dispatch_mouse_event(Window *w, int button, int count, int modifiers) {
dispatch_mouse_event(Window *w, int button, int count, int modifiers, bool grabbed) {
if (w->render_data.screen && PyCallable_Check(w->render_data.screen->callbacks)) {
PyObject *callback_ret = PyObject_CallMethod(w->render_data.screen->callbacks, "on_mouse_event", "{si si si}",
"button", button, "count", count, "modifiers", modifiers);
PyObject *callback_ret = PyObject_CallMethod(w->render_data.screen->callbacks, "on_mouse_event", "{si si si sO}",
"button", button, "repeat_count", count, "mods", modifiers, "grabbed", grabbed ? Py_True : Py_False);
if (callback_ret == NULL) PyErr_Print();
else Py_DECREF(callback_ret);
}