17#include "SubComponent.h"
46 bool isShakingAbs(
double x);
47 bool isShakingRel(
double dx);
50class Mouse final :
public SubComponent {
52 Descriptions descriptions = {
55 .description =
"Mouse in Port 1"
59 .description =
"Mouse in Port 2"
63 ConfigOptions options = {
74 MouseConfig config = { };
82 class ShakeDetector shakeDetector;
85 Mouse1350 mouse1350 = Mouse1350(c64);
88 Mouse1351 mouse1351 = Mouse1351(c64);
91 NeosMouse mouseNeos = NeosMouse(c64);
112 Mouse(C64 &ref, ControlPort& pref);
114 Mouse& operator= (
const Mouse& other) {
136 void serialize(T& worker)
144 if (isResetter(worker))
return;
150 } SERIALIZERS(serialize)
159 const Descriptions &getDescriptions()
const override {
return descriptions; }
163 void _dump(Category category, std::ostream& os)
const override;
164 void _reset(
bool hard)
override;
173 const MouseConfig &getConfig()
const {
return config; }
174 const ConfigOptions &getOptions()
const override {
return options; }
175 i64 getOption(Option opt)
const override;
176 void checkOption(Option opt, i64 value)
override;
177 void setOption(Option opt, i64 value)
override;
181 void updateScalingFactors();
191 bool detectShakeXY(
double x,
double y);
192 bool detectShakeDxDy(
double dx,
double dy);
195 void setXY(
double x,
double y);
196 void setDxDy(
double dx,
double dy);
199 void setLeftButton(
bool value);
200 void setRightButton(
bool value);
203 void trigger(GamePadAction event);
207 void fallingStrobe();
210 void updateControlPort();
213 u8 getControlPort()
const;
VirtualC64 project namespace.
Definition CmdQueue.cpp:16
@ OPT_MOUSE_SHAKE_DETECT
Detect a shaking mouse.
Definition OptionTypes.h:157
@ OPT_MOUSE_VELOCITY
Mouse velocity.
Definition OptionTypes.h:158
@ OPT_MOUSE_MODEL
Mouse model.
Definition OptionTypes.h:156