emGetMouseState.3p 967 Bytes
.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.