mirror of
https://github.com/TomHarte/CLK.git
synced 2024-12-28 22:30:30 +00:00
37 lines
746 B
C++
37 lines
746 B
C++
//
|
|
// 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"
|
|
#include "../../../Inputs/Mouse.hpp"
|
|
|
|
namespace Apple::ADB {
|
|
|
|
class Mouse: public ReactiveDevice, public Inputs::Mouse {
|
|
public:
|
|
Mouse(Bus &);
|
|
|
|
private:
|
|
void perform_command(const Command &command) override;
|
|
|
|
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;
|
|
};
|
|
|
|
}
|
|
|
|
#endif /* Mouse_hpp */
|