KallistiOS  ##version##
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
mouse.h
Go to the documentation of this file.
1 /* KallistiOS ##version##
2 
3  dc/maple/mouse.h
4  (C)2000-2002 Jordan DeLong and Dan Potter
5 
6 */
7 
8 /** \file dc/maple/mouse.h
9  \brief Definitions for using the mouse device.
10 
11  This file contains the definitions needed to access the Maple mouse type
12  device.
13 
14  \author Jordan DeLong
15  \author Dan Potter
16 */
17 
18 #ifndef __DC_MAPLE_MOUSE_H
19 #define __DC_MAPLE_MOUSE_H
20 
21 #include <sys/cdefs.h>
22 __BEGIN_DECLS
23 
24 #include <arch/types.h>
25 
26 /** \defgroup mouse_buttons Mouse button codes
27 
28  These are the possible buttons to press on a maple bus mouse.
29 
30  @{
31 */
32 #define MOUSE_RIGHTBUTTON (1<<1) /**< \brief Right mouse button */
33 #define MOUSE_LEFTBUTTON (1<<2) /**< \brief Left mouse button */
34 #define MOUSE_SIDEBUTTON (1<<3) /**< \brief Side mouse button */
35 /** @} */
36 
37 /** \brief Mouse center value in the raw condition structure. */
38 #define MOUSE_DELTA_CENTER 0x200
39 
40 /* Raw mouse condition structure */
41 typedef struct {
50 } mouse_cond_t;
51 
52 /* More civilized mouse structure. There are several significant
53  differences in data interpretation between the "cooked" and
54  the old "raw" structs:
55 
56  - buttons are zero-based: a 1-bit means the button is PRESSED
57  - no dummy values
58 
59  Note that this is what maple_dev_status() will return.
60  */
61 
62 /** \brief Mouse status structure.
63 
64  This structure contains information about the status of the mouse device,
65  and can be fetched with maple_dev_status().
66 
67  \headerfile dc/maple/mouse.h
68 */
69 typedef struct {
70  /** \brief Buttons pressed bitmask.
71  \see mouse_buttons
72  */
74 
75  /** \brief X movement value */
76  int dx;
77 
78  /** \brief Y movement value */
79  int dy;
80 
81  /** \brief Z movement value */
82  int dz;
84 
85 /* \cond */
86 /* Init / Shutdown */
87 int mouse_init();
88 void mouse_shutdown();
89 /* \endcond */
90 
91 __END_DECLS
92 
93 #endif /* __DC_MAPLE_MOUSE_H */
94 
Definition: mouse.h:41
int dy
Y movement value.
Definition: mouse.h:79
Common integer types.
uint16 buttons
Definition: mouse.h:42
uint32 dummy4
Definition: mouse.h:49
Mouse status structure.
Definition: mouse.h:69
uint16 dummy1
Definition: mouse.h:43
int dx
X movement value.
Definition: mouse.h:76
int16 dy
Definition: mouse.h:45
int16 dx
Definition: mouse.h:44
uint32 dummy3
Definition: mouse.h:48
short int16
16-bit signed integer
Definition: types.h:33
unsigned short uint16
16-bit unsigned integer
Definition: types.h:29
uint32 buttons
Buttons pressed bitmask.
Definition: mouse.h:73
uint16 dummy2
Definition: mouse.h:47
unsigned long uint32
32-bit unsigned integer
Definition: types.h:28
int16 dz
Definition: mouse.h:46
int dz
Z movement value.
Definition: mouse.h:82