Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
875eb7d9
Commit
875eb7d9
authored
Jan 16, 1991
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mac version now looks ahead in event queue instead of eating events.
Much better!
parent
d9bf55d0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
10 deletions
+35
-10
Parser/intrcheck.c
Parser/intrcheck.c
+35
-10
No files found.
Parser/intrcheck.c
View file @
875eb7d9
...
...
@@ -27,26 +27,52 @@ intrcheck()
#ifdef THINK_C
/* This is for THINK C 4.0.
For 3.0, you may have to remove the signal stuff. */
#include <MacHeaders>
#include <signal.h>
#include "sigtype.h"
static
int
interrupted
;
static
SIGTYPE
intcatcher
(
sig
)
int
sig
;
{
interrupted
=
1
;
signal
(
SIGINT
,
intcatcher
);
}
void
initintr
()
{
if
(
signal
(
SIGINT
,
SIG_IGN
)
!=
SIG_IGN
)
signal
(
SIGINT
,
intcatcher
);
}
int
intrcheck
()
{
/* Static to make it faster only */
static
EventRecord
e
;
register
EvQElPtr
q
;
/* XXX This fails if the user first types ahead and then
decides to interrupt -- repeating Command-. until the
event queue overflows may work though. */
if
(
EventAvail
(
keyDownMask
|
autoKeyMask
,
&
e
)
&&
(
e
.
modifiers
&
cmdKey
)
&&
(
e
.
message
&
charCodeMask
)
==
'.'
)
{
(
void
)
GetNextEvent
(
keyDownMask
|
autoKeyMask
,
&
e
);
/* This is like THINK C 4.0's <console.h>.
I'm not sure why FlushEvents must be called from asm{}. */
for
(
q
=
(
EvQElPtr
)
EventQueue
.
qHead
;
q
;
q
=
(
EvQElPtr
)
q
->
qLink
)
{
if
(
q
->
evtQWhat
==
keyDown
&&
(
char
)
q
->
evtQMessage
==
'.'
&&
(
q
->
evtQModifiers
&
cmdKey
)
!=
0
)
{
asm
{
moveq
#
keyDownMask
,
d0
_FlushEvents
}
interrupted
=
1
;
break
;
}
}
if
(
interrupted
)
{
interrupted
=
0
;
return
1
;
}
return
0
;
...
...
@@ -63,7 +89,6 @@ intrcheck()
#include <stdio.h>
#include <signal.h>
#include "sigtype.h"
static
int
interrupted
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment