1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
include <mach.h>
include "iis.h"
include "../lib/ids.h"
# IISBUTTON -- Read, button status
procedure iisbutton (cnum, x, y, key)
int cnum # cursor number
int x,y # coordinates
int key # key pressed
short status
int and()
include "iis.com"
begin
call iishdr (IREAD, 1, CURSOR+COMMAND, 0, 0, 0, 0)
call iisio (status, 1 * SZB_CHAR)
if ( cnum == IDS_BUT_WT ) {
while ( and (int(status), PUSH) == 0 ) {
call tsleep(1)
call iisio (status, 1 * SZB_CHAR)
}
}
if ( and ( int(status), PUSH) == 0 )
key = 0
else {
status = and ( int(status), 7400B) / 256
switch(status) {
case 4:
status = 3
case 8:
status = 4
}
key = status
}
end
|