KallistiOS  2.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
mouse.h
Go to the documentation of this file.
1 /* KallistiOS 2.0.0
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