KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches
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 Megan Potter
5
6*/
7
8/** \file dc/maple/mouse.h
9 \brief Definitions for using the mouse device.
10 \ingroup mouse
11
12 This file contains the definitions needed to access the Maple mouse type
13 device.
14
15 \author Jordan DeLong
16 \author Megan Potter
17*/
18
19#ifndef __DC_MAPLE_MOUSE_H
20#define __DC_MAPLE_MOUSE_H
21
22#include <sys/cdefs.h>
23__BEGIN_DECLS
24
25#include <stdint.h>
26
27/** \defgroup mouse Mouse
28 \brief Driver for the Dreamcast's Mouse Input Device
29 \ingroup peripherals
30*/
31
32/** \defgroup mouse_buttons Buttons
33 \brief Masks for the buttons on a mouse
34 \ingroup mouse
35
36 These are the possible buttons to press on a maple bus mouse.
37
38 @{
39*/
40#define MOUSE_RIGHTBUTTON (1<<1) /**< \brief Right mouse button */
41#define MOUSE_LEFTBUTTON (1<<2) /**< \brief Left mouse button */
42#define MOUSE_SIDEBUTTON (1<<3) /**< \brief Side mouse button */
43/** @} */
44
45/** \brief Mouse center value in the raw condition structure.
46 \ingroup mouse
47 */
48#define MOUSE_DELTA_CENTER 0x200
49
50/** \cond */
51typedef struct {
52 uint16_t buttons;
53 uint16_t dummy1;
54 int16_t dx;
55 int16_t dy;
56 int16_t dz;
57 uint16_t dummy2;
58 uint32_t dummy3;
59 uint32_t dummy4;
60} mouse_cond_t;
61/** \endcond */
62
63/* More civilized mouse structure. There are several significant
64 differences in data interpretation between the "cooked" and
65 the old "raw" structs:
66
67 - buttons are zero-based: a 1-bit means the button is PRESSED
68 - no dummy values
69
70 Note that this is what maple_dev_status() will return.
71 */
72
73/** \brief Mouse status structure.
74 \ingroup mouse
75
76 This structure contains information about the status of the mouse device,
77 and can be fetched with maple_dev_status().
78
79 \headerfile dc/maple/mouse.h
80*/
81typedef struct {
82 /** \brief Buttons pressed bitmask.
83 \see mouse_buttons
84 */
85 uint32_t buttons;
86
87 /** \brief X movement value */
88 int dx;
89
90 /** \brief Y movement value */
91 int dy;
92
93 /** \brief Z movement value */
94 int dz;
96
97/* \cond */
98/* Init / Shutdown */
99void mouse_init(void);
100void mouse_shutdown(void);
101/* \endcond */
102
103__END_DECLS
104
105#endif /* __DC_MAPLE_MOUSE_H */
106
Mouse status structure.
Definition mouse.h:81
int dz
Z movement value.
Definition mouse.h:94
int dy
Y movement value.
Definition mouse.h:91
int dx
X movement value.
Definition mouse.h:88
uint32_t buttons
Buttons pressed bitmask.
Definition mouse.h:85