From fc3e08b449c62414b526bc260956edb1022b41a5 Mon Sep 17 00:00:00 2001 From: Jools Wills Date: Fri, 2 Dec 2016 23:00:10 +0000 Subject: [PATCH] Allow configuring of the hotkey button * add hotkey button gfx and hotkey to input configuration * prompt user if no hotkey set, and offer to use select * if no hotkey is set, still save an entry with key id 0, for backward compatibility --- data/ResourceUtil.cpp | 148 ++++++++-------- data/Resources.h | 187 ++++++++++---------- data/converted/help_button_hotkey_svg.cpp | 199 ++++++++++++++++++++++ data/resources/help/button_hotkey.svg | 22 +++ es-core/CMakeLists.txt | 1 + es-core/src/InputConfig.h | 8 +- es-core/src/guis/GuiInputConfig.cpp | 40 ++++- 7 files changed, 430 insertions(+), 175 deletions(-) create mode 100644 data/converted/help_button_hotkey_svg.cpp create mode 100644 data/resources/help/button_hotkey.svg diff --git a/data/ResourceUtil.cpp b/data/ResourceUtil.cpp index 48b92defe..c54676a99 100644 --- a/data/ResourceUtil.cpp +++ b/data/ResourceUtil.cpp @@ -2,101 +2,103 @@ #include "Resources.h" -const size_t res2hNrOfFiles = 45; +const size_t res2hNrOfFiles = 46; const Res2hEntry res2hFiles[res2hNrOfFiles] = { + {":/busy_2.svg", busy_2_svg_size, busy_2_svg_data}, + {":/frame.png", frame_png_size, frame_png_data}, {":/scroll_gradient.png", scroll_gradient_png_size, scroll_gradient_png_data}, + {":/busy_0.svg", busy_0_svg_size, busy_0_svg_data}, {":/star_filled.svg", star_filled_svg_size, star_filled_svg_data}, + {":/button.png", button_png_size, button_png_data}, + {":/option_arrow.svg", option_arrow_svg_size, option_arrow_svg_data}, + {":/on.svg", on_svg_size, on_svg_data}, + {":/busy_1.svg", busy_1_svg_size, busy_1_svg_data}, + {":/arrow.svg", arrow_svg_size, arrow_svg_data}, + {":/textinput_ninepatch.png", textinput_ninepatch_png_size, textinput_ninepatch_png_data}, + {":/splash.svg", splash_svg_size, splash_svg_data}, {":/window_icon_256.png", window_icon_256_png_size, window_icon_256_png_data}, + {":/fav_remove.svg", fav_remove_svg_size, fav_remove_svg_data}, + {":/slider_knob.svg", slider_knob_svg_size, slider_knob_svg_data}, + {":/fav_add.svg", fav_add_svg_size, fav_add_svg_data}, + {":/opensans_hebrew_condensed_regular.ttf", opensans_hebrew_condensed_regular_ttf_size, opensans_hebrew_condensed_regular_ttf_data}, {":/off.svg", off_svg_size, off_svg_data}, + {":/textinput_ninepatch_active.png", textinput_ninepatch_active_png_size, textinput_ninepatch_active_png_data}, + {":/busy_3.svg", busy_3_svg_size, busy_3_svg_data}, + {":/star_unfilled.svg", star_unfilled_svg_size, star_unfilled_svg_data}, + {":/checkbox_checked.svg", checkbox_checked_svg_size, checkbox_checked_svg_data}, {":/button_filled.png", button_filled_png_size, button_filled_png_data}, {":/checkbox_unchecked.svg", checkbox_unchecked_svg_size, checkbox_unchecked_svg_data}, - {":/opensans_hebrew_condensed_regular.ttf", opensans_hebrew_condensed_regular_ttf_size, opensans_hebrew_condensed_regular_ttf_data}, - {":/on.svg", on_svg_size, on_svg_data}, - {":/busy_3.svg", busy_3_svg_size, busy_3_svg_data}, {":/opensans_hebrew_condensed_light.ttf", opensans_hebrew_condensed_light_ttf_size, opensans_hebrew_condensed_light_ttf_data}, - {":/checkbox_checked.svg", checkbox_checked_svg_size, checkbox_checked_svg_data}, - {":/textinput_ninepatch.png", textinput_ninepatch_png_size, textinput_ninepatch_png_data}, - {":/option_arrow.svg", option_arrow_svg_size, option_arrow_svg_data}, - {":/textinput_ninepatch_active.png", textinput_ninepatch_active_png_size, textinput_ninepatch_active_png_data}, - {":/splash.svg", splash_svg_size, splash_svg_data}, - {":/frame.png", frame_png_size, frame_png_data}, - {":/slider_knob.svg", slider_knob_svg_size, slider_knob_svg_data}, - {":/button.png", button_png_size, button_png_data}, - {":/busy_1.svg", busy_1_svg_size, busy_1_svg_data}, - {":/fav_remove.svg", fav_remove_svg_size, fav_remove_svg_data}, - {":/arrow.svg", arrow_svg_size, arrow_svg_data}, - {":/star_unfilled.svg", star_unfilled_svg_size, star_unfilled_svg_data}, - {":/busy_2.svg", busy_2_svg_size, busy_2_svg_data}, - {":/busy_0.svg", busy_0_svg_size, busy_0_svg_data}, - {":/fav_add.svg", fav_add_svg_size, fav_add_svg_data}, - {":/help/dpad_leftright.svg", help_dpad_leftright_svg_size, help_dpad_leftright_svg_data}, + {":/help/dpad_right.svg", help_dpad_right_svg_size, help_dpad_right_svg_data}, {":/help/dpad_all.svg", help_dpad_all_svg_size, help_dpad_all_svg_data}, {":/help/button_x.svg", help_button_x_svg_size, help_button_x_svg_data}, - {":/help/button_a.svg", help_button_a_svg_size, help_button_a_svg_data}, - {":/help/button_l.svg", help_button_l_svg_size, help_button_l_svg_data}, - {":/help/dpad_down.svg", help_dpad_down_svg_size, help_dpad_down_svg_data}, - {":/help/analog_up.svg", help_analog_up_svg_size, help_analog_up_svg_data}, - {":/help/dpad_left.svg", help_dpad_left_svg_size, help_dpad_left_svg_data}, - {":/help/button_start.svg", help_button_start_svg_size, help_button_start_svg_data}, {":/help/dpad_up.svg", help_dpad_up_svg_size, help_dpad_up_svg_data}, - {":/help/analog_down.svg", help_analog_down_svg_size, help_analog_down_svg_data}, - {":/help/button_y.svg", help_button_y_svg_size, help_button_y_svg_data}, - {":/help/button_select.svg", help_button_select_svg_size, help_button_select_svg_data}, - {":/help/button_b.svg", help_button_b_svg_size, help_button_b_svg_data}, {":/help/dpad_updown.svg", help_dpad_updown_svg_size, help_dpad_updown_svg_data}, - {":/help/dpad_right.svg", help_dpad_right_svg_size, help_dpad_right_svg_data}, + {":/help/analog_down.svg", help_analog_down_svg_size, help_analog_down_svg_data}, {":/help/button_r.svg", help_button_r_svg_size, help_button_r_svg_data}, - {":/help/analog_thumb.svg", help_analog_thumb_svg_size, help_analog_thumb_svg_data}, + {":/help/analog_up.svg", help_analog_up_svg_size, help_analog_up_svg_data}, + {":/help/button_start.svg", help_button_start_svg_size, help_button_start_svg_data}, + {":/help/button_a.svg", help_button_a_svg_size, help_button_a_svg_data}, + {":/help/analog_right.svg", help_analog_right_svg_size, help_analog_right_svg_data}, + {":/help/button_hotkey.svg", help_button_hotkey_svg_size, help_button_hotkey_svg_data}, + {":/help/dpad_left.svg", help_dpad_left_svg_size, help_dpad_left_svg_data}, + {":/help/button_select.svg", help_button_select_svg_size, help_button_select_svg_data}, + {":/help/button_l.svg", help_button_l_svg_size, help_button_l_svg_data}, {":/help/analog_left.svg", help_analog_left_svg_size, help_analog_left_svg_data}, - {":/help/analog_right.svg", help_analog_right_svg_size, help_analog_right_svg_data} + {":/help/button_b.svg", help_button_b_svg_size, help_button_b_svg_data}, + {":/help/analog_thumb.svg", help_analog_thumb_svg_size, help_analog_thumb_svg_data}, + {":/help/dpad_down.svg", help_dpad_down_svg_size, help_dpad_down_svg_data}, + {":/help/dpad_leftright.svg", help_dpad_leftright_svg_size, help_dpad_leftright_svg_data}, + {":/help/button_y.svg", help_button_y_svg_size, help_button_y_svg_data} }; res2hMapType::value_type mapTemp[] = { - std::make_pair(":/scroll_gradient.png", res2hFiles[0]), - std::make_pair(":/star_filled.svg", res2hFiles[1]), - std::make_pair(":/window_icon_256.png", res2hFiles[2]), - std::make_pair(":/off.svg", res2hFiles[3]), - std::make_pair(":/button_filled.png", res2hFiles[4]), - std::make_pair(":/checkbox_unchecked.svg", res2hFiles[5]), - std::make_pair(":/opensans_hebrew_condensed_regular.ttf", res2hFiles[6]), + std::make_pair(":/busy_2.svg", res2hFiles[0]), + std::make_pair(":/frame.png", res2hFiles[1]), + std::make_pair(":/scroll_gradient.png", res2hFiles[2]), + std::make_pair(":/busy_0.svg", res2hFiles[3]), + std::make_pair(":/star_filled.svg", res2hFiles[4]), + std::make_pair(":/button.png", res2hFiles[5]), + std::make_pair(":/option_arrow.svg", res2hFiles[6]), std::make_pair(":/on.svg", res2hFiles[7]), - std::make_pair(":/busy_3.svg", res2hFiles[8]), - std::make_pair(":/opensans_hebrew_condensed_light.ttf", res2hFiles[9]), - std::make_pair(":/checkbox_checked.svg", res2hFiles[10]), - std::make_pair(":/textinput_ninepatch.png", res2hFiles[11]), - std::make_pair(":/option_arrow.svg", res2hFiles[12]), - std::make_pair(":/textinput_ninepatch_active.png", res2hFiles[13]), - std::make_pair(":/splash.svg", res2hFiles[14]), - std::make_pair(":/frame.png", res2hFiles[15]), - std::make_pair(":/slider_knob.svg", res2hFiles[16]), - std::make_pair(":/button.png", res2hFiles[17]), - std::make_pair(":/busy_1.svg", res2hFiles[18]), - std::make_pair(":/fav_remove.svg", res2hFiles[19]), - std::make_pair(":/arrow.svg", res2hFiles[20]), - std::make_pair(":/star_unfilled.svg", res2hFiles[21]), - std::make_pair(":/busy_2.svg", res2hFiles[22]), - std::make_pair(":/busy_0.svg", res2hFiles[23]), - std::make_pair(":/fav_add.svg", res2hFiles[24]), - std::make_pair(":/help/dpad_leftright.svg", res2hFiles[25]), + std::make_pair(":/busy_1.svg", res2hFiles[8]), + std::make_pair(":/arrow.svg", res2hFiles[9]), + std::make_pair(":/textinput_ninepatch.png", res2hFiles[10]), + std::make_pair(":/splash.svg", res2hFiles[11]), + std::make_pair(":/window_icon_256.png", res2hFiles[12]), + std::make_pair(":/fav_remove.svg", res2hFiles[13]), + std::make_pair(":/slider_knob.svg", res2hFiles[14]), + std::make_pair(":/fav_add.svg", res2hFiles[15]), + std::make_pair(":/opensans_hebrew_condensed_regular.ttf", res2hFiles[16]), + std::make_pair(":/off.svg", res2hFiles[17]), + std::make_pair(":/textinput_ninepatch_active.png", res2hFiles[18]), + std::make_pair(":/busy_3.svg", res2hFiles[19]), + std::make_pair(":/star_unfilled.svg", res2hFiles[20]), + std::make_pair(":/checkbox_checked.svg", res2hFiles[21]), + std::make_pair(":/button_filled.png", res2hFiles[22]), + std::make_pair(":/checkbox_unchecked.svg", res2hFiles[23]), + std::make_pair(":/opensans_hebrew_condensed_light.ttf", res2hFiles[24]), + std::make_pair(":/help/dpad_right.svg", res2hFiles[25]), std::make_pair(":/help/dpad_all.svg", res2hFiles[26]), std::make_pair(":/help/button_x.svg", res2hFiles[27]), - std::make_pair(":/help/button_a.svg", res2hFiles[28]), - std::make_pair(":/help/button_l.svg", res2hFiles[29]), - std::make_pair(":/help/dpad_down.svg", res2hFiles[30]), - std::make_pair(":/help/analog_up.svg", res2hFiles[31]), - std::make_pair(":/help/dpad_left.svg", res2hFiles[32]), + std::make_pair(":/help/dpad_up.svg", res2hFiles[28]), + std::make_pair(":/help/dpad_updown.svg", res2hFiles[29]), + std::make_pair(":/help/analog_down.svg", res2hFiles[30]), + std::make_pair(":/help/button_r.svg", res2hFiles[31]), + std::make_pair(":/help/analog_up.svg", res2hFiles[32]), std::make_pair(":/help/button_start.svg", res2hFiles[33]), - std::make_pair(":/help/dpad_up.svg", res2hFiles[34]), - std::make_pair(":/help/analog_down.svg", res2hFiles[35]), - std::make_pair(":/help/button_y.svg", res2hFiles[36]), - std::make_pair(":/help/button_select.svg", res2hFiles[37]), - std::make_pair(":/help/button_b.svg", res2hFiles[38]), - std::make_pair(":/help/dpad_updown.svg", res2hFiles[39]), - std::make_pair(":/help/dpad_right.svg", res2hFiles[40]), - std::make_pair(":/help/button_r.svg", res2hFiles[41]), + std::make_pair(":/help/button_a.svg", res2hFiles[34]), + std::make_pair(":/help/analog_right.svg", res2hFiles[35]), + std::make_pair(":/help/button_hotkey.svg", res2hFiles[36]), + std::make_pair(":/help/dpad_left.svg", res2hFiles[37]), + std::make_pair(":/help/button_select.svg", res2hFiles[38]), + std::make_pair(":/help/button_l.svg", res2hFiles[39]), + std::make_pair(":/help/analog_left.svg", res2hFiles[40]), + std::make_pair(":/help/button_b.svg", res2hFiles[41]), std::make_pair(":/help/analog_thumb.svg", res2hFiles[42]), - std::make_pair(":/help/analog_left.svg", res2hFiles[43]), - std::make_pair(":/help/analog_right.svg", res2hFiles[44]) + std::make_pair(":/help/dpad_down.svg", res2hFiles[43]), + std::make_pair(":/help/dpad_leftright.svg", res2hFiles[44]), + std::make_pair(":/help/button_y.svg", res2hFiles[45]) }; res2hMapType res2hMap(mapTemp, mapTemp + sizeof mapTemp / sizeof mapTemp[0]); diff --git a/data/Resources.h b/data/Resources.h index 25268351f..578d07e24 100644 --- a/data/Resources.h +++ b/data/Resources.h @@ -5,83 +5,83 @@ #include #include +extern const size_t busy_2_svg_size; +extern const unsigned char busy_2_svg_data[]; + +extern const size_t frame_png_size; +extern const unsigned char frame_png_data[]; + extern const size_t scroll_gradient_png_size; extern const unsigned char scroll_gradient_png_data[]; +extern const size_t busy_0_svg_size; +extern const unsigned char busy_0_svg_data[]; + extern const size_t star_filled_svg_size; extern const unsigned char star_filled_svg_data[]; +extern const size_t button_png_size; +extern const unsigned char button_png_data[]; + +extern const size_t option_arrow_svg_size; +extern const unsigned char option_arrow_svg_data[]; + +extern const size_t on_svg_size; +extern const unsigned char on_svg_data[]; + +extern const size_t busy_1_svg_size; +extern const unsigned char busy_1_svg_data[]; + +extern const size_t arrow_svg_size; +extern const unsigned char arrow_svg_data[]; + +extern const size_t textinput_ninepatch_png_size; +extern const unsigned char textinput_ninepatch_png_data[]; + +extern const size_t splash_svg_size; +extern const unsigned char splash_svg_data[]; + extern const size_t window_icon_256_png_size; extern const unsigned char window_icon_256_png_data[]; +extern const size_t fav_remove_svg_size; +extern const unsigned char fav_remove_svg_data[]; + +extern const size_t slider_knob_svg_size; +extern const unsigned char slider_knob_svg_data[]; + +extern const size_t fav_add_svg_size; +extern const unsigned char fav_add_svg_data[]; + +extern const size_t opensans_hebrew_condensed_regular_ttf_size; +extern const unsigned char opensans_hebrew_condensed_regular_ttf_data[]; + extern const size_t off_svg_size; extern const unsigned char off_svg_data[]; +extern const size_t textinput_ninepatch_active_png_size; +extern const unsigned char textinput_ninepatch_active_png_data[]; + +extern const size_t busy_3_svg_size; +extern const unsigned char busy_3_svg_data[]; + +extern const size_t star_unfilled_svg_size; +extern const unsigned char star_unfilled_svg_data[]; + +extern const size_t checkbox_checked_svg_size; +extern const unsigned char checkbox_checked_svg_data[]; + extern const size_t button_filled_png_size; extern const unsigned char button_filled_png_data[]; extern const size_t checkbox_unchecked_svg_size; extern const unsigned char checkbox_unchecked_svg_data[]; -extern const size_t opensans_hebrew_condensed_regular_ttf_size; -extern const unsigned char opensans_hebrew_condensed_regular_ttf_data[]; - -extern const size_t on_svg_size; -extern const unsigned char on_svg_data[]; - -extern const size_t busy_3_svg_size; -extern const unsigned char busy_3_svg_data[]; - extern const size_t opensans_hebrew_condensed_light_ttf_size; extern const unsigned char opensans_hebrew_condensed_light_ttf_data[]; -extern const size_t checkbox_checked_svg_size; -extern const unsigned char checkbox_checked_svg_data[]; - -extern const size_t textinput_ninepatch_png_size; -extern const unsigned char textinput_ninepatch_png_data[]; - -extern const size_t option_arrow_svg_size; -extern const unsigned char option_arrow_svg_data[]; - -extern const size_t textinput_ninepatch_active_png_size; -extern const unsigned char textinput_ninepatch_active_png_data[]; - -extern const size_t splash_svg_size; -extern const unsigned char splash_svg_data[]; - -extern const size_t frame_png_size; -extern const unsigned char frame_png_data[]; - -extern const size_t slider_knob_svg_size; -extern const unsigned char slider_knob_svg_data[]; - -extern const size_t button_png_size; -extern const unsigned char button_png_data[]; - -extern const size_t busy_1_svg_size; -extern const unsigned char busy_1_svg_data[]; - -extern const size_t fav_remove_svg_size; -extern const unsigned char fav_remove_svg_data[]; - -extern const size_t arrow_svg_size; -extern const unsigned char arrow_svg_data[]; - -extern const size_t star_unfilled_svg_size; -extern const unsigned char star_unfilled_svg_data[]; - -extern const size_t busy_2_svg_size; -extern const unsigned char busy_2_svg_data[]; - -extern const size_t busy_0_svg_size; -extern const unsigned char busy_0_svg_data[]; - -extern const size_t fav_add_svg_size; -extern const unsigned char fav_add_svg_data[]; - -extern const size_t help_dpad_leftright_svg_size; -extern const unsigned char help_dpad_leftright_svg_data[]; +extern const size_t help_dpad_right_svg_size; +extern const unsigned char help_dpad_right_svg_data[]; extern const size_t help_dpad_all_svg_size; extern const unsigned char help_dpad_all_svg_data[]; @@ -89,56 +89,59 @@ extern const unsigned char help_dpad_all_svg_data[]; extern const size_t help_button_x_svg_size; extern const unsigned char help_button_x_svg_data[]; -extern const size_t help_button_a_svg_size; -extern const unsigned char help_button_a_svg_data[]; - -extern const size_t help_button_l_svg_size; -extern const unsigned char help_button_l_svg_data[]; - -extern const size_t help_dpad_down_svg_size; -extern const unsigned char help_dpad_down_svg_data[]; - -extern const size_t help_analog_up_svg_size; -extern const unsigned char help_analog_up_svg_data[]; - -extern const size_t help_dpad_left_svg_size; -extern const unsigned char help_dpad_left_svg_data[]; - -extern const size_t help_button_start_svg_size; -extern const unsigned char help_button_start_svg_data[]; - extern const size_t help_dpad_up_svg_size; extern const unsigned char help_dpad_up_svg_data[]; -extern const size_t help_analog_down_svg_size; -extern const unsigned char help_analog_down_svg_data[]; - -extern const size_t help_button_y_svg_size; -extern const unsigned char help_button_y_svg_data[]; - -extern const size_t help_button_select_svg_size; -extern const unsigned char help_button_select_svg_data[]; - -extern const size_t help_button_b_svg_size; -extern const unsigned char help_button_b_svg_data[]; - extern const size_t help_dpad_updown_svg_size; extern const unsigned char help_dpad_updown_svg_data[]; -extern const size_t help_dpad_right_svg_size; -extern const unsigned char help_dpad_right_svg_data[]; +extern const size_t help_analog_down_svg_size; +extern const unsigned char help_analog_down_svg_data[]; extern const size_t help_button_r_svg_size; extern const unsigned char help_button_r_svg_data[]; -extern const size_t help_analog_thumb_svg_size; -extern const unsigned char help_analog_thumb_svg_data[]; +extern const size_t help_analog_up_svg_size; +extern const unsigned char help_analog_up_svg_data[]; + +extern const size_t help_button_start_svg_size; +extern const unsigned char help_button_start_svg_data[]; + +extern const size_t help_button_a_svg_size; +extern const unsigned char help_button_a_svg_data[]; + +extern const size_t help_analog_right_svg_size; +extern const unsigned char help_analog_right_svg_data[]; + +extern const size_t help_button_hotkey_svg_size; +extern const unsigned char help_button_hotkey_svg_data[]; + +extern const size_t help_dpad_left_svg_size; +extern const unsigned char help_dpad_left_svg_data[]; + +extern const size_t help_button_select_svg_size; +extern const unsigned char help_button_select_svg_data[]; + +extern const size_t help_button_l_svg_size; +extern const unsigned char help_button_l_svg_data[]; extern const size_t help_analog_left_svg_size; extern const unsigned char help_analog_left_svg_data[]; -extern const size_t help_analog_right_svg_size; -extern const unsigned char help_analog_right_svg_data[]; +extern const size_t help_button_b_svg_size; +extern const unsigned char help_button_b_svg_data[]; + +extern const size_t help_analog_thumb_svg_size; +extern const unsigned char help_analog_thumb_svg_data[]; + +extern const size_t help_dpad_down_svg_size; +extern const unsigned char help_dpad_down_svg_data[]; + +extern const size_t help_dpad_leftright_svg_size; +extern const unsigned char help_dpad_leftright_svg_data[]; + +extern const size_t help_button_y_svg_size; +extern const unsigned char help_button_y_svg_data[]; struct Res2hEntry { const std::string relativeFileName; diff --git a/data/converted/help_button_hotkey_svg.cpp b/data/converted/help_button_hotkey_svg.cpp new file mode 100644 index 000000000..5bf78e40c --- /dev/null +++ b/data/converted/help_button_hotkey_svg.cpp @@ -0,0 +1,199 @@ +//this file was auto-generated from "button_hotkey.svg" by res2h + +#include "../Resources.h" + +const size_t help_button_hotkey_svg_size = 1905; +const unsigned char help_button_hotkey_svg_data[1905] = { + 0x3c,0x3f,0x78,0x6d,0x6c,0x20,0x76,0x65,0x72,0x73, + 0x69,0x6f,0x6e,0x3d,0x22,0x31,0x2e,0x30,0x22,0x20, + 0x65,0x6e,0x63,0x6f,0x64,0x69,0x6e,0x67,0x3d,0x22, + 0x75,0x74,0x66,0x2d,0x38,0x22,0x3f,0x3e,0x0d,0x0a, + 0x3c,0x21,0x2d,0x2d,0x20,0x47,0x65,0x6e,0x65,0x72, + 0x61,0x74,0x6f,0x72,0x3a,0x20,0x41,0x64,0x6f,0x62, + 0x65,0x20,0x49,0x6c,0x6c,0x75,0x73,0x74,0x72,0x61, + 0x74,0x6f,0x72,0x20,0x31,0x33,0x2e,0x30,0x2e,0x30, + 0x2c,0x20,0x53,0x56,0x47,0x20,0x45,0x78,0x70,0x6f, + 0x72,0x74,0x20,0x50,0x6c,0x75,0x67,0x2d,0x49,0x6e, + 0x20,0x2e,0x20,0x53,0x56,0x47,0x20,0x56,0x65,0x72, + 0x73,0x69,0x6f,0x6e,0x3a,0x20,0x36,0x2e,0x30,0x30, + 0x20,0x42,0x75,0x69,0x6c,0x64,0x20,0x31,0x34,0x39, + 0x34,0x38,0x29,0x20,0x20,0x2d,0x2d,0x3e,0x0d,0x0a, + 0x3c,0x21,0x44,0x4f,0x43,0x54,0x59,0x50,0x45,0x20, + 0x73,0x76,0x67,0x20,0x50,0x55,0x42,0x4c,0x49,0x43, + 0x20,0x22,0x2d,0x2f,0x2f,0x57,0x33,0x43,0x2f,0x2f, + 0x44,0x54,0x44,0x20,0x53,0x56,0x47,0x20,0x31,0x2e, + 0x31,0x2f,0x2f,0x45,0x4e,0x22,0x20,0x22,0x68,0x74, + 0x74,0x70,0x3a,0x2f,0x2f,0x77,0x77,0x77,0x2e,0x77, + 0x33,0x2e,0x6f,0x72,0x67,0x2f,0x47,0x72,0x61,0x70, + 0x68,0x69,0x63,0x73,0x2f,0x53,0x56,0x47,0x2f,0x31, + 0x2e,0x31,0x2f,0x44,0x54,0x44,0x2f,0x73,0x76,0x67, + 0x31,0x31,0x2e,0x64,0x74,0x64,0x22,0x3e,0x0d,0x0a, + 0x3c,0x73,0x76,0x67,0x20,0x76,0x65,0x72,0x73,0x69, + 0x6f,0x6e,0x3d,0x22,0x31,0x2e,0x31,0x22,0x20,0x69, + 0x64,0x3d,0x22,0x5f,0x78,0x33,0x30,0x5f,0x22,0x20, + 0x78,0x6d,0x6c,0x6e,0x73,0x3d,0x22,0x68,0x74,0x74, + 0x70,0x3a,0x2f,0x2f,0x77,0x77,0x77,0x2e,0x77,0x33, + 0x2e,0x6f,0x72,0x67,0x2f,0x32,0x30,0x30,0x30,0x2f, + 0x73,0x76,0x67,0x22,0x20,0x78,0x6d,0x6c,0x6e,0x73, + 0x3a,0x78,0x6c,0x69,0x6e,0x6b,0x3d,0x22,0x68,0x74, + 0x74,0x70,0x3a,0x2f,0x2f,0x77,0x77,0x77,0x2e,0x77, + 0x33,0x2e,0x6f,0x72,0x67,0x2f,0x31,0x39,0x39,0x39, + 0x2f,0x78,0x6c,0x69,0x6e,0x6b,0x22,0x20,0x78,0x3d, + 0x22,0x30,0x70,0x78,0x22,0x20,0x79,0x3d,0x22,0x30, + 0x70,0x78,0x22,0x0d,0x0a,0x09,0x20,0x77,0x69,0x64, + 0x74,0x68,0x3d,0x22,0x33,0x37,0x2e,0x30,0x36,0x31, + 0x70,0x78,0x22,0x20,0x68,0x65,0x69,0x67,0x68,0x74, + 0x3d,0x22,0x33,0x37,0x2e,0x30,0x36,0x31,0x70,0x78, + 0x22,0x20,0x76,0x69,0x65,0x77,0x42,0x6f,0x78,0x3d, + 0x22,0x30,0x20,0x30,0x20,0x33,0x37,0x2e,0x30,0x36, + 0x31,0x20,0x33,0x37,0x2e,0x30,0x36,0x31,0x22,0x20, + 0x65,0x6e,0x61,0x62,0x6c,0x65,0x2d,0x62,0x61,0x63, + 0x6b,0x67,0x72,0x6f,0x75,0x6e,0x64,0x3d,0x22,0x6e, + 0x65,0x77,0x20,0x30,0x20,0x30,0x20,0x33,0x37,0x2e, + 0x30,0x36,0x31,0x20,0x33,0x37,0x2e,0x30,0x36,0x31, + 0x22,0x20,0x78,0x6d,0x6c,0x3a,0x73,0x70,0x61,0x63, + 0x65,0x3d,0x22,0x70,0x72,0x65,0x73,0x65,0x72,0x76, + 0x65,0x22,0x3e,0x0d,0x0a,0x3c,0x67,0x3e,0x0d,0x0a, + 0x09,0x3c,0x67,0x3e,0x0d,0x0a,0x09,0x09,0x3c,0x70, + 0x61,0x74,0x68,0x20,0x66,0x69,0x6c,0x6c,0x3d,0x22, + 0x23,0x46,0x46,0x46,0x46,0x46,0x46,0x22,0x20,0x64, + 0x3d,0x22,0x4d,0x31,0x39,0x2e,0x31,0x36,0x35,0x2c, + 0x31,0x30,0x2e,0x34,0x36,0x39,0x63,0x2d,0x30,0x2e, + 0x37,0x35,0x32,0x2c,0x30,0x2d,0x31,0x2e,0x33,0x36, + 0x2c,0x30,0x2e,0x32,0x34,0x33,0x2d,0x31,0x2e,0x38, + 0x32,0x32,0x2c,0x30,0x2e,0x37,0x32,0x37,0x63,0x2d, + 0x30,0x2e,0x34,0x36,0x31,0x2c,0x30,0x2e,0x34,0x38, + 0x35,0x2d,0x30,0x2e,0x36,0x39,0x31,0x2c,0x31,0x2e, + 0x32,0x31,0x36,0x2d,0x30,0x2e,0x36,0x39,0x31,0x2c, + 0x32,0x2e,0x31,0x39,0x34,0x0d,0x0a,0x09,0x09,0x09, + 0x63,0x30,0x2c,0x30,0x2e,0x39,0x36,0x31,0x2c,0x30, + 0x2e,0x32,0x33,0x37,0x2c,0x31,0x2e,0x36,0x39,0x31, + 0x2c,0x30,0x2e,0x37,0x31,0x2c,0x32,0x2e,0x31,0x38, + 0x37,0x63,0x30,0x2e,0x34,0x37,0x33,0x2c,0x30,0x2e, + 0x34,0x39,0x37,0x2c,0x31,0x2e,0x30,0x37,0x35,0x2c, + 0x30,0x2e,0x37,0x34,0x35,0x2c,0x31,0x2e,0x38,0x30, + 0x33,0x2c,0x30,0x2e,0x37,0x34,0x35,0x63,0x30,0x2e, + 0x37,0x32,0x39,0x2c,0x30,0x2c,0x31,0x2e,0x33,0x32, + 0x39,0x2d,0x30,0x2e,0x32,0x34,0x37,0x2c,0x31,0x2e, + 0x37,0x39,0x35,0x2d,0x30,0x2e,0x37,0x33,0x39,0x0d, + 0x0a,0x09,0x09,0x09,0x63,0x30,0x2e,0x34,0x36,0x38, + 0x2d,0x30,0x2e,0x34,0x39,0x32,0x2c,0x30,0x2e,0x37, + 0x30,0x32,0x2d,0x31,0x2e,0x32,0x33,0x31,0x2c,0x30, + 0x2e,0x37,0x30,0x32,0x2d,0x32,0x2e,0x32,0x31,0x36, + 0x63,0x30,0x2d,0x30,0x2e,0x39,0x37,0x33,0x2d,0x30, + 0x2e,0x32,0x32,0x39,0x2d,0x31,0x2e,0x37,0x2d,0x30, + 0x2e,0x36,0x38,0x33,0x2d,0x32,0x2e,0x31,0x37,0x39, + 0x43,0x32,0x30,0x2e,0x35,0x32,0x35,0x2c,0x31,0x30, + 0x2e,0x37,0x30,0x38,0x2c,0x31,0x39,0x2e,0x39,0x32, + 0x31,0x2c,0x31,0x30,0x2e,0x34,0x36,0x39,0x2c,0x31, + 0x39,0x2e,0x31,0x36,0x35,0x2c,0x31,0x30,0x2e,0x34, + 0x36,0x39,0x7a,0x20,0x4d,0x32,0x38,0x2e,0x37,0x35, + 0x38,0x2c,0x31,0x2e,0x35,0x36,0x35,0x0d,0x0a,0x09, + 0x09,0x09,0x48,0x38,0x2e,0x31,0x31,0x31,0x63,0x2d, + 0x33,0x2e,0x36,0x30,0x31,0x2c,0x30,0x2d,0x36,0x2e, + 0x35,0x32,0x2c,0x32,0x2e,0x39,0x31,0x39,0x2d,0x36, + 0x2e,0x35,0x32,0x2c,0x36,0x2e,0x35,0x32,0x76,0x32, + 0x30,0x2e,0x36,0x34,0x36,0x63,0x30,0x2c,0x33,0x2e, + 0x36,0x30,0x33,0x2c,0x32,0x2e,0x39,0x31,0x39,0x2c, + 0x36,0x2e,0x35,0x32,0x31,0x2c,0x36,0x2e,0x35,0x32, + 0x2c,0x36,0x2e,0x35,0x32,0x31,0x68,0x32,0x30,0x2e, + 0x36,0x34,0x37,0x63,0x33,0x2e,0x36,0x30,0x32,0x2c, + 0x30,0x2c,0x36,0x2e,0x35,0x32,0x31,0x2d,0x32,0x2e, + 0x39,0x31,0x38,0x2c,0x36,0x2e,0x35,0x32,0x31,0x2d, + 0x36,0x2e,0x35,0x32,0x31,0x56,0x38,0x2e,0x30,0x38, + 0x35,0x0d,0x0a,0x09,0x09,0x09,0x43,0x33,0x35,0x2e, + 0x32,0x37,0x39,0x2c,0x34,0x2e,0x34,0x38,0x35,0x2c, + 0x33,0x32,0x2e,0x33,0x36,0x2c,0x31,0x2e,0x35,0x36, + 0x35,0x2c,0x32,0x38,0x2e,0x37,0x35,0x38,0x2c,0x31, + 0x2e,0x35,0x36,0x35,0x7a,0x20,0x4d,0x36,0x2e,0x30, + 0x30,0x38,0x2c,0x39,0x2e,0x31,0x34,0x38,0x68,0x31, + 0x2e,0x38,0x32,0x38,0x76,0x33,0x2e,0x33,0x34,0x33, + 0x68,0x33,0x2e,0x35,0x38,0x33,0x56,0x39,0x2e,0x31, + 0x34,0x38,0x68,0x31,0x2e,0x38,0x32,0x39,0x76,0x38, + 0x2e,0x34,0x39,0x34,0x68,0x2d,0x31,0x2e,0x38,0x32, + 0x39,0x76,0x2d,0x33,0x2e,0x37,0x31,0x34,0x48,0x37, + 0x2e,0x38,0x33,0x36,0x76,0x33,0x2e,0x37,0x31,0x34, + 0x48,0x36,0x2e,0x30,0x30,0x38,0x0d,0x0a,0x09,0x09, + 0x09,0x56,0x39,0x2e,0x31,0x34,0x38,0x7a,0x20,0x4d, + 0x31,0x31,0x2e,0x38,0x32,0x37,0x2c,0x32,0x38,0x2e, + 0x35,0x30,0x38,0x6c,0x2d,0x32,0x2e,0x34,0x39,0x2d, + 0x33,0x2e,0x39,0x38,0x36,0x4c,0x37,0x2e,0x38,0x35, + 0x35,0x2c,0x32,0x35,0x2e,0x39,0x34,0x76,0x32,0x2e, + 0x35,0x36,0x38,0x48,0x36,0x2e,0x30,0x32,0x36,0x76, + 0x2d,0x38,0x2e,0x34,0x39,0x34,0x68,0x31,0x2e,0x38, + 0x32,0x39,0x76,0x33,0x2e,0x37,0x37,0x31,0x6c,0x33, + 0x2e,0x36,0x39,0x34,0x2d,0x33,0x2e,0x37,0x37,0x31, + 0x68,0x32,0x2e,0x34,0x35,0x39,0x6c,0x2d,0x33,0x2e, + 0x34,0x31,0x2c,0x33,0x2e,0x33,0x30,0x39,0x6c,0x33, + 0x2e,0x35,0x39,0x35,0x2c,0x35,0x2e,0x31,0x38,0x36, + 0x0d,0x0a,0x09,0x09,0x09,0x48,0x31,0x31,0x2e,0x38, + 0x32,0x37,0x7a,0x20,0x4d,0x32,0x32,0x2e,0x30,0x32, + 0x36,0x2c,0x32,0x38,0x2e,0x35,0x30,0x38,0x68,0x2d, + 0x36,0x2e,0x38,0x38,0x37,0x76,0x2d,0x38,0x2e,0x34, + 0x39,0x34,0x68,0x36,0x2e,0x37,0x31,0x35,0x76,0x31, + 0x2e,0x34,0x33,0x37,0x68,0x2d,0x34,0x2e,0x38,0x38, + 0x36,0x76,0x31,0x2e,0x38,0x38,0x33,0x68,0x34,0x2e, + 0x35,0x34,0x35,0x76,0x31,0x2e,0x34,0x33,0x33,0x68, + 0x2d,0x34,0x2e,0x35,0x34,0x35,0x76,0x32,0x2e,0x33, + 0x31,0x68,0x35,0x2e,0x30,0x35,0x38,0x56,0x32,0x38, + 0x2e,0x35,0x30,0x38,0x7a,0x20,0x4d,0x31,0x39,0x2e, + 0x31,0x37,0x32,0x2c,0x31,0x37,0x2e,0x37,0x38,0x37, + 0x0d,0x0a,0x09,0x09,0x09,0x63,0x2d,0x31,0x2e,0x33, + 0x34,0x36,0x2c,0x30,0x2d,0x32,0x2e,0x34,0x31,0x37, + 0x2d,0x30,0x2e,0x33,0x38,0x35,0x2d,0x33,0x2e,0x32, + 0x31,0x32,0x2d,0x31,0x2e,0x31,0x35,0x36,0x63,0x2d, + 0x30,0x2e,0x37,0x39,0x34,0x2d,0x30,0x2e,0x37,0x37, + 0x31,0x2d,0x31,0x2e,0x31,0x39,0x32,0x2d,0x31,0x2e, + 0x38,0x33,0x32,0x2d,0x31,0x2e,0x31,0x39,0x32,0x2d, + 0x33,0x2e,0x31,0x38,0x34,0x63,0x30,0x2d,0x30,0x2e, + 0x38,0x36,0x36,0x2c,0x30,0x2e,0x31,0x33,0x38,0x2d, + 0x31,0x2e,0x35,0x39,0x32,0x2c,0x30,0x2e,0x34,0x31, + 0x34,0x2d,0x32,0x2e,0x31,0x37,0x39,0x0d,0x0a,0x09, + 0x09,0x09,0x63,0x30,0x2e,0x32,0x30,0x36,0x2d,0x30, + 0x2e,0x34,0x33,0x33,0x2c,0x30,0x2e,0x34,0x38,0x37, + 0x2d,0x30,0x2e,0x38,0x32,0x31,0x2c,0x30,0x2e,0x38, + 0x34,0x33,0x2d,0x31,0x2e,0x31,0x36,0x35,0x63,0x30, + 0x2e,0x33,0x35,0x37,0x2d,0x30,0x2e,0x33,0x34,0x33, + 0x2c,0x30,0x2e,0x37,0x34,0x37,0x2d,0x30,0x2e,0x35, + 0x39,0x38,0x2c,0x31,0x2e,0x31,0x37,0x31,0x2d,0x30, + 0x2e,0x37,0x36,0x35,0x63,0x30,0x2e,0x35,0x36,0x34, + 0x2d,0x30,0x2e,0x32,0x32,0x34,0x2c,0x31,0x2e,0x32, + 0x31,0x35,0x2d,0x30,0x2e,0x33,0x33,0x36,0x2c,0x31, + 0x2e,0x39,0x35,0x32,0x2d,0x30,0x2e,0x33,0x33,0x36, + 0x0d,0x0a,0x09,0x09,0x09,0x63,0x31,0x2e,0x33,0x33, + 0x35,0x2c,0x30,0x2c,0x32,0x2e,0x34,0x30,0x32,0x2c, + 0x30,0x2e,0x33,0x38,0x39,0x2c,0x33,0x2e,0x32,0x30, + 0x33,0x2c,0x31,0x2e,0x31,0x36,0x35,0x63,0x30,0x2e, + 0x38,0x2c,0x30,0x2e,0x37,0x37,0x36,0x2c,0x31,0x2e, + 0x32,0x30,0x31,0x2c,0x31,0x2e,0x38,0x35,0x36,0x2c, + 0x31,0x2e,0x32,0x30,0x31,0x2c,0x33,0x2e,0x32,0x33, + 0x39,0x63,0x30,0x2c,0x31,0x2e,0x33,0x37,0x32,0x2d, + 0x30,0x2e,0x33,0x39,0x36,0x2c,0x32,0x2e,0x34,0x34, + 0x34,0x2d,0x31,0x2e,0x31,0x39,0x32,0x2c,0x33,0x2e, + 0x32,0x31,0x39,0x0d,0x0a,0x09,0x09,0x09,0x43,0x32, + 0x31,0x2e,0x35,0x36,0x36,0x2c,0x31,0x37,0x2e,0x34, + 0x2c,0x32,0x30,0x2e,0x35,0x30,0x32,0x2c,0x31,0x37, + 0x2e,0x37,0x38,0x37,0x2c,0x31,0x39,0x2e,0x31,0x37, + 0x32,0x2c,0x31,0x37,0x2e,0x37,0x38,0x37,0x7a,0x20, + 0x4d,0x32,0x37,0x2e,0x37,0x37,0x38,0x2c,0x32,0x34, + 0x2e,0x39,0x34,0x35,0x76,0x33,0x2e,0x35,0x36,0x33, + 0x68,0x2d,0x31,0x2e,0x38,0x32,0x33,0x76,0x2d,0x33, + 0x2e,0x35,0x37,0x33,0x6c,0x2d,0x33,0x2e,0x33,0x31, + 0x37,0x2d,0x34,0x2e,0x39,0x32,0x31,0x68,0x32,0x2e, + 0x31,0x34,0x34,0x6c,0x32,0x2e,0x31,0x33,0x32,0x2c, + 0x33,0x2e,0x33,0x36,0x4c,0x32,0x39,0x2c,0x32,0x30, + 0x2e,0x30,0x31,0x34,0x68,0x32,0x2e,0x31,0x30,0x36, + 0x0d,0x0a,0x09,0x09,0x09,0x4c,0x32,0x37,0x2e,0x37, + 0x37,0x38,0x2c,0x32,0x34,0x2e,0x39,0x34,0x35,0x7a, + 0x20,0x4d,0x33,0x31,0x2e,0x35,0x32,0x37,0x2c,0x31, + 0x30,0x2e,0x35,0x38,0x35,0x68,0x2d,0x32,0x2e,0x36, + 0x38,0x31,0x76,0x37,0x2e,0x30,0x35,0x37,0x68,0x2d, + 0x31,0x2e,0x38,0x32,0x38,0x76,0x2d,0x37,0x2e,0x30, + 0x35,0x37,0x68,0x2d,0x32,0x2e,0x36,0x38,0x37,0x56, + 0x39,0x2e,0x31,0x34,0x38,0x68,0x37,0x2e,0x31,0x39, + 0x35,0x56,0x31,0x30,0x2e,0x35,0x38,0x35,0x7a,0x22, + 0x2f,0x3e,0x0d,0x0a,0x09,0x3c,0x2f,0x67,0x3e,0x0d, + 0x0a,0x3c,0x2f,0x67,0x3e,0x0d,0x0a,0x3c,0x2f,0x73, + 0x76,0x67,0x3e,0x0d,0x0a +}; + diff --git a/data/resources/help/button_hotkey.svg b/data/resources/help/button_hotkey.svg new file mode 100644 index 000000000..1446a5841 --- /dev/null +++ b/data/resources/help/button_hotkey.svg @@ -0,0 +1,22 @@ + + + + + + + + + + diff --git a/es-core/CMakeLists.txt b/es-core/CMakeLists.txt index f05aec77c..9729e498e 100644 --- a/es-core/CMakeLists.txt +++ b/es-core/CMakeLists.txt @@ -138,6 +138,7 @@ set(EMBEDDED_ASSET_SOURCES ${emulationstation-all_SOURCE_DIR}/data/converted/help_button_r_svg.cpp ${emulationstation-all_SOURCE_DIR}/data/converted/help_button_start_svg.cpp ${emulationstation-all_SOURCE_DIR}/data/converted/help_button_select_svg.cpp + ${emulationstation-all_SOURCE_DIR}/data/converted/help_button_hotkey_svg.cpp ${emulationstation-all_SOURCE_DIR}/data/converted/help_dpad_up_svg.cpp ${emulationstation-all_SOURCE_DIR}/data/converted/help_dpad_down_svg.cpp ${emulationstation-all_SOURCE_DIR}/data/converted/help_dpad_left_svg.cpp diff --git a/es-core/src/InputConfig.h b/es-core/src/InputConfig.h index ca2b9ece8..7f3acf066 100644 --- a/es-core/src/InputConfig.h +++ b/es-core/src/InputConfig.h @@ -99,16 +99,16 @@ public: //Returns a list of names this input is mapped to. std::vector getMappedTo(Input input); + // Returns true if there is an Input mapped to this name, false otherwise. + // Writes Input mapped to this name to result if true. + bool getInputByName(const std::string& name, Input* result); + void loadFromXML(pugi::xml_node root); void writeToXML(pugi::xml_node parent); bool isConfigured(); private: - // Returns true if there is an Input mapped to this name, false otherwise. - // Writes Input mapped to this name to result if true. - bool getInputByName(const std::string& name, Input* result); - std::map mNameMap; const int mDeviceId; const std::string mDeviceName; diff --git a/es-core/src/guis/GuiInputConfig.cpp b/es-core/src/guis/GuiInputConfig.cpp index 996133596..e83e468fe 100644 --- a/es-core/src/guis/GuiInputConfig.cpp +++ b/es-core/src/guis/GuiInputConfig.cpp @@ -1,4 +1,5 @@ #include "guis/GuiInputConfig.h" +#include "guis/GuiMsgBox.h" #include "Window.h" #include "Log.h" #include "components/TextComponent.h" @@ -15,7 +16,7 @@ // ":/help/button_a.svg", ":/help/button_b.svg", ":/help/button_start.svg", ":/help/button_select.svg", // ":/help/button_l.svg", ":/help/button_r.svg" }; -static const int inputCount = 24; +static const int inputCount = 25; static const char* inputName[inputCount] = { "Up", @@ -41,7 +42,8 @@ static const char* inputName[inputCount] = "RightAnalogUp", "RightAnalogDown", "RightAnalogLeft", - "RightAnalogRight" + "RightAnalogRight", + "HotKeyEnable" }; static const bool inputSkippable[inputCount] = { @@ -68,6 +70,7 @@ static const bool inputSkippable[inputCount] = true, true, true, + true, true }; static const char* inputDispName[inputCount] = @@ -95,7 +98,8 @@ static const char* inputDispName[inputCount] = "RIGHT ANALOG UP", "RIGHT ANALOG DOWN", "RIGHT ANALOG LEFT", - "RIGHT ANALOG RIGHT" + "RIGHT ANALOG RIGHT", + "HOTKEY ENABLE" }; static const char* inputIcon[inputCount] = { @@ -122,7 +126,8 @@ static const char* inputIcon[inputCount] = ":/help/analog_up.svg", ":/help/analog_down.svg", ":/help/analog_left.svg", - ":/help/analog_right.svg" + ":/help/analog_right.svg", + ":/help/button_hotkey.svg" }; //MasterVolUp and MasterVolDown are also hooked up, but do not appear on this screen. @@ -257,11 +262,34 @@ GuiInputConfig::GuiInputConfig(Window* window, InputConfig* target, bool reconfi // buttons std::vector< std::shared_ptr > buttons; - buttons.push_back(std::make_shared(mWindow, "OK", "ok", [this, okCallback] { + std::function okFunction = [this, okCallback] { InputManager::getInstance()->writeDeviceConfig(mTargetConfig); // save if(okCallback) okCallback(); delete this; + }; + buttons.push_back(std::make_shared(mWindow, "OK", "ok", [this, okFunction] { + // check if the hotkey enable button is set. if not prompt the user to use select or nothing. + Input input; + if (!mTargetConfig->getInputByName("HotKeyEnable", &input)) { + mWindow->pushGui(new GuiMsgBox(mWindow, + "YOU DIDN'T CHOOSE A HOTKEY ENABLE BUTTON. THIS IS REQUIRED FOR EXITING GAMES WITH A CONTROLLER. DO YOU WANT TO USE THE SELECT BUTTON DEFAULT ? PLEASE ANSWER YES TO USE SELECT OR NO TO NOT SET A HOTKEY ENABLE BUTTON.", + "YES", [this, okFunction] { + Input input; + mTargetConfig->getInputByName("Select", &input); + mTargetConfig->mapInput("HotKeyEnable", input); + okFunction(); + }, + "NO", [this, okFunction] { + // for a disabled hotkey enable button, set to a key with id 0, + // so the input configuration script can be backwards compatible. + mTargetConfig->mapInput("HotKeyEnable", Input(DEVICE_KEYBOARD, TYPE_KEY, 0, 1, true)); + okFunction(); + } + )); + } else { + okFunction(); + } })); mButtonGrid = makeButtonGrid(mWindow, buttons); mGrid.setEntry(mButtonGrid, Vector2i(0, 6), true, false); @@ -368,7 +396,7 @@ bool GuiInputConfig::assign(Input input, int inputId) // if this input is mapped to something other than "nothing" or the current row, error // (if it's the same as what it was before, allow it) - if(mTargetConfig->getMappedTo(input).size() > 0 && !mTargetConfig->isMappedTo(inputName[inputId], input)) + if(mTargetConfig->getMappedTo(input).size() > 0 && !mTargetConfig->isMappedTo(inputName[inputId], input) && inputName[inputId] != "HotKeyEnable") { error(mMappings.at(inputId), "Already mapped!"); return false;