示例#1
0
Boolean MCScreenDC::abortkey()
{ /* check for Command-. system abort key */
	if (MCabortscript)
		return True;
	static uint4 alarmcount;
	uint4 newcount = TickCount();
	if (newcount < alarmcount)
		return False;
	alarmcount = newcount + 30;
			
	// MW-2008-07-31: [[ Bug 6850 ]] Variable watcher breaks out when using scroll wheel.
	//   This bug was caused by the previous version of checking for an abortkey causing
	//   Carbon events to be handled. This can result in things such WheelUp/WheelDown
	//   events being dispatched *inside* previous invocations.
	if (CheckEventQueueForUserCancel())
	{
		if (MCallowinterrupts && !MCdefaultstackptr -> cantabort())
			return True;
		else
			MCinterrupt = True;
			
		// OK-2010-04-29: [[Bug]] - cantAbort / allowInterrupts not working on OS X
		return False;
	}
			
	if (MCnsockets != 0)
		MCS_handle_sockets();
	return False;
}
示例#2
0
static PyObject *Evt_CheckEventQueueForUserCancel(PyObject *_self, PyObject *_args)
{
    PyObject *_res = NULL;
    Boolean _rv;
#ifndef CheckEventQueueForUserCancel
    PyMac_PRECHECK(CheckEventQueueForUserCancel);
#endif
    if (!PyArg_ParseTuple(_args, ""))
        return NULL;
    _rv = CheckEventQueueForUserCancel();
    _res = Py_BuildValue("b",
                         _rv);
    return _res;
}