diff --git a/icons/license.txt b/icons/license.txt index f73b0891..237c2b99 100644 --- a/icons/license.txt +++ b/icons/license.txt @@ -2,6 +2,10 @@ Taken from http://tango.freedesktop.org/Tango_Icon_Library, version 0.8.90 / pub - prefsFeatures.png (converted from preferences-system.svg) +https://openclipart.org/detail/35425/tango-desktop-peripherals / public domain: + +- prefsInput.png + https://openclipart.org/detail/2281/information-icons-set-by-kuba / public domain: - information-icons-error.png diff --git a/icons/prefsInput.png b/icons/prefsInput.png new file mode 100644 index 00000000..efd746c7 Binary files /dev/null and b/icons/prefsInput.png differ diff --git a/openscad.qrc b/openscad.qrc index f2dd971b..d7ac9e69 100644 --- a/openscad.qrc +++ b/openscad.qrc @@ -1,5 +1,6 @@ + icons/prefsInput.png images/zoom-text-in-white.png images/zoom-text-in.png images/zoom-text-out-white.png diff --git a/src/Preferences.cc b/src/Preferences.cc index 869ffd2a..11b8a355 100644 --- a/src/Preferences.cc +++ b/src/Preferences.cc @@ -182,6 +182,7 @@ void Preferences::init() { this->toolBar->removeAction(prefsActionFeatures); #endif addPrefPage(group, prefsActionAdvanced, pageAdvanced); + addPrefPage(group, prefsActionInput, pageInput); connect(group, SIGNAL(triggered(QAction*)), this, SLOT(actionTriggered(QAction*))); prefsAction3DView->setChecked(true); @@ -210,6 +211,22 @@ void Preferences::init() { initSpinBox(this->spinBoxShowWhitespaceSize, Settings::Settings::showWhitespaceSize); initSpinBox(this->spinBoxTabWidth, Settings::Settings::tabWidth); + initComboBox(this->comboBoxTranslationX, Settings::Settings::inputTranslationX); + initComboBox(this->comboBoxTranslationY, Settings::Settings::inputTranslationY); + initComboBox(this->comboBoxTranslationZ, Settings::Settings::inputTranslationZ); + initComboBox(this->comboBoxRotationX, Settings::Settings::inputRotateX); + initComboBox(this->comboBoxRotationY, Settings::Settings::inputRotateY); + initComboBox(this->comboBoxRotationZ, Settings::Settings::inputRotateZ); + initComboBox(this->comboBoxZoom, Settings::Settings::inputZoom); + initComboBox(this->comboBoxButton1, Settings::Settings::inputButton1); + initComboBox(this->comboBoxButton2, Settings::Settings::inputButton2); + initComboBox(this->comboBoxButton3, Settings::Settings::inputButton3); + initComboBox(this->comboBoxButton4, Settings::Settings::inputButton4); + initComboBox(this->comboBoxButton5, Settings::Settings::inputButton5); + initComboBox(this->comboBoxButton6, Settings::Settings::inputButton6); + initComboBox(this->comboBoxButton7, Settings::Settings::inputButton7); + initComboBox(this->comboBoxButton8, Settings::Settings::inputButton8); + SettingsReader settingsReader; Settings::Settings::inst()->visit(settingsReader); emit editorConfigChanged(); @@ -574,6 +591,96 @@ void Preferences::on_checkBoxEnableLineNumbers_toggled(bool checked) writeSettings(); } +void Preferences::on_comboBoxTranslationX_activated(int val) +{ + applyComboBox(comboBoxTranslationX, val, Settings::Settings::inputTranslationX); + emit inputMappingChanged(); +} + +void Preferences::on_comboBoxTranslationY_activated(int val) +{ + applyComboBox(comboBoxTranslationY, val, Settings::Settings::inputTranslationY); + emit inputMappingChanged(); +} + +void Preferences::on_comboBoxTranslationZ_activated(int val) +{ + applyComboBox(comboBoxTranslationZ, val, Settings::Settings::inputTranslationZ); + emit inputMappingChanged(); +} + +void Preferences::on_comboBoxRotationX_activated(int val) +{ + applyComboBox(comboBoxRotationX, val, Settings::Settings::inputRotateX); + emit inputMappingChanged(); +} + +void Preferences::on_comboBoxRotationY_activated(int val) +{ + applyComboBox(comboBoxRotationY, val, Settings::Settings::inputRotateY); + emit inputMappingChanged(); +} + +void Preferences::on_comboBoxRotationZ_activated(int val) +{ + applyComboBox(comboBoxRotationZ, val, Settings::Settings::inputRotateZ); + emit inputMappingChanged(); +} + +void Preferences::on_comboBoxZoom_activated(int val) +{ + applyComboBox(comboBoxZoom, val, Settings::Settings::inputZoom); + emit inputMappingChanged(); +} + +void Preferences::on_comboBoxButton1_activated(int val) +{ + applyComboBox(comboBoxButton1, val, Settings::Settings::inputButton1); + emit inputMappingChanged(); +} + +void Preferences::on_comboBoxButton2_activated(int val) +{ + applyComboBox(comboBoxButton2, val, Settings::Settings::inputButton2); + emit inputMappingChanged(); +} + +void Preferences::on_comboBoxButton3_activated(int val) +{ + applyComboBox(comboBoxButton3, val, Settings::Settings::inputButton3); + emit inputMappingChanged(); +} + +void Preferences::on_comboBoxButton4_activated(int val) +{ + applyComboBox(comboBoxButton4, val, Settings::Settings::inputButton4); + emit inputMappingChanged(); +} + +void Preferences::on_comboBoxButton5_activated(int val) +{ + applyComboBox(comboBoxButton5, val, Settings::Settings::inputButton5); + emit inputMappingChanged(); +} + +void Preferences::on_comboBoxButton6_activated(int val) +{ + applyComboBox(comboBoxButton6, val, Settings::Settings::inputButton6); + emit inputMappingChanged(); +} + +void Preferences::on_comboBoxButton7_activated(int val) +{ + applyComboBox(comboBoxButton7, val, Settings::Settings::inputButton7); + emit inputMappingChanged(); +} + +void Preferences::on_comboBoxButton8_activated(int val) +{ + applyComboBox(comboBoxButton8, val, Settings::Settings::inputButton8); + emit inputMappingChanged(); +} + void Preferences::writeSettings() { SettingsWriter settingsWriter; @@ -699,6 +806,22 @@ void Preferences::updateGUI() this->checkBoxShowWarningsIn3dView->setChecked(s->get(Settings::Settings::showWarningsIn3dView).toBool()); this->checkBoxEnableLineNumbers->setChecked(s->get(Settings::Settings::enableLineNumbers).toBool()); this->spinBoxLineWrapIndentationIndent->setDisabled(this->comboBoxLineWrapIndentationStyle->currentText() == "Same"); + + updateComboBox(this->comboBoxTranslationX, Settings::Settings::inputTranslationX); + updateComboBox(this->comboBoxTranslationY, Settings::Settings::inputTranslationY); + updateComboBox(this->comboBoxTranslationZ, Settings::Settings::inputTranslationZ); + updateComboBox(this->comboBoxRotationX, Settings::Settings::inputRotateX); + updateComboBox(this->comboBoxRotationY, Settings::Settings::inputRotateY); + updateComboBox(this->comboBoxRotationZ, Settings::Settings::inputRotateZ); + updateComboBox(this->comboBoxZoom, Settings::Settings::inputZoom); + updateComboBox(this->comboBoxButton1, Settings::Settings::inputButton1); + updateComboBox(this->comboBoxButton2, Settings::Settings::inputButton2); + updateComboBox(this->comboBoxButton3, Settings::Settings::inputButton3); + updateComboBox(this->comboBoxButton4, Settings::Settings::inputButton4); + updateComboBox(this->comboBoxButton5, Settings::Settings::inputButton5); + updateComboBox(this->comboBoxButton6, Settings::Settings::inputButton6); + updateComboBox(this->comboBoxButton7, Settings::Settings::inputButton7); + updateComboBox(this->comboBoxButton8, Settings::Settings::inputButton8); } void Preferences::initComboBox(QComboBox *comboBox, const Settings::SettingsEntry& entry) diff --git a/src/Preferences.h b/src/Preferences.h index af769b9c..21660ff8 100644 --- a/src/Preferences.h +++ b/src/Preferences.h @@ -73,6 +73,22 @@ public slots: void on_checkBoxEnableBraceMatching_toggled(bool); void on_checkBoxEnableLineNumbers_toggled(bool); + void on_comboBoxTranslationX_activated(int val); + void on_comboBoxTranslationY_activated(int val); + void on_comboBoxTranslationZ_activated(int val); + void on_comboBoxRotationX_activated(int val); + void on_comboBoxRotationY_activated(int val); + void on_comboBoxRotationZ_activated(int val); + void on_comboBoxZoom_activated(int val); + void on_comboBoxButton1_activated(int val); + void on_comboBoxButton2_activated(int val); + void on_comboBoxButton3_activated(int val); + void on_comboBoxButton4_activated(int val); + void on_comboBoxButton5_activated(int val); + void on_comboBoxButton6_activated(int val); + void on_comboBoxButton7_activated(int val); + void on_comboBoxButton8_activated(int val); + signals: void requestRedraw() const; void updateMdiMode(bool mdi) const; @@ -84,6 +100,7 @@ signals: void syntaxHighlightChanged(const QString &s) const; void editorTypeChanged(const QString &type); void editorConfigChanged() const; + void inputMappingChanged() const; private: Preferences(QWidget *parent = NULL); diff --git a/src/Preferences.ui b/src/Preferences.ui index 5b20fa99..1d33ec48 100644 --- a/src/Preferences.ui +++ b/src/Preferences.ui @@ -6,8 +6,8 @@ 0 0 - 675 - 476 + 689 + 480 @@ -23,11 +23,11 @@ true - - + + - 1 + 5 @@ -125,9 +125,9 @@ 0 - -262 - 639 - 653 + 0 + 677 + 784 @@ -244,7 +244,7 @@ - TeX Gyre Heros + Nimbus Sans L 12 @@ -1220,8 +1220,8 @@ 0 0 - 82 - 26 + 100 + 30 @@ -1283,8 +1283,8 @@ 0 0 - 490 - 383 + 612 + 510 @@ -1453,6 +1453,174 @@ + + + + 0 + + + + + true + + + + + 0 + 0 + 656 + 489 + + + + + + + Rotation + + + + + + + Button 6 + + + + + + + + + + + + + Button 7 + + + + + + + + + + Button 3 + + + + + + + Zoom + + + + + + + + + + + + + Button 4 + + + + + + + Button 5 + + + + + + + Button 8 + + + + + + + Button 1 + + + + + + + + + + Button 2 + + + + + + + + + + Translation + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Qt::Horizontal + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1487,6 +1655,7 @@ + @@ -1551,6 +1720,18 @@ Enable/Disable experimental features + + + true + + + + :/icons/prefsInput.png:/icons/prefsInput.png + + + Input + + diff --git a/src/input/InputDriverManager.cc b/src/input/InputDriverManager.cc index 7eed88d9..6f939670 100644 --- a/src/input/InputDriverManager.cc +++ b/src/input/InputDriverManager.cc @@ -148,3 +148,8 @@ void InputDriverManager::onFocusChanged(QWidget *, QWidget *current) currentWindow = dynamic_cast(current->window()); } } + +void InputDriverManager::onInputMappingUpdated() +{ + mapper.onInputMappingUpdated(); +} diff --git a/src/input/InputDriverManager.h b/src/input/InputDriverManager.h index 4fd852d1..30b27e87 100644 --- a/src/input/InputDriverManager.h +++ b/src/input/InputDriverManager.h @@ -67,6 +67,9 @@ public: static InputDriverManager * instance(); +public slots: + void onInputMappingUpdated(); + private slots: void onTimeout(); void doOpen(bool firstOpen); diff --git a/src/input/InputEventMapper.cc b/src/input/InputEventMapper.cc index 22363127..9506155b 100644 --- a/src/input/InputEventMapper.cc +++ b/src/input/InputEventMapper.cc @@ -25,6 +25,7 @@ */ #include "InputEventMapper.h" #include "InputDriverManager.h" +#include "settings.h" #include #include @@ -39,29 +40,7 @@ InputEventMapper::InputEventMapper() connect(timer, SIGNAL(timeout()), this, SLOT(onTimer())); timer->start(30); - QSettings settings; - - if (settings.value("InputDriver/button/1").toString().isEmpty()) { - settings.setValue("InputDriver/button/1", "viewActionResetView"); - settings.setValue("InputDriver/button/2", "viewActionViewAll"); - settings.setValue("InputDriver/axis/translateX", "+1"); - settings.setValue("InputDriver/axis/translateY", "-2"); - settings.setValue("InputDriver/axis/translateZ", "-3"); - settings.setValue("InputDriver/axis/rotateX", "+4"); - settings.setValue("InputDriver/axis/rotateY", "-5"); - settings.setValue("InputDriver/axis/rotateZ", "-6"); - } - - for (int a = 0;a < 10;a++) { - QString key = QString("InputDriver/button/%1").arg(a + 1); - actions[a] = settings.value(key).toString(); - } - translate[0] = settings.value("InputDriver/axis/translateX").toInt(); - translate[1] = settings.value("InputDriver/axis/translateY").toInt(); - translate[2] = settings.value("InputDriver/axis/translateZ").toInt(); - rotate[0] = settings.value("InputDriver/axis/rotateX").toInt(); - rotate[1] = settings.value("InputDriver/axis/rotateY").toInt(); - rotate[2] = settings.value("InputDriver/axis/rotateZ").toInt(); + onInputMappingUpdated(); } InputEventMapper::~InputEventMapper() @@ -103,6 +82,12 @@ void InputEventMapper::onTimer() InputEvent *inputEvent = new InputEventRotate(rx, ry, rz); InputDriverManager::instance()->postEvent(inputEvent); } + + double z = getAxisValue(zoom); + if (fabs(z) > threshold) { + InputEvent *inputEvent = new InputEventZoom(z); + InputDriverManager::instance()->postEvent(inputEvent); + } } void InputEventMapper::onAxisChanged(InputEventAxisChanged *event) @@ -144,3 +129,33 @@ void InputEventMapper::onZoomEvent(InputEventZoom *event) { InputDriverManager::instance()->postEvent(event); } + +int InputEventMapper::parseSettingValue(const std::string val) +{ + if (val.length() != 2) { + return 0; + } + return atoi(val.c_str()); +} + +void InputEventMapper::onInputMappingUpdated() +{ + Settings::Settings *s = Settings::Settings::inst(); + + actions[0] = QString(s->get(Settings::Settings::inputButton1).toString().c_str()); + actions[1] = QString(s->get(Settings::Settings::inputButton2).toString().c_str()); + actions[2] = QString(s->get(Settings::Settings::inputButton3).toString().c_str()); + actions[3] = QString(s->get(Settings::Settings::inputButton4).toString().c_str()); + actions[4] = QString(s->get(Settings::Settings::inputButton5).toString().c_str()); + actions[5] = QString(s->get(Settings::Settings::inputButton6).toString().c_str()); + actions[6] = QString(s->get(Settings::Settings::inputButton7).toString().c_str()); + actions[7] = QString(s->get(Settings::Settings::inputButton8).toString().c_str()); + + translate[0] = parseSettingValue(s->get(Settings::Settings::inputTranslationX).toString()); + translate[1] = parseSettingValue(s->get(Settings::Settings::inputTranslationY).toString()); + translate[2] = parseSettingValue(s->get(Settings::Settings::inputTranslationZ).toString()); + rotate[0] = parseSettingValue(s->get(Settings::Settings::inputRotateX).toString()); + rotate[1] = parseSettingValue(s->get(Settings::Settings::inputRotateY).toString()); + rotate[2] = parseSettingValue(s->get(Settings::Settings::inputRotateZ).toString()); + zoom = parseSettingValue(s->get(Settings::Settings::inputZoom).toString()); +} diff --git a/src/input/InputEventMapper.h b/src/input/InputEventMapper.h index 7e907353..c37e8d71 100644 --- a/src/input/InputEventMapper.h +++ b/src/input/InputEventMapper.h @@ -40,9 +40,11 @@ private: QString actions[10]; int translate[3]; int rotate[3]; + int zoom; double scale(double val); double getAxisValue(int config); + int parseSettingValue(const std::string val); public: InputEventMapper(); @@ -56,6 +58,8 @@ public: void onActionEvent(class InputEventAction *event); void onZoomEvent(class InputEventZoom *event); + void onInputMappingUpdated(); + private slots: void onTimer(); }; diff --git a/src/mainwin.cc b/src/mainwin.cc index 306c98c3..81bf0c88 100644 --- a/src/mainwin.cc +++ b/src/mainwin.cc @@ -198,6 +198,7 @@ MainWindow::MainWindow(const QString &filename) editor = new LegacyEditor(editorDockContents); Preferences::create(editor->colorSchemes()); + connect(Preferences::inst(), SIGNAL(inputMappingChanged()), InputDriverManager::instance(), SLOT(onInputMappingUpdated()), Qt::UniqueConnection); #ifdef USE_SCINTILLA_EDITOR if (useScintilla) { diff --git a/src/settings.cc b/src/settings.cc index 85093288..16b64adb 100644 --- a/src/settings.cc +++ b/src/settings.cc @@ -43,10 +43,10 @@ bool SettingsEntry::is_default() const return _value == _default; } -static Value value(std::string s1, std::string s2) { +static ValuePtr value(std::string s1, std::string s2) { Value::VectorType v; v += ValuePtr(s1), ValuePtr(s2); - return v; + return ValuePtr(v); } static Value values(std::string s1, std::string s1disp, std::string s2, std::string s2disp) { @@ -67,6 +67,114 @@ static Value values(std::string s1, std::string s1disp, std::string s2, std::str return v; } +static Value axisValues() { + Value::VectorType v; + v += value("None", _("None")); + v += value("+1", _("Axis 1")); + v += value("-1", _("Axis 1 (inverted)")); + v += value("+2", _("Axis 2")); + v += value("-2", _("Axis 2 (inverted)")); + v += value("+3", _("Axis 3")); + v += value("-3", _("Axis 3 (inverted)")); + v += value("+4", _("Axis 4")); + v += value("-4", _("Axis 4 (inverted)")); + v += value("+5", _("Axis 5")); + v += value("-5", _("Axis 5 (inverted)")); + v += value("+6", _("Axis 6")); + v += value("-6", _("Axis 6 (inverted)")); + v += value("+7", _("Axis 7")); + v += value("-7", _("Axis 7 (inverted)")); + v += value("+8", _("Axis 8")); + v += value("-8", _("Axis 8 (inverted)")); + v += value("+9", _("Axis 9")); + v += value("-9", _("Axis 9 (inverted)")); + return v; +} + +static Value buttonValues() { + Value::VectorType v; + v += value("None", _("None")); + v += value("designActionAutoReload", _("designActionAutoReload")); + v += value("designActionDisplayAST", _("designActionDisplayAST")); + v += value("designActionDisplayCSGProducts", _("designActionDisplayCSGProducts")); + v += value("designActionDisplayCSGTree", _("designActionDisplayCSGTree")); + v += value("designActionFlushCaches", _("designActionFlushCaches")); + v += value("designActionPreview", _("designActionPreview")); + v += value("designActionReloadAndPreview", _("designActionReloadAndPreview")); + v += value("designActionRender", _("designActionRender")); + v += value("designCheckValidity", _("designCheckValidity")); + v += value("editActionComment", _("editActionComment")); + v += value("editActionConvertTabsToSpaces", _("editActionConvertTabsToSpaces")); + v += value("editActionCopy", _("editActionCopy")); + v += value("editActionCopyViewport", _("editActionCopyViewport")); + v += value("editActionCut", _("editActionCut")); + v += value("editActionFind", _("editActionFind")); + v += value("editActionFindAndReplace", _("editActionFindAndReplace")); + v += value("editActionFindNext", _("editActionFindNext")); + v += value("editActionFindPrevious", _("editActionFindPrevious")); + v += value("editActionIndent", _("editActionIndent")); + v += value("editActionPaste", _("editActionPaste")); + v += value("editActionPasteVPR", _("editActionPasteVPR")); + v += value("editActionPasteVPT", _("editActionPasteVPT")); + v += value("editActionPreferences", _("editActionPreferences")); + v += value("editActionRedo", _("editActionRedo")); + v += value("editActionUncomment", _("editActionUncomment")); + v += value("editActionUndo", _("editActionUndo")); + v += value("editActionUnindent", _("editActionUnindent")); + v += value("editActionUseSelectionForFind", _("editActionUseSelectionForFind")); + v += value("editActionZoomTextIn", _("editActionZoomTextIn")); + v += value("editActionZoomTextOut", _("editActionZoomTextOut")); + v += value("fileActionClearRecent", _("fileActionClearRecent")); + v += value("fileActionClose", _("fileActionClose")); + v += value("fileActionExportAMF", _("fileActionExportAMF")); + v += value("fileActionExportCSG", _("fileActionExportCSG")); + v += value("fileActionExportDXF", _("fileActionExportDXF")); + v += value("fileActionExportImage", _("fileActionExportImage")); + v += value("fileActionExportOFF", _("fileActionExportOFF")); + v += value("fileActionExportSTL", _("fileActionExportSTL")); + v += value("fileActionExportSVG", _("fileActionExportSVG")); + v += value("fileActionNew", _("fileActionNew")); + v += value("fileActionOpen", _("fileActionOpen")); + v += value("fileActionQuit", _("fileActionQuit")); + v += value("fileActionReload", _("fileActionReload")); + v += value("fileActionSave", _("fileActionSave")); + v += value("fileActionSaveAs", _("fileActionSaveAs")); + v += value("fileShowLibraryFolder", _("fileShowLibraryFolder")); + v += value("helpActionAbout", _("helpActionAbout")); + v += value("helpActionCheatSheet", _("helpActionCheatSheet")); + v += value("helpActionFontInfo", _("helpActionFontInfo")); + v += value("helpActionHomepage", _("helpActionHomepage")); + v += value("helpActionLibraryInfo", _("helpActionLibraryInfo")); + v += value("helpActionManual", _("helpActionManual")); + v += value("viewActionAnimate", _("viewActionAnimate")); + v += value("viewActionBack", _("viewActionBack")); + v += value("viewActionBottom", _("viewActionBottom")); + v += value("viewActionCenter", _("viewActionCenter")); + v += value("viewActionDiagonal", _("viewActionDiagonal")); + v += value("viewActionFront", _("viewActionFront")); + v += value("viewActionHideConsole", _("viewActionHideConsole")); + v += value("viewActionHideEditor", _("viewActionHideEditor")); + v += value("viewActionHideToolBars", _("viewActionHideToolBars")); + v += value("viewActionLeft", _("viewActionLeft")); + v += value("viewActionOrthogonal", _("viewActionOrthogonal")); + v += value("viewActionPerspective", _("viewActionPerspective")); + v += value("viewActionPreview", _("viewActionPreview")); + v += value("viewActionResetView", _("viewActionResetView")); + v += value("viewActionRight", _("viewActionRight")); + v += value("viewActionShowAxes", _("viewActionShowAxes")); + v += value("viewActionShowCrosshairs", _("viewActionShowCrosshairs")); + v += value("viewActionShowEdges", _("viewActionShowEdges")); + v += value("viewActionShowScaleProportional", _("viewActionShowScaleProportional")); + v += value("viewActionSurfaces", _("viewActionSurfaces")); + v += value("viewActionThrownTogether", _("viewActionThrownTogether")); + v += value("viewActionTop", _("viewActionTop")); + v += value("viewActionViewAll", _("viewActionViewAll")); + v += value("viewActionWireframe", _("viewActionWireframe")); + v += value("viewActionZoomIn", _("viewActionZoomIn")); + v += value("viewActionZoomOut", _("viewActionZoomOut")); + return v; +} + Settings *Settings::inst(bool erase) { static Settings *instance = new Settings; @@ -143,4 +251,21 @@ SettingsEntry Settings::tabKeyFunction("editor", "tabKeyFunction", values("Inden SettingsEntry Settings::highlightCurrentLine("editor", "highlightCurrentLine", Value(true), Value(true)); SettingsEntry Settings::enableBraceMatching("editor", "enableBraceMatching", Value(true), Value(true)); SettingsEntry Settings::enableLineNumbers("editor", "enableLineNumbers", Value(true), Value(true)); + +SettingsEntry Settings::inputTranslationX("input", "translationX", axisValues(), Value("+1")); +SettingsEntry Settings::inputTranslationY("input", "translationY", axisValues(), Value("-2")); +SettingsEntry Settings::inputTranslationZ("input", "translationZ", axisValues(), Value("-3")); +SettingsEntry Settings::inputRotateX("input", "rotateX", axisValues(), Value("+4")); +SettingsEntry Settings::inputRotateY("input", "rotateY", axisValues(), Value("-5")); +SettingsEntry Settings::inputRotateZ("input", "rotateZ", axisValues(), Value("-6")); +SettingsEntry Settings::inputZoom("input", "zoom", axisValues(), Value("None")); +SettingsEntry Settings::inputButton1("input", "button1", buttonValues(), Value("viewActionResetView")); +SettingsEntry Settings::inputButton2("input", "button2", buttonValues(), Value("None")); +SettingsEntry Settings::inputButton3("input", "button3", buttonValues(), Value("None")); +SettingsEntry Settings::inputButton4("input", "button4", buttonValues(), Value("None")); +SettingsEntry Settings::inputButton5("input", "button5", buttonValues(), Value("None")); +SettingsEntry Settings::inputButton6("input", "button6", buttonValues(), Value("None")); +SettingsEntry Settings::inputButton7("input", "button7", buttonValues(), Value("None")); +SettingsEntry Settings::inputButton8("input", "button8", buttonValues(), Value("None")); + } diff --git a/src/settings.h b/src/settings.h index 289114b9..2ee83921 100644 --- a/src/settings.h +++ b/src/settings.h @@ -52,6 +52,21 @@ public: static SettingsEntry highlightCurrentLine; static SettingsEntry enableBraceMatching; static SettingsEntry enableLineNumbers; + static SettingsEntry inputTranslationX; + static SettingsEntry inputTranslationY; + static SettingsEntry inputTranslationZ; + static SettingsEntry inputRotateX; + static SettingsEntry inputRotateY; + static SettingsEntry inputRotateZ; + static SettingsEntry inputZoom; + static SettingsEntry inputButton1; + static SettingsEntry inputButton2; + static SettingsEntry inputButton3; + static SettingsEntry inputButton4; + static SettingsEntry inputButton5; + static SettingsEntry inputButton6; + static SettingsEntry inputButton7; + static SettingsEntry inputButton8; static Settings *inst(bool erase = false);