1 /* NetHack 3.6 winkey.c $NHDT-Date: 1432512794 2015/05/25 00:13:14 $ $NHDT-Branch: master $:$NHDT-Revision: 1.7 $ */
2 /* Copyright (c) Gregg Wonderly, Naperville, Illinois, 1991,1992,1993. */
3 /* NetHack may be freely redistributed. See license for details. */
5 #include "NH:sys/amiga/windefs.h"
6 #include "NH:sys/amiga/winext.h"
7 #include "NH:sys/amiga/winproto.h"
9 amii_nh_poskey(x
, y
, mod
) int *x
, *y
, *mod
;
11 struct amii_WinDesc
*cw
;
16 if (cw
= amii_wins
[WIN_MESSAGE
]) {
17 cw
->wflags
&= ~FLMAP_SKIP
;
19 cw
->wflags
|= FLMSG_FIRST
;
23 if (WIN_MAP
!= WIN_ERR
&& (cw
= amii_wins
[WIN_MAP
]) && (w
= cw
->win
)) {
26 panic("no MAP window opened for nh_poskey\n");
31 type
= WindowGetevent();
32 if (type
== WEMOUSE
) {
34 if (lastevent
.un
.mouse
.qual
)
37 /* X coordinates are 1 based, Y are 1 based. */
38 *x
= ((lastevent
.un
.mouse
.x
- w
->BorderLeft
) / mxsize
) + 1;
39 *y
= ((lastevent
.un
.mouse
.y
- w
->BorderTop
- MAPFTBASELN
)
48 } else if (type
== WEKEY
) {
49 lastevent
.type
= WEUNK
;
50 return (lastevent
.un
.key
);
59 struct amii_WinDesc
*cw
= amii_wins
[WIN_MESSAGE
];
61 if (WIN_MAP
!= WIN_ERR
&& amii_wins
[WIN_MAP
]) {
65 cw
->wflags
&= ~FLMAP_SKIP
;
74 /* nothing now - later I have no idea. Is this just a Mac hook? */
83 raw_print("Press Return...");
87 while (c
!= '\n' && c
!= '\r') {