NHDT->ANH, nethack->anethack, nhdat->anhdat
[aNetHack.git] / win / win32 / mhinput.h
blobc384941f7a3d0130abc9b71a86f5bb9f9932c97d
1 /* aNetHack 0.0.1 mhinput.h $ANH-Date: 1432512812 2015/05/25 00:13:32 $ $ANH-Branch: master $:$ANH-Revision: 1.10 $ */
2 /* Copyright (C) 2001 by Alex Kompel */
3 /* aNetHack may be freely redistributed. See license for details. */
5 #ifndef MSWINInput_h
6 #define MSWINInput_h
8 /* anethack input queue - store/extract input events */
9 #include "winMS.h"
11 #define NHEVENT_CHAR 1
12 #define NHEVENT_MOUSE 2
13 typedef struct mswin_event {
14 int type;
15 union {
16 struct {
17 int ch;
18 } kbd;
20 struct {
21 int mod;
22 int x, y;
23 } ms;
25 } MSNHEvent, *PMSNHEvent;
27 #define NHEVENT_KBD(c) \
28 { \
29 MSNHEvent e; \
30 e.type = NHEVENT_CHAR; \
31 e.kbd.ch = (c); \
32 mswin_input_push(&e); \
34 #define NHEVENT_MS(_mod, _x, _y) \
35 { \
36 MSNHEvent e; \
37 e.type = NHEVENT_MOUSE; \
38 e.ms.mod = (_mod); \
39 e.ms.x = (_x); \
40 e.ms.y = (_y); \
41 mswin_input_push(&e); \
44 void mswin_nh_input_init(void);
45 int mswin_have_input(void);
46 void mswin_input_push(PMSNHEvent event);
47 PMSNHEvent mswin_input_pop(void);
48 PMSNHEvent mswin_input_peek(void);
50 #endif /* MSWINInput_h */