diff options
Diffstat (limited to 'app/mac/impl/input-device-gc-gamepad.hh')
| -rw-r--r-- | app/mac/impl/input-device-gc-gamepad.hh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/app/mac/impl/input-device-gc-gamepad.hh b/app/mac/impl/input-device-gc-gamepad.hh new file mode 100644 index 0000000..b4b4a4e --- /dev/null +++ b/app/mac/impl/input-device-gc-gamepad.hh @@ -0,0 +1,24 @@ +#pragma once + +#import "nes/app/input/input-device-controller.hh" + +#import <GameController/GameController.h> + +namespace nes::app::mac +{ + /// Input device wrapping a GCExtendedGamepad. + class input_device_gc_gamepad final : public input_device_controller + { + GCExtendedGamepad* profile_; + + public: + explicit input_device_gc_gamepad(GCExtendedGamepad* profile); + + auto is_reliable() const -> bool override { return true; } + auto get_controller() const -> GCController* { return [profile_ controller]; } + auto get_name() const -> std::string_view override; + auto get_index() const -> index override; + auto set_index(index) -> void override; + auto read_buttons() -> sys::button_mask override; + }; +} // namespace nes::app::mac
\ No newline at end of file |
