summaryrefslogtreecommitdiffstats
path: root/Parser
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1995-01-26 16:20:38 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1995-01-26 16:20:38 (GMT)
commit51f4b8dc78797b843dcd0e647c6ebf2420280d59 (patch)
tree477252868ae5b52b00ced50062038fa4d2ed479b /Parser
parentda88dadabdd0c543887003e8b8eb7c191cf4dec2 (diff)
downloadcpython-51f4b8dc78797b843dcd0e647c6ebf2420280d59.zip
cpython-51f4b8dc78797b843dcd0e647c6ebf2420280d59.tar.gz
cpython-51f4b8dc78797b843dcd0e647c6ebf2420280d59.tar.bz2
New cmd-. handling for the mac.
Diffstat (limited to 'Parser')
-rw-r--r--Parser/intrcheck.c36
1 files changed, 21 insertions, 15 deletions
diff --git a/Parser/intrcheck.c b/Parser/intrcheck.c
index aab940c..96dd484 100644
--- a/Parser/intrcheck.c
+++ b/Parser/intrcheck.c
@@ -141,8 +141,11 @@ initintr()
signal(SIGINT, intcatcher);
}
-int
-intrcheck()
+#ifdef THINK_C
+/* 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;
@@ -152,11 +155,22 @@ intrcheck()
if (q->evtQWhat == keyDown &&
(char)q->evtQMessage == '.' &&
(q->evtQModifiers & cmdKey) != 0) {
- FlushEvents(keyDownMask, 0);
+ if ( flush )
+ FlushEvents(keyDownMask, 0);
interrupted = 1;
break;
}
}
+}
+#endif
+
+int
+intrcheck()
+{
+#ifdef THINK_C
+ scan_event_queue(1);
+#endif
+ PyMac_Yield();
if (interrupted) {
interrupted = 0;
return 1;
@@ -172,18 +186,10 @@ intrcheck()
int
intrpeek()
{
- register EvQElPtr q;
-
- q = (EvQElPtr) GetEvQHdr()->qHead;
-
- for (; q; q = (EvQElPtr)q->qLink) {
- if (q->evtQWhat == keyDown &&
- (char)q->evtQMessage == '.' &&
- (q->evtQModifiers & cmdKey) != 0) {
- return 1;
- }
- }
- return 0;
+#ifdef THINK_C
+ scan_event_queue(0);
+#endif
+ return interrupted;
}
#define OK