diff options
author | wwylele <wwylele@gmail.com> | 2017-01-20 22:46:39 +0200 |
---|---|---|
committer | wwylele <wwylele@gmail.com> | 2017-03-01 23:30:57 +0200 |
commit | 1d1329af23221be31c244889609415e0fb0b2641 (patch) | |
tree | 4206317bc0e2078b1a1d4eef808e2bd475c47512 /src/core/settings.h | |
parent | 3974895e08fc133c4e000c2a654f401662325718 (diff) |
HID: use ButtonDevice
Diffstat (limited to 'src/core/settings.h')
-rw-r--r-- | src/core/settings.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/core/settings.h b/src/core/settings.h index b6c75531f..dba57bd6c 100644 --- a/src/core/settings.h +++ b/src/core/settings.h @@ -69,6 +69,48 @@ static const std::array<Values, NUM_INPUTS> All = {{ }}; } +namespace NativeButton { +enum Values { + A, + B, + X, + Y, + Up, + Down, + Left, + Right, + L, + R, + Start, + Select, + + ZL, + ZR, + + Home, + + NumButtons, +}; + +constexpr int BUTTON_HID_BEGIN = A; +constexpr int BUTTON_IR_BEGIN = ZL; +constexpr int BUTTON_NS_BEGIN = Home; + +constexpr int BUTTON_HID_END = BUTTON_IR_BEGIN; +constexpr int BUTTON_IR_END = BUTTON_NS_BEGIN; +constexpr int BUTTON_NS_END = NumButtons; + +constexpr int NUM_BUTTONS_HID = BUTTON_HID_END - BUTTON_HID_BEGIN; +constexpr int NUM_BUTTONS_IR = BUTTON_IR_END - BUTTON_IR_BEGIN; +constexpr int NUM_BUTTONS_NS = BUTTON_NS_END - BUTTON_NS_BEGIN; + +static const std::array<const char*, NumButtons> mapping = {{ + "button_a", "button_b", "button_x", "button_y", "button_up", "button_down", "button_left", + "button_right", "button_l", "button_r", "button_start", "button_select", "button_zl", + "button_zr", "button_home", +}}; +} // namespace NativeButton + struct Values { // CheckNew3DS bool is_new_3ds; @@ -77,6 +119,8 @@ struct Values { std::array<int, NativeInput::NUM_INPUTS> input_mappings; float pad_circle_modifier_scale; + std::array<std::string, NativeButton::NumButtons> buttons; + // Core bool use_cpu_jit; |