mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
Added HandleEvent method to macos, so python programs can hand back
events they don't want to handle to stdio
This commit is contained in:
parent
8828fcf738
commit
a76382a6ac
3 changed files with 39 additions and 13 deletions
|
@ -202,6 +202,19 @@ MacOS_EnableAppswitch(PyObject *self, PyObject *args)
|
|||
return Py_None;
|
||||
}
|
||||
|
||||
|
||||
static PyObject *
|
||||
MacOS_HandleEvent(PyObject *self, PyObject *args)
|
||||
{
|
||||
EventRecord ev;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "O&", PyMac_GetEventRecord, &ev))
|
||||
return NULL;
|
||||
PyMac_HandleEvent(&ev);
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
}
|
||||
|
||||
static PyMethodDef MacOS_Methods[] = {
|
||||
{"AcceptHighLevelEvent", MacOS_AcceptHighLevelEvent, 1},
|
||||
{"GetCreatorAndType", MacOS_GetCreatorAndType, 1},
|
||||
|
@ -211,6 +224,7 @@ static PyMethodDef MacOS_Methods[] = {
|
|||
#endif
|
||||
{"SetScheduleTimes", MacOS_SetScheduleTimes, 1},
|
||||
{"EnableAppswitch", MacOS_EnableAppswitch, 1},
|
||||
{"HandleEvent", MacOS_HandleEvent, 1},
|
||||
{NULL, NULL} /* Sentinel */
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue