dingusppc/devices/common/adb/adbkeyboard.h
Mihai Parparita 35c86ad6bf Clean up #includes
Result of running IWYU (https://include-what-you-use.org/) and
applying most of the suggestions about unncessary includes and
forward declarations.

Was motivated by observing that <thread> was being included in
ppcopcodes.cpp even though it was unused (found while researching
the use of threads), but seems generally good to help with build
times and correctness.
2023-11-03 00:33:47 -07:00

60 lines
1.7 KiB
C++

/*
DingusPPC - The Experimental PowerPC Macintosh emulator
Copyright (C) 2018-23 divingkatae and maximum
(theweirdo) spatium
(Contact divingkatae#1017 or powermax#2286 on Discord for more info)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/** @file Apple Desktop Bus Keyboard definitions. */
#ifndef ADB_KEYBOARD_H
#define ADB_KEYBOARD_H
#include <devices/common/adb/adbdevice.h>
#include <devices/common/hwcomponent.h>
#include <memory>
#include <string>
class KeyboardEvent;
class AdbKeyboard : public AdbDevice {
public:
AdbKeyboard(std::string name);
~AdbKeyboard() = default;
static std::unique_ptr<HWComponent> create() {
return std::unique_ptr<AdbKeyboard>(new AdbKeyboard("ADB-KEYBOARD"));
}
void reset() override;
void event_handler(const KeyboardEvent& event);
bool get_register_0() override;
void set_register_2() override;
void set_register_3() override;
private:
int32_t x_rel = 0;
int32_t y_rel = 0;
uint8_t buttons_state = 0;
bool changed = false;
};
#endif // ADB_KEYBOARD_H