emGetMouseState.3p
967 Bytes
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
.TH emGetMouseState 3P local "Silicon Graphics, Inc."
.SH NAME
emGetMouseState \- get mouse location and button state
.SH SYNOPSIS
.nf
#include <em.h>
.sp
void emGetMouseState(MouseState *ms);
.fi
.SH DESCRIPTION
This procedure allows the application to sample the mouse cursor location
and the mouse button state when run under the emulator.
The contents of the MouseState structure is as follows:
.sp
.nf
typedef struct {
int x;
int y;
unsigned int buttons;
} MouseState;
#define BUTTON_LEFT 0x4
#define BUTTON_MIDDLE 0x2
#define BUTTON_RIGHT 0x1
.fi
.sp
The contents of the
.I x
and
.I y
fields will be set to the mouse cursor position relative to the top left
corner of the emulation window.
The x value is clamped to a value between [0,width) and the
x value is clamped to [0,height).
.sp
The
.I buttons
field will have the
.I BUTTON_LEFT,
.I BUTTON_MIDDLE,
or
.I BUTTON_RIGHT
bit(s) set if the left, middle, or right button is depressed.