1
1
Fork 0
forked from suyu/suyu

configure_input: update w/ Switch buttons

This commit is contained in:
shinyquagsire23 2018-01-15 01:35:53 -07:00
parent 801d6c1b6f
commit aa4fa8bded
3 changed files with 225 additions and 94 deletions

View file

@ -19,16 +19,18 @@ Config::Config() {
}
const std::array<int, Settings::NativeButton::NumButtons> Config::default_buttons = {
Qt::Key_A, Qt::Key_S, Qt::Key_Z, Qt::Key_X, Qt::Key_T, Qt::Key_G, Qt::Key_F, Qt::Key_H,
Qt::Key_Q, Qt::Key_W, Qt::Key_M, Qt::Key_N, Qt::Key_1, Qt::Key_2, Qt::Key_B,
Qt::Key_A, Qt::Key_S, Qt::Key_Z, Qt::Key_X, Qt::Key_3, Qt::Key_4, Qt::Key_Q, Qt::Key_W,
Qt::Key_1, Qt::Key_2, Qt::Key_N, Qt::Key_M, Qt::Key_F, Qt::Key_T, Qt::Key_H, Qt::Key_G,
Qt::Key_Left, Qt::Key_Up, Qt::Key_Right, Qt::Key_Down, Qt::Key_J, Qt::Key_I, Qt::Key_L,
Qt::Key_K, Qt::Key_D, Qt::Key_C, Qt::Key_B, Qt::Key_V,
};
const std::array<std::array<int, 5>, Settings::NativeAnalog::NumAnalogs> Config::default_analogs{{
{
Qt::Key_Up, Qt::Key_Down, Qt::Key_Left, Qt::Key_Right, Qt::Key_D,
Qt::Key_Up, Qt::Key_Down, Qt::Key_Left, Qt::Key_Right, Qt::Key_E,
},
{
Qt::Key_I, Qt::Key_K, Qt::Key_J, Qt::Key_L, Qt::Key_D,
Qt::Key_I, Qt::Key_K, Qt::Key_J, Qt::Key_L, Qt::Key_R,
},
}};

View file

@ -54,19 +54,23 @@ ConfigureInput::ConfigureInput(QWidget* parent)
setFocusPolicy(Qt::ClickFocus);
button_map = {
ui->buttonA, ui->buttonB, ui->buttonX, ui->buttonY, ui->buttonDpadUp,
ui->buttonDpadDown, ui->buttonDpadLeft, ui->buttonDpadRight, ui->buttonL, ui->buttonR,
ui->buttonStart, ui->buttonSelect, ui->buttonZL, ui->buttonZR, ui->buttonHome,
ui->buttonA, ui->buttonB, ui->buttonX, ui->buttonY,
ui->buttonLStick, ui->buttonRStick, ui->buttonL, ui->buttonR,
ui->buttonZL, ui->buttonZR, ui->buttonPlus, ui->buttonMinus,
ui->buttonDpadLeft, ui->buttonDpadUp, ui->buttonDpadRight, ui->buttonDpadDown,
ui->buttonLStickLeft, ui->buttonLStickUp, ui->buttonLStickRight, ui->buttonLStickDown,
ui->buttonRStickLeft, ui->buttonRStickUp, ui->buttonRStickRight, ui->buttonRStickDown,
ui->buttonSL, ui->buttonSR, ui->buttonHome, ui->buttonScreenshot,
};
analog_map = {{
{
ui->buttonCircleUp, ui->buttonCircleDown, ui->buttonCircleLeft, ui->buttonCircleRight,
ui->buttonCircleMod,
ui->buttonLStickUp, ui->buttonLStickDown, ui->buttonLStickLeft, ui->buttonLStickRight,
ui->buttonLStickMod,
},
{
ui->buttonCStickUp, ui->buttonCStickDown, ui->buttonCStickLeft, ui->buttonCStickRight,
nullptr,
ui->buttonRStickUp, ui->buttonRStickDown, ui->buttonRStickLeft, ui->buttonRStickRight,
ui->buttonRStickMod,
},
}};

View file

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>370</width>
<height>534</height>
<width>343</width>
<height>665</height>
</rect>
</property>
<property name="windowTitle">
@ -190,7 +190,108 @@
</layout>
</widget>
</item>
<item row="1" column="0">
<item row="3" column="1">
<widget class="QGroupBox" name="faceButtons_6">
<property name="title">
<string>Misc.</string>
</property>
<property name="flat">
<bool>false</bool>
</property>
<property name="checkable">
<bool>false</bool>
</property>
<layout class="QGridLayout" name="gridLayout_6">
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout_25">
<item>
<widget class="QLabel" name="label_29">
<property name="text">
<string>Plus:</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="buttonPlus">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="1">
<layout class="QVBoxLayout" name="verticalLayout_26">
<item>
<widget class="QLabel" name="label_30">
<property name="text">
<string>Minus:</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="buttonMinus">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<layout class="QVBoxLayout" name="verticalLayout_27">
<item>
<widget class="QLabel" name="label_31">
<property name="text">
<string>Home:</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="buttonHome">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="1">
<layout class="QVBoxLayout" name="verticalLayout_28">
<item>
<widget class="QLabel" name="label_11">
<property name="text">
<string>Screen
Capture:</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="buttonScreenshot">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</item>
<item row="2" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="3" column="0">
<widget class="QGroupBox" name="faceButtons_3">
<property name="title">
<string>Shoulder Buttons</string>
@ -274,13 +375,49 @@
</item>
</layout>
</item>
<item row="2" column="0">
<layout class="QVBoxLayout" name="verticalLayout_8">
<item>
<widget class="QLabel" name="label_7">
<property name="text">
<string>SL:</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="buttonSL">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</item>
<item row="2" column="1">
<layout class="QVBoxLayout" name="verticalLayout_29">
<item>
<widget class="QLabel" name="label_8">
<property name="text">
<string>SR:</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="buttonSR">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item row="1" column="1">
<item row="1" column="0">
<widget class="QGroupBox" name="faceButtons_4">
<property name="title">
<string>Circle Pad</string>
<string>Left Stick</string>
</property>
<property name="flat">
<bool>false</bool>
@ -299,7 +436,7 @@
</widget>
</item>
<item>
<widget class="QPushButton" name="buttonCircleLeft">
<widget class="QPushButton" name="buttonLStickLeft">
<property name="text">
<string/>
</property>
@ -317,7 +454,7 @@
</widget>
</item>
<item>
<widget class="QPushButton" name="buttonCircleRight">
<widget class="QPushButton" name="buttonLStickRight">
<property name="text">
<string/>
</property>
@ -335,7 +472,7 @@
</widget>
</item>
<item>
<widget class="QPushButton" name="buttonCircleUp">
<widget class="QPushButton" name="buttonLStickUp">
<property name="text">
<string/>
</property>
@ -353,7 +490,43 @@
</widget>
</item>
<item>
<widget class="QPushButton" name="buttonCircleDown">
<widget class="QPushButton" name="buttonLStickDown">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</item>
<item row="2" column="0">
<layout class="QVBoxLayout" name="verticalLayout_7" stretch="0,0">
<item>
<widget class="QLabel" name="label_6">
<property name="text">
<string>Pressed:</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="buttonLStick">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</item>
<item row="2" column="1">
<layout class="QVBoxLayout" name="verticalLayout_31">
<item>
<widget class="QLabel" name="label_9">
<property name="text">
<string>Modifier:</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="buttonLStickMod">
<property name="text">
<string/>
</property>
@ -364,10 +537,13 @@
</layout>
</widget>
</item>
<item row="2" column="0">
<item row="1" column="1">
<widget class="QGroupBox" name="faceButtons_5">
<property name="title">
<string>C-Stick</string>
<string>Right Stick</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="flat">
<bool>false</bool>
@ -376,17 +552,17 @@
<bool>false</bool>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout_21">
<item row="1" column="1">
<layout class="QVBoxLayout" name="verticalLayout_24">
<item>
<widget class="QLabel" name="label_25">
<widget class="QLabel" name="label_26">
<property name="text">
<string>Left:</string>
<string>Down:</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="buttonCStickLeft">
<widget class="QPushButton" name="buttonRStickDown">
<property name="text">
<string/>
</property>
@ -404,7 +580,7 @@
</widget>
</item>
<item>
<widget class="QPushButton" name="buttonCStickRight">
<widget class="QPushButton" name="buttonRStickRight">
<property name="text">
<string/>
</property>
@ -422,7 +598,7 @@
</widget>
</item>
<item>
<widget class="QPushButton" name="buttonCStickUp">
<widget class="QPushButton" name="buttonRStickUp">
<property name="text">
<string/>
</property>
@ -430,50 +606,17 @@
</item>
</layout>
</item>
<item row="1" column="1">
<layout class="QVBoxLayout" name="verticalLayout_24">
<item>
<widget class="QLabel" name="label_26">
<property name="text">
<string>Down:</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="buttonCStickDown">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item row="2" column="1">
<widget class="QGroupBox" name="faceButtons_6">
<property name="title">
<string>Misc.</string>
</property>
<property name="flat">
<bool>false</bool>
</property>
<property name="checkable">
<bool>false</bool>
</property>
<layout class="QGridLayout" name="gridLayout_6">
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout_25">
<layout class="QVBoxLayout" name="verticalLayout_21">
<item>
<widget class="QLabel" name="label_29">
<widget class="QLabel" name="label_25">
<property name="text">
<string>Start:</string>
<string>Left:</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="buttonStart">
<widget class="QPushButton" name="buttonRStickLeft">
<property name="text">
<string/>
</property>
@ -481,17 +624,17 @@
</item>
</layout>
</item>
<item row="0" column="1">
<layout class="QVBoxLayout" name="verticalLayout_26">
<item row="2" column="1">
<layout class="QVBoxLayout" name="verticalLayout_32">
<item>
<widget class="QLabel" name="label_30">
<widget class="QLabel" name="label_10">
<property name="text">
<string>Select:</string>
<string>Modifier:</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="buttonSelect">
<widget class="QPushButton" name="buttonRStickMod">
<property name="text">
<string/>
</property>
@ -499,35 +642,17 @@
</item>
</layout>
</item>
<item row="1" column="0">
<layout class="QVBoxLayout" name="verticalLayout_27">
<item row="2" column="0">
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<widget class="QLabel" name="label_31">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Home:</string>
<string>Pressed:</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="buttonHome">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="1">
<layout class="QVBoxLayout" name="verticalLayout_28">
<item>
<widget class="QLabel" name="label_36">
<property name="text">
<string>Circle Mod:</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="buttonCircleMod">
<widget class="QPushButton" name="buttonRStick">
<property name="text">
<string/>
</property>