From 8062afc25e895cb49e76f6e26e51a7d4a1ad2df2 Mon Sep 17 00:00:00 2001 From: Hannes Schulze Date: Sat, 1 Feb 2025 23:32:55 +0100 Subject: revamp input system --- lib/nes/app/input/input-device.hh | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'lib/nes/app/input/input-device.hh') 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; -- cgit v1.3.1