OSDN Git Service

Initial Import
[nethackexpress/trunk.git] / sys / wince / mhinput.h
1 /* Copyright (C) 2001 by Alex Kompel <shurikk@pacbell.net> */
2 /* NetHack may be freely redistributed.  See license for details. */
3
4 #ifndef MSWINInput_h
5 #define MSWINInput_h
6
7 /* nethack input queue - store/extract input events */
8 #include "winMS.h"
9
10 #define NHEVENT_CHAR    1
11 #define NHEVENT_MOUSE   2
12 typedef struct mswin_event {
13         int type;
14         union {
15                 struct {
16                         int  ch;
17                 } kbd;
18
19                 struct {
20                         int mod;
21                         int x, y;
22                 } ms;
23         };
24 } MSNHEvent, *PMSNHEvent;
25
26 #define NHEVENT_KBD(c) { MSNHEvent e; e.type=NHEVENT_CHAR; e.kbd.ch=(c); mswin_input_push(&e); }
27 #define NHEVENT_MS(_mod, _x, _y) { MSNHEvent e; e.type=NHEVENT_MOUSE; e.ms.mod = (_mod); e.ms.x=(_x); e.ms.y=(_y); mswin_input_push(&e); }
28
29 void            mswin_nh_input_init();
30 int                     mswin_have_input();
31 void            mswin_input_push(PMSNHEvent event);
32 PMSNHEvent      mswin_input_pop();
33 PMSNHEvent      mswin_input_peek();
34
35 #endif /* MSWINInput_h */
36