summaryrefslogtreecommitdiff
path: root/lib/nes/app/input/input-device.hh
diff options
context:
space:
mode:
authorHannes Schulze <haschu0103@outlook.de>2025-02-01 23:32:55 +0100
committerHannes Schulze <haschu0103@outlook.de>2025-02-01 23:32:55 +0100
commit8062afc25e895cb49e76f6e26e51a7d4a1ad2df2 (patch)
treef64e6522a84a8f58912b9e58a66c187fbcaadd78 /lib/nes/app/input/input-device.hh
parentbf88e17d552d85cd18bc31757ef9d73049b327c4 (diff)
revamp input system
Diffstat (limited to 'lib/nes/app/input/input-device.hh')
-rw-r--r--lib/nes/app/input/input-device.hh23
1 files changed, 1 insertions, 22 deletions
diff --git a/lib/nes/app/input/input-device.hh b/lib/nes/app/input/input-device.hh
index 8e54f61..cc03057 100644
--- a/lib/nes/app/input/input-device.hh
+++ b/lib/nes/app/input/input-device.hh
@@ -15,28 +15,7 @@ namespace nes::app
auto operator=(input_device const&) -> input_device& = delete;
auto operator=(input_device&&) -> input_device& = delete;
- virtual auto read_key_up() -> bool = 0;
- virtual auto read_key_down() -> bool = 0;
- virtual auto read_key_left() -> bool = 0;
- virtual auto read_key_right() -> bool = 0;
- virtual auto read_key_a() -> bool = 0;
- virtual auto read_key_b() -> bool = 0;
- virtual auto read_key_select() -> bool = 0;
- virtual auto read_key_start() -> bool = 0;
-
- auto read_mask() -> sys::button_mask
- {
- auto res = sys::button_mask{};
- if (read_key_up()) { res.add(sys::buttons::up); }
- if (read_key_down()) { res.add(sys::buttons::down); }
- if (read_key_left()) { res.add(sys::buttons::left); }
- if (read_key_right()) { res.add(sys::buttons::right); }
- if (read_key_a()) { res.add(sys::buttons::a); }
- if (read_key_b()) { res.add(sys::buttons::b); }
- if (read_key_select()) { res.add(sys::buttons::select); }
- if (read_key_start()) { res.add(sys::buttons::start); }
- return res;
- }
+ virtual auto read_buttons() -> sys::button_mask = 0;
protected:
explicit input_device() = default;