mirror of
https://github.com/encounter/aurora.git
synced 2026-07-09 18:19:33 -07:00
c21a7f75ab
* Add experimental mouse API * Add aurora::core library for aurora::ms * Add absl::flat_hash_map library for aurora::ms * Add comment clarifying MS is an aurora extension * Clear MSStatus::buttons to prevent spurious values * Minor cleanup for MSRead and MS_BUTTON_* bits * Switch to Poll -> Read paradigm * Clear mouse scroll state before polling for events
36 lines
687 B
C
36 lines
687 B
C
// Aurora exclusive API extension
|
|
// While the GC and Wii could both technically support mice, they never received official libraries
|
|
// This library is a theoretical implementation based loosely on PAD
|
|
#ifndef DOLPHIN_MS_H
|
|
#define DOLPHIN_MS_H
|
|
#include "types.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef struct MSStatus {
|
|
f32 x;
|
|
f32 y;
|
|
f32 xrel;
|
|
f32 yrel;
|
|
u32 buttons;
|
|
f32 scrollX;
|
|
f32 scrollY;
|
|
} MSStatus;
|
|
|
|
#define MS_BUTTON_LEFT (1 << 0)
|
|
#define MS_BUTTON_MIDDLE (1 << 1)
|
|
#define MS_BUTTON_RIGHT (1 << 2)
|
|
#define MS_BUTTON_X1 (1 << 3)
|
|
#define MS_BUTTON_X2 (1 << 4)
|
|
|
|
void MSPoll();
|
|
void MSRead(MSStatus* status);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif // DUSK_MS_H
|