mirror of
https://github.com/python/cpython.git
synced 2025-11-18 01:57:37 +00:00
Added mac-only intrpeek routine that peeks for command-.
This commit is contained in:
parent
7874d1fe7e
commit
febf811a2d
1 changed files with 30 additions and 5 deletions
|
|
@ -24,11 +24,6 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
|
||||||
/* Check for interrupts */
|
/* Check for interrupts */
|
||||||
|
|
||||||
#ifdef THINK_C
|
|
||||||
#include <MacHeaders>
|
|
||||||
#define macintosh
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -36,6 +31,14 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#include "myproto.h"
|
#include "myproto.h"
|
||||||
#include "intrcheck.h"
|
#include "intrcheck.h"
|
||||||
|
|
||||||
|
#ifdef macintosh
|
||||||
|
#ifdef THINK_C
|
||||||
|
#include <OSEvents.h>
|
||||||
|
#endif
|
||||||
|
#include <Events.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef QUICKWIN
|
#ifdef QUICKWIN
|
||||||
|
|
||||||
|
|
@ -161,6 +164,28 @@ intrcheck()
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* intrpeek() is like intrcheck(), but it doesn't flush the events. The
|
||||||
|
** idea is that you call intrpeek() somewhere in a busy-wait loop, and return
|
||||||
|
** None as soon as it returns 0. The mainloop will then pick up the cmd-. soon
|
||||||
|
** thereafter.
|
||||||
|
*/
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
#define OK
|
#define OK
|
||||||
|
|
||||||
#endif /* macintosh */
|
#endif /* macintosh */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue