2021-02-13 02:50:24 +00:00
|
|
|
//
|
|
|
|
// Mouse.hpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 12/02/2021.
|
|
|
|
// Copyright © 2021 Thomas Harte. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef Mouse_hpp
|
|
|
|
#define Mouse_hpp
|
|
|
|
|
|
|
|
#include "ReactiveDevice.hpp"
|
2021-02-16 01:49:16 +00:00
|
|
|
#include "../../../Inputs/Mouse.hpp"
|
2021-02-13 02:50:24 +00:00
|
|
|
|
2023-05-10 21:02:18 +00:00
|
|
|
namespace Apple::ADB {
|
2021-02-13 02:50:24 +00:00
|
|
|
|
2021-02-16 01:49:16 +00:00
|
|
|
class Mouse: public ReactiveDevice, public Inputs::Mouse {
|
2021-02-13 02:50:24 +00:00
|
|
|
public:
|
|
|
|
Mouse(Bus &);
|
|
|
|
|
2021-02-14 04:16:45 +00:00
|
|
|
private:
|
2021-02-13 22:53:40 +00:00
|
|
|
void perform_command(const Command &command) override;
|
2021-02-16 01:49:16 +00:00
|
|
|
|
|
|
|
void move(int x, int y) override;
|
|
|
|
int get_number_of_buttons() override;
|
|
|
|
void set_button_pressed(int index, bool is_pressed) override;
|
|
|
|
void reset_all_buttons() override;
|
|
|
|
|
|
|
|
std::atomic<int16_t> delta_x_, delta_y_;
|
|
|
|
std::atomic<int> button_flags_ = 0;
|
|
|
|
uint16_t last_posted_reg0_ = 0;
|
2021-02-13 02:50:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* Mouse_hpp */
|