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/* More civilized mouse structure. There are several significant
47 differences in data interpretation between the "cooked" and
48 the old "raw" structs:
49
50 - buttons are zero-based: a 1-bit means the button is PRESSED
51 - no dummy values
52
53 Note that this is what maple_dev_status() will return.
54 */
55
56/** \brief Mouse status structure.
57 \ingroup mouse
58
59 This structure contains information about the status of the mouse device,
60 and can be fetched with maple_dev_status().
61
62 \headerfile dc/maple/mouse.h
63*/
64typedef struct {
65 /** \brief Buttons pressed bitmask.
66 \see mouse_buttons
67 */
68 uint32_t buttons;
69
70 /** \brief X movement value */
71 int dx;
72
73 /** \brief Y movement value */
74 int dy;
75
76 /** \brief Z movement value */
77 int dz;
79
80/* \cond */
81/* Init / Shutdown */
82void mouse_init(void);
83void mouse_shutdown(void);
84/* \endcond */
85
86__END_DECLS
87
88#endif /* __DC_MAPLE_MOUSE_H */
89
Various common macros used throughout the codebase.
Macros to help dealing with register fields.
Mouse status structure.
Definition mouse.h:64
int dz
Z movement value.
Definition mouse.h:77
int dy
Y movement value.
Definition mouse.h:74
int dx
X movement value.
Definition mouse.h:71
uint32_t buttons
Buttons pressed bitmask.
Definition mouse.h:68