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 <
kos/cdefs.h
>
23
__BEGIN_DECLS
24
25
#include <stdint.h>
26
#include <
kos/regfield.h
>
27
28
/** \defgroup mouse Mouse
29
\brief Driver for the Dreamcast's Mouse Input Device
30
\ingroup peripherals
31
*/
32
33
/** \defgroup mouse_buttons Buttons
34
\brief Masks for the buttons on a mouse
35
\ingroup mouse
36
37
These are the possible buttons to press on a maple bus mouse.
38
39
@{
40
*/
41
#define MOUSE_RIGHTBUTTON BIT(1)
/**< \brief Right mouse button */
42
#define MOUSE_LEFTBUTTON BIT(2)
/**< \brief Left mouse button */
43
#define MOUSE_SIDEBUTTON BIT(3)
/**< \brief Side mouse button */
44
/** @} */
45
46
/** \brief Mouse center value in the raw condition structure.
47
\ingroup mouse
48
*/
49
#define MOUSE_DELTA_CENTER 0x200
50
51
/** \cond */
52
typedef
struct
{
53
uint16_t buttons;
54
uint16_t dummy1;
55
int16_t dx;
56
int16_t dy;
57
int16_t dz;
58
uint16_t dummy2;
59
uint32_t dummy3;
60
uint32_t dummy4;
61
} mouse_cond_t;
62
/** \endcond */
63
64
/* More civilized mouse structure. There are several significant
65
differences in data interpretation between the "cooked" and
66
the old "raw" structs:
67
68
- buttons are zero-based: a 1-bit means the button is PRESSED
69
- no dummy values
70
71
Note that this is what maple_dev_status() will return.
72
*/
73
74
/** \brief Mouse status structure.
75
\ingroup mouse
76
77
This structure contains information about the status of the mouse device,
78
and can be fetched with maple_dev_status().
79
80
\headerfile dc/maple/mouse.h
81
*/
82
typedef
struct
{
83
/** \brief Buttons pressed bitmask.
84
\see mouse_buttons
85
*/
86
uint32_t
buttons
;
87
88
/** \brief X movement value */
89
int
dx
;
90
91
/** \brief Y movement value */
92
int
dy
;
93
94
/** \brief Z movement value */
95
int
dz
;
96
}
mouse_state_t
;
97
98
/* \cond */
99
/* Init / Shutdown */
100
void
mouse_init(
void
);
101
void
mouse_shutdown(
void
);
102
/* \endcond */
103
104
__END_DECLS
105
106
#endif
/* __DC_MAPLE_MOUSE_H */
107
cdefs.h
Various common macros used throughout the codebase.
regfield.h
Macros to help dealing with register fields.
mouse_state_t
Mouse status structure.
Definition
mouse.h:82
mouse_state_t::dz
int dz
Z movement value.
Definition
mouse.h:95
mouse_state_t::dy
int dy
Y movement value.
Definition
mouse.h:92
mouse_state_t::dx
int dx
X movement value.
Definition
mouse.h:89
mouse_state_t::buttons
uint32_t buttons
Buttons pressed bitmask.
Definition
mouse.h:86
kernel
arch
dreamcast
include
dc
maple
mouse.h
Generated by
1.12.0