File: mhinput.h

package info (click to toggle)
glhack 1.2-4
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, buster
  • size: 26,744 kB
  • sloc: ansic: 208,571; cpp: 13,139; yacc: 2,005; makefile: 1,155; lex: 377; sh: 121; awk: 89; sed: 11
file content (35 lines) | stat: -rw-r--r-- 892 bytes parent folder | download | duplicates (23)
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
/* Copyright (C) 2001 by Alex Kompel <shurikk@pacbell.net> */
/* NetHack may be freely redistributed.  See license for details. */

#ifndef MSWINInput_h
#define MSWINInput_h

/* nethack input queue - store/extract input events */
#include "winMS.h"

#define NHEVENT_CHAR	1
#define NHEVENT_MOUSE	2
typedef struct mswin_event {
	int type;
	union {
		struct {
			int  ch;
		} kbd;

		struct {
			int mod;
			int x, y;
		} ms;
	};
} MSNHEvent, *PMSNHEvent;

#define NHEVENT_KBD(c) { MSNHEvent e; e.type=NHEVENT_CHAR; e.kbd.ch=(c); mswin_input_push(&e); }
#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); }

void		mswin_nh_input_init(void);
int			mswin_have_input(void);
void		mswin_input_push(PMSNHEvent event);
PMSNHEvent	mswin_input_pop(void);
PMSNHEvent	mswin_input_peek(void);

#endif /* MSWINInput_h */