New cmd-. handling for the mac.

This commit is contained in:
Jack Jansen 1995-01-26 16:20:38 +00:00
parent da88dadabd
commit 51f4b8dc78
1 changed files with 21 additions and 15 deletions

View File

@ -141,8 +141,11 @@ initintr()
signal(SIGINT, intcatcher); signal(SIGINT, intcatcher);
} }
int #ifdef THINK_C
intrcheck() /* MPW and MW runtime catch cmd-. and raise SIGINT, THINK does not, it seems */
static void
scan_event_queue(flush)
int flush;
{ {
register EvQElPtr q; register EvQElPtr q;
@ -152,11 +155,22 @@ intrcheck()
if (q->evtQWhat == keyDown && if (q->evtQWhat == keyDown &&
(char)q->evtQMessage == '.' && (char)q->evtQMessage == '.' &&
(q->evtQModifiers & cmdKey) != 0) { (q->evtQModifiers & cmdKey) != 0) {
FlushEvents(keyDownMask, 0); if ( flush )
FlushEvents(keyDownMask, 0);
interrupted = 1; interrupted = 1;
break; break;
} }
} }
}
#endif
int
intrcheck()
{
#ifdef THINK_C
scan_event_queue(1);
#endif
PyMac_Yield();
if (interrupted) { if (interrupted) {
interrupted = 0; interrupted = 0;
return 1; return 1;
@ -172,18 +186,10 @@ intrcheck()
int int
intrpeek() intrpeek()
{ {
register EvQElPtr q; #ifdef THINK_C
scan_event_queue(0);
q = (EvQElPtr) GetEvQHdr()->qHead; #endif
return interrupted;
for (; q; q = (EvQElPtr)q->qLink) {
if (q->evtQWhat == keyDown &&
(char)q->evtQMessage == '.' &&
(q->evtQModifiers & cmdKey) != 0) {
return 1;
}
}
return 0;
} }
#define OK #define OK