├── src ├── antimicrox_windows_icon.rc ├── images │ ├── axis.png │ ├── button.png │ ├── antimicrox.ico │ ├── antimicrox.png │ ├── actions │ │ ├── wiki.png │ │ ├── issues.png │ │ ├── sliders.png │ │ ├── about_qt.png │ │ ├── dialog_ok.png │ │ ├── edit_clear.png │ │ ├── help_about.png │ │ ├── join_slots.png │ │ ├── settings.png │ │ ├── split_slot.png │ │ ├── text_field.png │ │ ├── battery-full.png │ │ ├── battery-good.png │ │ ├── battery-low.png │ │ ├── calibration.png │ │ ├── dialog_close.png │ │ ├── edit_delete.png │ │ ├── edit_select.png │ │ ├── github_page.png │ │ ├── key_checker.png │ │ ├── view_refresh.png │ │ ├── view_restore.png │ │ ├── archive_insert.png │ │ ├── battery-empty.png │ │ ├── dialog_cancel.png │ │ ├── document_close.png │ │ ├── document_open.png │ │ ├── document_revert.png │ │ ├── document_save.png │ │ ├── edit_clear_list.png │ │ ├── map_controller.png │ │ ├── view_fullscreen.png │ │ ├── about_antimicrox.png │ │ ├── application_exit.png │ │ ├── document_save_as.png │ │ ├── stick_pad_assign.png │ │ ├── document_open_folder.png │ │ ├── games_config_custom.png │ │ ├── games_config_options.png │ │ ├── battery-good-charging.png │ │ ├── document_revert_small.png │ │ ├── edit_table_delete_row.png │ │ └── edit_table_insert_row_below.png │ ├── battery-low-level.png │ ├── 48-apps-antimicrox_trayicon.png │ └── README.txt ├── config.h.in ├── gui │ ├── winappprofiletimerdialog.h │ ├── winappprofiletimerdialog.cpp │ ├── joydpadbuttonwidget.h │ ├── slotitemlistwidget.h │ ├── aboutdialog.h │ ├── qkeydisplaydialog.h │ ├── setnamesdialog.h │ ├── extraprofilesettingsdialog.h │ ├── joyaxiswidget.h │ ├── setaxisthrottledialog.h │ ├── joybuttonwidget.h │ ├── joytabwidgetcontainer.h │ ├── joysensoreditdialog.h │ ├── joydpadbuttonwidget.cpp │ ├── editalldefaultautoprofiledialog.h │ ├── setaxisthrottledialog.cpp │ ├── unixwindowinfodialog.h │ ├── joystickstatuswindow.h │ ├── dpadeditdialog.h │ └── flashbuttonwidget.h ├── joysensorfactory.h ├── joysensortype.h ├── haptictriggermodeps5.h ├── joybuttontypes │ ├── joygyroscopebutton.h │ ├── joyaccelerometerbutton.h │ ├── joygradientbutton.h │ └── joyaccelerometerbutton.cpp ├── mousedialog │ ├── uihelpers │ │ ├── mousedpadsettingsdialoghelper.cpp │ │ ├── mousedpadsettingsdialoghelper.h │ │ ├── mouseaxissettingsdialoghelper.h │ │ ├── mousebuttonsettingsdialoghelper.h │ │ └── mousecontrolsticksettingsdialoghelper.h │ ├── springmoderegionpreview.h │ └── mousesensorsettingsdialog.h ├── mousehelper.h ├── qtwinkeymapper.h ├── xml │ ├── joydpadxml.h │ ├── joybuttonxml.h │ ├── joyaxisxml.h │ ├── setjoystickxml.h │ ├── joybuttonslotxml.h │ └── inputdevicexml.h ├── joysensorcontextmenu.h ├── qtvmultikeymapper.h ├── joycontrolstickdirectionstype.h ├── joysensorfactory.cpp ├── mousehelper.cpp ├── gamecontroller │ ├── gamecontrollertriggerbutton.h │ ├── gamecontrollertriggerbutton.cpp │ ├── gamecontrollerdpad.h │ ├── gamecontrollerset.h │ └── gamecontrollertrigger.h ├── pt1filter.h ├── joybuttonstatusbox.h ├── unixcapturewindowutility.h ├── xmlconfigmigration.h ├── joysensorpushbutton.h ├── pt1filter.cpp ├── springmousemoveinfo.h ├── uihelpers │ ├── gamecontrollermappingdialoghelper.h │ ├── joyaxiscontextmenuhelper.h │ ├── joysensoriothreadhelper.h │ ├── dpadcontextmenuhelper.h │ ├── dpadeditdialoghelper.h │ ├── buttoneditdialoghelper.h │ ├── joycontrolstickcontextmenuhelper.h │ ├── joytabwidgethelper.h │ ├── advancebuttondialoghelper.h │ ├── joycontrolstickeditdialoghelper.h │ └── joyaxiscontextmenuhelper.cpp ├── winextras.h ├── event.h ├── dpadpushbutton.h ├── joysensorstatusbox.h ├── joykeyrepeathelper.h ├── joysensorbuttonpushbutton.h ├── joysensorpreset.h ├── statisticsestimator.h ├── joycontrolstickpushbutton.h ├── antimicrosettings.h ├── joybuttoncontextmenu.h ├── joyaxiscontextmenu.h ├── localantimicroserver.h ├── keyboard │ ├── virtualmousepushbutton.h │ └── virtualkeypushbutton.h ├── joycontrolstickstatusbox.h ├── joygyroscopesensor.h ├── inputdevicebitarraystatus.h ├── joycontrolstickcontextmenu.h ├── xmlconfigwriter.h ├── joycontrolstickbuttonpushbutton.h ├── uinputhelper.h ├── eventhandlers │ ├── xtesteventhandler.h │ └── winsendinputeventhandler.h ├── joybuttonmousehelper.h ├── gamecontrollerexample.h ├── joybuttonstatusbox.cpp ├── dpadcontextmenu.h ├── applaunchhelper.h ├── xmlconfigreader.h ├── qtuinputkeymapper.h └── qtx11keymapper.h ├── other ├── appdata │ ├── screenshots │ │ ├── about.png │ │ ├── advanced.png │ │ ├── app_dark.png │ │ ├── app_light.png │ │ ├── calibration.png │ │ └── controllermapping.png │ ├── appdata.its │ └── CMakeLists.txt ├── 60-antimicrox-uinput.rules ├── CMakeLists.txt ├── io.github.antimicrox.antimicrox.xml ├── io.github.antimicrox.antimicrox.desktop ├── io.github.antimicrox.antimicrox.yml └── Doxyfile_config.in ├── share ├── icons │ ├── breeze_themed │ │ └── 48-apps-antimicrox_trayicon.png │ └── application │ │ ├── 16x16 │ │ └── apps │ │ │ └── 16-apps-io.github.antimicrox.antimicrox.png │ │ ├── 24x24 │ │ └── apps │ │ │ └── 24-apps-io.github.antimicrox.antimicrox.png │ │ ├── 32x32 │ │ └── apps │ │ │ └── 32-apps-io.github.antimicrox.antimicrox.png │ │ ├── 48x48 │ │ └── apps │ │ │ └── 48-apps-io.github.antimicrox.antimicrox.png │ │ ├── 64x64 │ │ └── apps │ │ │ └── 64-apps-io.github.antimicrox.antimicrox.png │ │ └── 128x128 │ │ └── apps │ │ └── 128-apps-io.github.antimicrox.antimicrox.png ├── LICENSE_SDL_GameControllerDB └── antimicrox │ └── translations │ └── CMakeLists.txt ├── .github_changelog_generator ├── .github ├── ISSUE_TEMPLATE │ ├── config.yml │ ├── feature_request.yaml │ └── bug_report.yaml ├── pull_request_template.md └── workflows │ └── code_formatting.yml ├── .vscode ├── extensions.json ├── snippets.md ├── settings.json └── launch.json ├── .clang-format ├── .gitignore ├── cmake └── modules │ └── NSIS.definitions.nsh.in ├── tests └── CMakeLists.txt ├── cmake_uninstall.cmake.in └── CONTRIBUTING.md /src/antimicrox_windows_icon.rc: -------------------------------------------------------------------------------- 1 | IDI_ICON1 ICON DISCARDABLE "images/antimicrox.ico" -------------------------------------------------------------------------------- /src/images/axis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/src/images/axis.png -------------------------------------------------------------------------------- /src/images/button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/src/images/button.png -------------------------------------------------------------------------------- /src/images/antimicrox.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/src/images/antimicrox.ico -------------------------------------------------------------------------------- /src/images/antimicrox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/src/images/antimicrox.png -------------------------------------------------------------------------------- /src/images/actions/wiki.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/src/images/actions/wiki.png -------------------------------------------------------------------------------- /src/images/actions/issues.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/src/images/actions/issues.png -------------------------------------------------------------------------------- /src/images/actions/sliders.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/src/images/actions/sliders.png -------------------------------------------------------------------------------- /src/images/actions/about_qt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/src/images/actions/about_qt.png -------------------------------------------------------------------------------- /src/images/actions/dialog_ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/src/images/actions/dialog_ok.png -------------------------------------------------------------------------------- /src/images/actions/edit_clear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/src/images/actions/edit_clear.png -------------------------------------------------------------------------------- /src/images/actions/help_about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/src/images/actions/help_about.png -------------------------------------------------------------------------------- /src/images/actions/join_slots.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/src/images/actions/join_slots.png -------------------------------------------------------------------------------- /src/images/actions/settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/src/images/actions/settings.png -------------------------------------------------------------------------------- /src/images/actions/split_slot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/src/images/actions/split_slot.png -------------------------------------------------------------------------------- /src/images/actions/text_field.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/src/images/actions/text_field.png -------------------------------------------------------------------------------- /src/images/battery-low-level.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/src/images/battery-low-level.png -------------------------------------------------------------------------------- /other/appdata/screenshots/about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/other/appdata/screenshots/about.png -------------------------------------------------------------------------------- /src/images/actions/battery-full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/src/images/actions/battery-full.png -------------------------------------------------------------------------------- /src/images/actions/battery-good.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/src/images/actions/battery-good.png -------------------------------------------------------------------------------- /src/images/actions/battery-low.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/src/images/actions/battery-low.png -------------------------------------------------------------------------------- /src/images/actions/calibration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/src/images/actions/calibration.png -------------------------------------------------------------------------------- /src/images/actions/dialog_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/src/images/actions/dialog_close.png -------------------------------------------------------------------------------- /src/images/actions/edit_delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/src/images/actions/edit_delete.png -------------------------------------------------------------------------------- /src/images/actions/edit_select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/src/images/actions/edit_select.png -------------------------------------------------------------------------------- /src/images/actions/github_page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/src/images/actions/github_page.png -------------------------------------------------------------------------------- /src/images/actions/key_checker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/src/images/actions/key_checker.png -------------------------------------------------------------------------------- /src/images/actions/view_refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/src/images/actions/view_refresh.png -------------------------------------------------------------------------------- /src/images/actions/view_restore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/src/images/actions/view_restore.png -------------------------------------------------------------------------------- /other/appdata/screenshots/advanced.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/other/appdata/screenshots/advanced.png -------------------------------------------------------------------------------- /other/appdata/screenshots/app_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/other/appdata/screenshots/app_dark.png -------------------------------------------------------------------------------- /src/images/actions/archive_insert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/src/images/actions/archive_insert.png -------------------------------------------------------------------------------- /src/images/actions/battery-empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/src/images/actions/battery-empty.png -------------------------------------------------------------------------------- /src/images/actions/dialog_cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/src/images/actions/dialog_cancel.png -------------------------------------------------------------------------------- /src/images/actions/document_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/src/images/actions/document_close.png -------------------------------------------------------------------------------- /src/images/actions/document_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/src/images/actions/document_open.png -------------------------------------------------------------------------------- /src/images/actions/document_revert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/src/images/actions/document_revert.png -------------------------------------------------------------------------------- /src/images/actions/document_save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/src/images/actions/document_save.png -------------------------------------------------------------------------------- /src/images/actions/edit_clear_list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/src/images/actions/edit_clear_list.png -------------------------------------------------------------------------------- /src/images/actions/map_controller.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/src/images/actions/map_controller.png -------------------------------------------------------------------------------- /src/images/actions/view_fullscreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/src/images/actions/view_fullscreen.png -------------------------------------------------------------------------------- /other/appdata/screenshots/app_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/other/appdata/screenshots/app_light.png -------------------------------------------------------------------------------- /src/images/actions/about_antimicrox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/src/images/actions/about_antimicrox.png -------------------------------------------------------------------------------- /src/images/actions/application_exit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/src/images/actions/application_exit.png -------------------------------------------------------------------------------- /src/images/actions/document_save_as.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/src/images/actions/document_save_as.png -------------------------------------------------------------------------------- /src/images/actions/stick_pad_assign.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/src/images/actions/stick_pad_assign.png -------------------------------------------------------------------------------- /other/appdata/screenshots/calibration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/other/appdata/screenshots/calibration.png -------------------------------------------------------------------------------- /src/images/48-apps-antimicrox_trayicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/src/images/48-apps-antimicrox_trayicon.png -------------------------------------------------------------------------------- /src/images/actions/document_open_folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/src/images/actions/document_open_folder.png -------------------------------------------------------------------------------- /src/images/actions/games_config_custom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/src/images/actions/games_config_custom.png -------------------------------------------------------------------------------- /src/images/actions/games_config_options.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/src/images/actions/games_config_options.png -------------------------------------------------------------------------------- /src/images/actions/battery-good-charging.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/src/images/actions/battery-good-charging.png -------------------------------------------------------------------------------- /src/images/actions/document_revert_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/src/images/actions/document_revert_small.png -------------------------------------------------------------------------------- /src/images/actions/edit_table_delete_row.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/src/images/actions/edit_table_delete_row.png -------------------------------------------------------------------------------- /other/appdata/screenshots/controllermapping.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/other/appdata/screenshots/controllermapping.png -------------------------------------------------------------------------------- /src/images/actions/edit_table_insert_row_below.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/src/images/actions/edit_table_insert_row_below.png -------------------------------------------------------------------------------- /share/icons/breeze_themed/48-apps-antimicrox_trayicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/share/icons/breeze_themed/48-apps-antimicrox_trayicon.png -------------------------------------------------------------------------------- /.github_changelog_generator: -------------------------------------------------------------------------------- 1 | user=AntiMicroX 2 | project=antimicrox 3 | since-tag=3.1.1 4 | pr-label=**Notable merged pull requests:** 5 | issues-label=**Notable closed issues:** 6 | -------------------------------------------------------------------------------- /other/60-antimicrox-uinput.rules: -------------------------------------------------------------------------------- 1 | #Enable user access to keyboard using uinput event generator 2 | SUBSYSTEM=="misc", KERNEL=="uinput", OPTIONS+="static_node=uinput", TAG+="uaccess" 3 | -------------------------------------------------------------------------------- /share/icons/application/16x16/apps/16-apps-io.github.antimicrox.antimicrox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/share/icons/application/16x16/apps/16-apps-io.github.antimicrox.antimicrox.png -------------------------------------------------------------------------------- /share/icons/application/24x24/apps/24-apps-io.github.antimicrox.antimicrox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/share/icons/application/24x24/apps/24-apps-io.github.antimicrox.antimicrox.png -------------------------------------------------------------------------------- /share/icons/application/32x32/apps/32-apps-io.github.antimicrox.antimicrox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/share/icons/application/32x32/apps/32-apps-io.github.antimicrox.antimicrox.png -------------------------------------------------------------------------------- /share/icons/application/48x48/apps/48-apps-io.github.antimicrox.antimicrox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/share/icons/application/48x48/apps/48-apps-io.github.antimicrox.antimicrox.png -------------------------------------------------------------------------------- /share/icons/application/64x64/apps/64-apps-io.github.antimicrox.antimicrox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/share/icons/application/64x64/apps/64-apps-io.github.antimicrox.antimicrox.png -------------------------------------------------------------------------------- /share/icons/application/128x128/apps/128-apps-io.github.antimicrox.antimicrox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntiMicroX/antimicrox/HEAD/share/icons/application/128x128/apps/128-apps-io.github.antimicrox.antimicrox.png -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: "\U00002753 Question" 4 | url: https://github.com/AntiMicroX/antimicrox/discussions 5 | about: Please ask and answer questions here. 6 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "cschlosser.doxdocgen", 4 | "ms-vscode.cmake-tools", 5 | "ms-vscode.cpptools", 6 | "tonka3000.qtvsctools", 7 | "xaver.clang-format", 8 | ] 9 | } -------------------------------------------------------------------------------- /src/config.h.in: -------------------------------------------------------------------------------- 1 | 2 | #ifndef CONFIG_H 3 | #define CONFIG_H 4 | 5 | #define PROJECT_MAJOR_VERSION @ANTIMICROX_MAJOR_VERSION@ 6 | #define PROJECT_MINOR_VERSION @ANTIMICROX_MINOR_VERSION@ 7 | #define PROJECT_PATCH_VERSION @ANTIMICROX_PATCH_VERSION@ 8 | 9 | #endif // CONFIG_H 10 | -------------------------------------------------------------------------------- /other/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(appdata) 2 | 3 | add_custom_target(manpage) 4 | add_custom_command(TARGET manpage PRE_BUILD 5 | COMMAND gzip -c -9 -n "${PROJECT_SOURCE_DIR}/other/antimicrox.1" > "antimicrox.1.gz" VERBATIM 6 | ) 7 | install(FILES "${CMAKE_CURRENT_BINARY_DIR}/antimicrox.1.gz" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/man/man1") 8 | -------------------------------------------------------------------------------- /.clang-format: -------------------------------------------------------------------------------- 1 | BasedOnStyle: LLVM 2 | IndentWidth: 4 3 | 4 | BreakBeforeBraces: Custom 5 | ColumnLimit: 125 6 | IndentPPDirectives: BeforeHash 7 | BraceWrapping: 8 | AfterEnum: true 9 | AfterStruct: true 10 | AfterClass: true 11 | AfterControlStatement: true 12 | AfterFunction: true 13 | AfterUnion: true 14 | BreakConstructorInitializersBeforeComma: true -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Build directories 2 | 3 | build/ 4 | builds/ 5 | build-dir/ 6 | Build/ 7 | .flatpak-builder/ 8 | repo/ 9 | docs/ 10 | 11 | # Changelogs 12 | src/Changelog 13 | src/CHANGELOG.md 14 | 15 | 16 | # IDE- related files 17 | .vscode/**/* 18 | !.vscode/settings.json 19 | !.vscode/tasks.json 20 | !.vscode/launch.json 21 | !.vscode/extensions.json 22 | !.vscode/qt5.natvis.json 23 | !.vscode/snippets.md 24 | 25 | -------------------------------------------------------------------------------- /other/io.github.antimicrox.antimicrox.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | AntiMicroX profile file 5 | Plik z profilem AntimMicroX 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.vscode/snippets.md: -------------------------------------------------------------------------------- 1 | # Useful snippets 2 | 3 | Check source of signal 4 | 5 | ```cpp 6 | QObject *obj = this->sender(); 7 | if (obj != nullptr) 8 | qInfo() << "objName ::" << obj->metaObject()->className() << endl 9 | << "method ::" << obj->metaObject()->method(senderSignalIndex()).methodSignature(); 10 | ``` 11 | 12 | To make antimicrox crash when warrning happens use command: 13 | 14 | `QT_FATAL_WARNINGS=1 ./build/bin/antimicrox` 15 | 16 | (Useful when used with debugger) -------------------------------------------------------------------------------- /other/appdata/appdata.its: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 13 | 14 | -------------------------------------------------------------------------------- /cmake/modules/NSIS.definitions.nsh.in: -------------------------------------------------------------------------------- 1 | !define VERSION "@APP_VERSION@" 2 | !define APP_VERSION "@APP_VERSION@" 3 | !define APP_NAME "@APP_NAME@" 4 | !define EXE_NAME "@EXE_NAME@" 5 | !define README_FILE "README" 6 | !define LICENSE_FILE "@PROJECT_SOURCE_DIR@resourcestextLICENSE" 7 | !define MUI_ICON "@PROJECT_SOURCE_DIR@resourcesgraphics@APP_LOW_NAME@.ico" 8 | !define MUI_UNICON "@PROJECT_SOURCE_DIR@resourcesgraphics@APP_LOW_NAME@.ico" 9 | !define MUI_WELCOMEFINISHPAGE_BITMAP "@PROJECT_SOURCE_DIR@resourcesgraphics@APP_LOW_NAME@-banner.bmp" 10 | !define MUI_UNWELCOMEFINISHPAGE_BITMAP "@PROJECT_SOURCE_DIR@resourcesgraphics@APP_LOW_NAME@-banner.bmp" 11 | !define PATCH "0" -------------------------------------------------------------------------------- /src/gui/winappprofiletimerdialog.h: -------------------------------------------------------------------------------- 1 | #ifndef WINAPPPROFILETIMERDIALOG_H 2 | #define WINAPPPROFILETIMERDIALOG_H 3 | 4 | #include 5 | #include 6 | 7 | namespace Ui { 8 | class WinAppProfileTimerDialog; 9 | } 10 | 11 | class WinAppProfileTimerDialog : public QDialog 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | explicit WinAppProfileTimerDialog(QWidget *parent = 0); 17 | ~WinAppProfileTimerDialog(); 18 | 19 | protected: 20 | QTimer appTimer; 21 | 22 | // slots: 23 | // void 24 | 25 | private: 26 | Ui::WinAppProfileTimerDialog *ui; 27 | 28 | private slots: 29 | void startTimer(); 30 | }; 31 | 32 | #endif // WINAPPPROFILETIMERDIALOG_H 33 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | Closes #... 2 | 3 | ## Proposed changes 4 | 5 | - 6 | - 7 | - 8 | 9 | ---- 10 | 11 | 12 | 28 | 29 | -------------------------------------------------------------------------------- /src/gui/winappprofiletimerdialog.cpp: -------------------------------------------------------------------------------- 1 | #include "winappprofiletimerdialog.h" 2 | #include "ui_winappprofiletimerdialog.h" 3 | 4 | WinAppProfileTimerDialog::WinAppProfileTimerDialog(QWidget *parent) 5 | : QDialog(parent) 6 | , ui(new Ui::WinAppProfileTimerDialog) 7 | { 8 | ui->setupUi(this); 9 | setAttribute(Qt::WA_DeleteOnClose); 10 | 11 | connect(&appTimer, SIGNAL(timeout()), this, SLOT(accept())); 12 | connect(ui->capturePushButton, SIGNAL(clicked()), this, SLOT(startTimer())); 13 | connect(ui->cancelPushButton, SIGNAL(clicked()), this, SLOT(close())); 14 | } 15 | 16 | WinAppProfileTimerDialog::~WinAppProfileTimerDialog() { delete ui; } 17 | 18 | void WinAppProfileTimerDialog::startTimer() 19 | { 20 | appTimer.start(ui->intervalSpinBox->value() * 1000); 21 | this->setEnabled(false); 22 | } 23 | -------------------------------------------------------------------------------- /tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.11) 2 | project(aboutdialogClass) 3 | 4 | # Tell CMake to run moc when necessary: 5 | set(CMAKE_AUTOMOC ON) 6 | 7 | # As moc files are generated in the binary dir, tell CMake 8 | # to always look for includes there: 9 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 10 | 11 | find_package(Qt5Test REQUIRED) 12 | 13 | set(GUIS_SRCS testaboutdialog.cpp 14 | testaddeditautoprofiledialog.cpp 15 | testadvancebuttondialog.cpp 16 | testcalibration.cpp 17 | testjoycontrolstickeditdialog.cpp 18 | testbuttoneditdialog.cpp 19 | testquicksetdialog.cpp 20 | testqkeydisplaydialog.cpp 21 | ) 22 | add_executable(GuiTests ${GUIS_SRCS}) 23 | #target_link_libraries( GuiTests antilib Qt5::Test ) 24 | ADD_TEST(NAME GuiTests COMMAND GuiTests) 25 | -------------------------------------------------------------------------------- /other/io.github.antimicrox.antimicrox.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=AntiMicroX 3 | Comment=Use a gamepad to control a variety of programs 4 | Name[sr]=Анти-микро 5 | Comment[sr]=Користите џојстик или играћу тастатуру за управљање различитим програмима 6 | Name[fr]=AntiMicroX 7 | Comment[fr]=Utilisez une manette de jeu pour commander un logiciel 8 | Name[de]=AntiMicroX 9 | Comment[de]=Nutze ein Gamepad, um Programme/Spiele zu steuern 10 | Comment[uk]=Використовуйте ігровий маніпулятор для керування програмами 11 | Exec=antimicrox --show %f 12 | Icon=io.github.antimicrox.antimicrox 13 | StartupNotify=true 14 | Terminal=false 15 | Type=Application 16 | Categories=Game;Qt;Utility; 17 | MimeType=application/x-amgp; 18 | Keywords=game;controller;keyboard;joystick;mouse; 19 | Actions=run-in-tray; 20 | 21 | [Desktop Action run-in-tray] 22 | Name=Open in system tray only 23 | Exec=antimicrox --tray 24 | -------------------------------------------------------------------------------- /src/images/README.txt: -------------------------------------------------------------------------------- 1 | The icons bundled with this application are using icons bundled primarily 2 | with the Mist icon theme. These icons are licensed under the 3 | LGPL version 2.1. The assests for the Mist icon theme, bundled in with 4 | the full gnome-themes package, can be found 5 | at http://ftp.gnome.org/pub/GNOME/sources/gnome-themes/. 6 | The full text of the LGPL version 2.1 license can be read in the 7 | included lgpl-2.1.txt file. 8 | 9 | Any icons not bundled with Mist are from the Oxygen icon theme. Those icons 10 | are licensed under the LGPL version 3. The full text of the LGPL version 3 11 | license can be read in the included lgpl-3.0.txt file. The full Oxygen icon 12 | theme can be downloaded from 13 | http://download.kde.org/stable/4.10.2/src/oxygen-icons-4.10.2.tar.xz. 14 | Additionally, you can got the Oxygen theme website located at 15 | http://www.oxygen-icons.org/. 16 | 17 | Main icon of application is made by Freepik from www.flaticon.com. 18 | -------------------------------------------------------------------------------- /other/appdata/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Make appdata optional when installing an application. 2 | if(APPDATA) 3 | add_custom_target(appdata) 4 | 5 | file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/PO_files/") 6 | 7 | add_custom_command(TARGET appdata PRE_BUILD 8 | # Add an entry per language 9 | COMMAND msgfmt "${PROJECT_SOURCE_DIR}/other/appdata/PO_files/en.po" -o "${CMAKE_CURRENT_BINARY_DIR}/PO_files/en.mo" 10 | 11 | COMMAND itstool -i "${PROJECT_SOURCE_DIR}/other/appdata/appdata.its" -j "${PROJECT_SOURCE_DIR}/other/appdata/io.github.antimicrox.antimicrox.appdata.xml.in" -o "io.github.antimicrox.antimicrox.appdata.xml" "${CMAKE_CURRENT_BINARY_DIR}/PO_files/*.mo" 12 | ) 13 | 14 | # Only install an appdata file ifthe user requested to have one built. 15 | install(FILES "${CMAKE_CURRENT_BINARY_DIR}/io.github.antimicrox.antimicrox.appdata.xml" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/metainfo") 16 | endif(APPDATA) 17 | -------------------------------------------------------------------------------- /share/LICENSE_SDL_GameControllerDB: -------------------------------------------------------------------------------- 1 | Simple DirectMedia Layer 2 | Copyright (C) 1997-2020 Sam Lantinga 3 | 4 | This software is provided 'as-is', without any express or implied 5 | warranty. In no event will the authors be held liable for any damages 6 | arising from the use of this software. 7 | 8 | Permission is granted to anyone to use this software for any purpose, 9 | including commercial applications, and to alter it and redistribute it 10 | freely, subject to the following restrictions: 11 | 12 | 1. The origin of this software must not be misrepresented; you must not 13 | claim that you wrote the original software. If you use this software 14 | in a product, an acknowledgment in the product documentation would be 15 | appreciated but is not required. 16 | 2. Altered source versions must be plainly marked as such, and must not be 17 | misrepresented as being the original software. 18 | 3. This notice may not be removed or altered from any source distribution. 19 | -------------------------------------------------------------------------------- /.github/workflows/code_formatting.yml: -------------------------------------------------------------------------------- 1 | name: Check code formatting 2 | 3 | concurrency: 4 | group: format-${{ github.head_ref }} 5 | cancel-in-progress: true 6 | 7 | on: 8 | push: 9 | branches: 10 | - master 11 | pull_request: 12 | branches: 13 | - master 14 | 15 | jobs: 16 | test: 17 | # The type of runner that the job will run on 18 | name: Check Code Formatting 19 | runs-on: ubuntu-22.04 20 | steps: 21 | - uses: actions/checkout@v4 22 | - name: Download tools 23 | run: | 24 | sudo apt-get update && sudo apt-get install clang-format-14 25 | echo "Clang-format version" 26 | clang-format --version 27 | wget https://raw.githubusercontent.com/Sarcasm/run-clang-format/master/run-clang-format.py 28 | chmod +x ./run-clang-format.py 29 | 30 | - name: Test 31 | run: ./run-clang-format.py -r src 32 | -------------------------------------------------------------------------------- /other/io.github.antimicrox.antimicrox.yml: -------------------------------------------------------------------------------- 1 | # Maintained on Flathub at https://github.com/flathub/io.github.antimicrox.antimicrox 2 | 3 | app-id: io.github.antimicrox.antimicrox 4 | runtime: org.kde.Platform 5 | runtime-version: '6.8' 6 | sdk: org.kde.Sdk 7 | command: antimicrox 8 | finish-args: 9 | # KDE Plasma tray icon 10 | - --talk-name=org.kde.StatusNotifierWatcher 11 | # X11 + XShm access 12 | - --share=ipc 13 | - --socket=fallback-x11 14 | - --socket=wayland 15 | # Gamepads 16 | - --device=all 17 | # Fixes https://github.com/AntiMicroX/antimicrox/issues/70 until 18 | # https://github.com/flatpak/xdg-desktop-portal-gtk/issues/191 is fixed 19 | - --filesystem=home 20 | 21 | modules: 22 | - name: antimicrox 23 | buildsystem: cmake 24 | config-opts: 25 | - -DANTIMICROX_PKG_VERSION=flatpak 26 | - -DINSTALL_UINPUT_UDEV_RULES=OFF 27 | sources: 28 | - type: git 29 | url: https://github.com/AntiMicroX/antimicrox.git 30 | # tag: 3.x.x 31 | # commit: 7939b51173826959736fc18773b0610460d9d504 32 | -------------------------------------------------------------------------------- /src/joysensorfactory.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2022 Max Maisel 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #pragma once 19 | 20 | #include "joysensortype.h" 21 | 22 | class JoySensor; 23 | class SetJoystick; 24 | 25 | namespace JoySensorFactory { 26 | JoySensor *build(JoySensorType type, double rate, int originset, SetJoystick *parent_set, QObject *parent); 27 | } 28 | -------------------------------------------------------------------------------- /cmake_uninstall.cmake.in: -------------------------------------------------------------------------------- 1 | if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 2 | message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 3 | endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 4 | 5 | file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) 6 | string(REGEX REPLACE "\n" ";" files "${files}") 7 | foreach(file ${files}) 8 | message(STATUS "Uninstalling $ENV{DESTDIR}${file}") 9 | if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") 10 | exec_program( 11 | "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" 12 | OUTPUT_VARIABLE rm_out 13 | RETURN_VALUE rm_retval 14 | ) 15 | if(NOT "${rm_retval}" STREQUAL 0) 16 | message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") 17 | endif(NOT "${rm_retval}" STREQUAL 0) 18 | else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") 19 | message(STATUS "File $ENV{DESTDIR}${file} does not exist.") 20 | endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") 21 | endforeach(file) 22 | -------------------------------------------------------------------------------- /src/joysensortype.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2022 Max Maisel 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #pragma once 19 | 20 | #include 21 | #include 22 | 23 | enum JoySensorType 24 | { 25 | ACCELEROMETER, 26 | GYROSCOPE, 27 | #if SDL_VERSION_ATLEAST(2, 0, 14) 28 | SENSOR_COUNT 29 | #else 30 | SENSOR_COUNT = 0 31 | #endif 32 | }; 33 | 34 | Q_DECLARE_METATYPE(JoySensorType) 35 | -------------------------------------------------------------------------------- /src/haptictriggermodeps5.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2022 Max Maisel 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | #pragma once 18 | 19 | /** 20 | * @brief Enum of the supported haptic trigger effect for a PS5 controller. 21 | */ 22 | enum HapticTriggerModePs5 23 | { 24 | HAPTIC_TRIGGER_NONE, 25 | HAPTIC_TRIGGER_CLICK, 26 | HAPTIC_TRIGGER_RIGID, 27 | HAPTIC_TRIGGER_RIGID_GRADIENT, 28 | HAPTIC_TRIGGER_VIBRATION 29 | }; 30 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.associations": { 3 | "qtime": "cpp", 4 | "qhash": "cpp", 5 | "thread": "cpp", 6 | "new": "cpp", 7 | "bitset": "cpp", 8 | "atomic": "cpp", 9 | "qdesktopservices": "cpp", 10 | "qtranslator": "cpp", 11 | "qtextstream": "cpp", 12 | "qjsondocument": "cpp", 13 | "complex": "cpp", 14 | "cmath": "cpp" 15 | }, 16 | "[c]": { 17 | "editor.defaultFormatter": "xaver.clang-format", 18 | "editor.formatOnPaste": true, 19 | "editor.formatOnType": true, 20 | "editor.formatOnSave": true, 21 | }, 22 | "[cpp]": { 23 | "editor.defaultFormatter": "xaver.clang-format", 24 | "editor.formatOnPaste": true, 25 | "editor.formatOnType": true, 26 | "editor.formatOnSave": true, 27 | }, 28 | "qttools.injectNatvisFile": false, 29 | "cmake.debugConfig": { 30 | "visualizerFile": "${workspaceFolder}/.vscode/qt5.natvis.xml", 31 | "showDisplayString": true, 32 | "args": [ 33 | "--log-level", 34 | "verbose" 35 | ], 36 | }, 37 | } -------------------------------------------------------------------------------- /src/joybuttontypes/joygyroscopebutton.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2022 Max Maisel 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | #pragma once 18 | 19 | #include "joybuttontypes/joysensorbutton.h" 20 | 21 | /** 22 | * @brief Represents a gyroscope mapping in a SetJoystick 23 | */ 24 | class JoyGyroscopeButton : public JoySensorButton 25 | { 26 | Q_OBJECT 27 | 28 | public: 29 | explicit JoyGyroscopeButton(JoySensor *sensor, int index, int originset, SetJoystick *parentSet, QObject *parent); 30 | 31 | virtual QString getDirectionName() const override; 32 | }; 33 | -------------------------------------------------------------------------------- /src/joybuttontypes/joyaccelerometerbutton.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2022 Max Maisel 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | #pragma once 18 | 19 | #include "joybuttontypes/joysensorbutton.h" 20 | 21 | /** 22 | * @brief Represents an accelerometer mapping in a SetJoystick 23 | */ 24 | class JoyAccelerometerButton : public JoySensorButton 25 | { 26 | Q_OBJECT 27 | 28 | public: 29 | explicit JoyAccelerometerButton(JoySensor *sensor, int sdl_button_index, int originset, SetJoystick *parentSet, 30 | QObject *parent); 31 | 32 | virtual QString getDirectionName() const override; 33 | }; 34 | -------------------------------------------------------------------------------- /src/mousedialog/uihelpers/mousedpadsettingsdialoghelper.cpp: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #include "mousedpadsettingsdialoghelper.h" 20 | 21 | #include "joydpad.h" 22 | #include "joydpadbuttonwidget.h" 23 | 24 | #include 25 | 26 | MouseDpadSettingsDialogHelper::MouseDpadSettingsDialogHelper(JoyDPad *dpad, QObject *parent) 27 | : QObject(parent) 28 | { 29 | Q_ASSERT(dpad); 30 | 31 | this->dpad = dpad; 32 | } 33 | 34 | JoyDPad *MouseDpadSettingsDialogHelper::getDPad() const { return dpad; } 35 | -------------------------------------------------------------------------------- /src/mousehelper.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef MOUSEHELPER_H 20 | #define MOUSEHELPER_H 21 | 22 | #include 23 | #include 24 | 25 | class MouseHelper : public QObject 26 | { 27 | Q_OBJECT 28 | 29 | public: 30 | explicit MouseHelper(QObject *parent = nullptr); 31 | bool springMouseMoving; 32 | int previousCursorLocation[2]; 33 | int pivotPoint[2]; 34 | QTimer mouseTimer; 35 | 36 | private slots: 37 | void resetSpringMouseMoving(); 38 | }; 39 | 40 | #endif // MOUSEHELPER_H 41 | -------------------------------------------------------------------------------- /src/gui/joydpadbuttonwidget.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef JOYDPADBUTTONWIDGET_H 20 | #define JOYDPADBUTTONWIDGET_H 21 | 22 | #include "joybuttonwidget.h" 23 | 24 | class JoyButton; 25 | class QWidget; 26 | 27 | class JoyDPadButtonWidget : public JoyButtonWidget 28 | { 29 | Q_OBJECT 30 | 31 | public: 32 | explicit JoyDPadButtonWidget(JoyButton *button, bool displayNames, QWidget *parent = nullptr); 33 | 34 | protected: 35 | virtual QString generateLabel() override; 36 | }; 37 | 38 | #endif // JOYDPADBUTTONWIDGET_H 39 | -------------------------------------------------------------------------------- /src/qtwinkeymapper.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef QTWINKEYMAPPER_H 20 | #define QTWINKEYMAPPER_H 21 | 22 | #include "qtkeymapperbase.h" 23 | 24 | class QtWinKeyMapper : public QtKeyMapperBase 25 | { 26 | Q_OBJECT 27 | 28 | public: 29 | explicit QtWinKeyMapper(QObject *parent = nullptr); 30 | 31 | virtual int returnQtKey(int key, int scancode = 0) override; 32 | 33 | protected: 34 | void populateMappingHashes() override; 35 | void populateCharKeyInformation() override; 36 | }; 37 | 38 | #endif // QTWINKEYMAPPER_H 39 | -------------------------------------------------------------------------------- /src/xml/joydpadxml.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2020 Jagoda Górska 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #ifndef JOYDPADXML_H 19 | #define JOYDPADXML_H 20 | 21 | #include 22 | 23 | class QXmlStreamReader; 24 | class QXmlStreamWriter; 25 | 26 | template class JoyDPadXml : public QObject 27 | { 28 | public: 29 | explicit JoyDPadXml(T *joydpad, QObject *parent = nullptr); 30 | 31 | void readConfig(QXmlStreamReader *xml); // JoyDPadXml class 32 | void writeConfig(QXmlStreamWriter *xml); // JoyDPadXml class 33 | bool readMainConfig(QXmlStreamReader *xml); 34 | 35 | private: 36 | T *m_joydpad; 37 | }; 38 | 39 | #endif // JOYDPADXML_H 40 | -------------------------------------------------------------------------------- /src/gui/slotitemlistwidget.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef SLOTITEMLISTWIDGET_H 20 | #define SLOTITEMLISTWIDGET_H 21 | 22 | #include 23 | 24 | class QWidget; 25 | class QKeyEvent; 26 | 27 | class SlotItemListWidget : public QListWidget 28 | { 29 | Q_OBJECT 30 | 31 | public: 32 | explicit SlotItemListWidget(QWidget *parent = nullptr); 33 | void insertItems(int row, QList items); 34 | 35 | protected: 36 | virtual void keyPressEvent(QKeyEvent *event); 37 | }; 38 | 39 | #endif // SLOTITEMLISTWIDGET_H 40 | -------------------------------------------------------------------------------- /src/mousedialog/uihelpers/mousedpadsettingsdialoghelper.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef MOUSEDPADSETTINGSDIALOGHELPER_H 20 | #define MOUSEDPADSETTINGSDIALOGHELPER_H 21 | 22 | #include 23 | 24 | class JoyDPad; 25 | 26 | class MouseDpadSettingsDialogHelper : public QObject 27 | { 28 | Q_OBJECT 29 | 30 | public: 31 | explicit MouseDpadSettingsDialogHelper(JoyDPad *dpad, QObject *parent = nullptr); 32 | 33 | JoyDPad *getDPad() const; 34 | 35 | private: 36 | JoyDPad *dpad; 37 | }; 38 | 39 | #endif // MOUSEDPADSETTINGSDIALOGHELPER_H 40 | -------------------------------------------------------------------------------- /src/joysensorcontextmenu.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2022 Max Maisel 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | #pragma once 18 | 19 | #include "joysensorpreset.h" 20 | 21 | #include 22 | 23 | class JoySensor; 24 | class QWidget; 25 | 26 | /** 27 | * @brief The control stick context menu widget used by SensorPushButtonGroup 28 | */ 29 | class JoySensorContextMenu : public QMenu 30 | { 31 | Q_OBJECT 32 | 33 | public: 34 | explicit JoySensorContextMenu(JoySensor *sensor, QWidget *parent = nullptr); 35 | void buildMenu(); 36 | 37 | private slots: 38 | void openMouseSettingsDialog(); 39 | 40 | private: 41 | JoySensor *m_sensor; 42 | JoySensorPreset m_preset; 43 | }; 44 | -------------------------------------------------------------------------------- /src/qtvmultikeymapper.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef QTVMULTIKEYMAPPER_H 20 | #define QTVMULTIKEYMAPPER_H 21 | 22 | #include "qtkeymapperbase.h" 23 | 24 | class QtVMultiKeyMapper : public QtKeyMapperBase 25 | { 26 | 27 | public: 28 | explicit QtVMultiKeyMapper(QObject *parent = nullptr); 29 | 30 | static const int consumerUsagePagePrefix = 0x12000; 31 | 32 | protected: 33 | void populateMappingHashes() override; 34 | void populateCharKeyInformation() override; 35 | }; 36 | 37 | #endif // QTVMULTIKEYMAPPER_H 38 | -------------------------------------------------------------------------------- /src/joycontrolstickdirectionstype.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef JOYCONTROLSTICKDIRECTIONSTYPE_H 20 | #define JOYCONTROLSTICKDIRECTIONSTYPE_H 21 | 22 | class JoyStickDirectionsType 23 | { 24 | public: 25 | enum JoyStickDirections 26 | { 27 | StickCentered = 0, 28 | StickUp = 1, 29 | StickRight = 3, 30 | StickDown = 5, 31 | StickLeft = 7, 32 | StickRightUp = 2, 33 | StickRightDown = 4, 34 | StickLeftUp = 8, 35 | StickLeftDown = 6 36 | }; 37 | }; 38 | 39 | #endif // JOYCONTROLSTICKDIRECTIONSTYPE_H 40 | -------------------------------------------------------------------------------- /src/joysensorfactory.cpp: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2022 Max Maisel 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #include "joysensorfactory.h" 19 | #include "joyaccelerometersensor.h" 20 | #include "joygyroscopesensor.h" 21 | #include "setjoystick.h" 22 | 23 | namespace JoySensorFactory { 24 | JoySensor *build(JoySensorType type, double rate, int originset, SetJoystick *parent_set, QObject *parent) 25 | { 26 | if (type == ACCELEROMETER) 27 | return new JoyAccelerometerSensor(rate, originset, parent_set, parent); 28 | else if (type == GYROSCOPE) 29 | return new JoyGyroscopeSensor(originset, parent_set, parent); 30 | else 31 | return nullptr; 32 | } 33 | } // namespace JoySensorFactory 34 | -------------------------------------------------------------------------------- /src/xml/joybuttonxml.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2020 Jagoda Górska 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #ifndef JOYBUTTONXML_H 19 | #define JOYBUTTONXML_H 20 | 21 | #include 22 | 23 | class JoyButton; 24 | class QXmlStreamReader; 25 | class QXmlStreamWriter; 26 | 27 | class JoyButtonXml : public QObject 28 | { 29 | Q_OBJECT 30 | 31 | public: 32 | explicit JoyButtonXml(JoyButton *joyButton, QObject *parent = nullptr); 33 | 34 | virtual bool readButtonConfig(QXmlStreamReader *xml); 35 | virtual void readConfig(QXmlStreamReader *xml); 36 | virtual void writeConfig(QXmlStreamWriter *xml); 37 | 38 | private: 39 | JoyButton *m_joyButton; 40 | }; 41 | 42 | #endif // JOYBUTTONXML_H 43 | -------------------------------------------------------------------------------- /src/gui/aboutdialog.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef ABOUTDIALOG_H 20 | #define ABOUTDIALOG_H 21 | 22 | #include 23 | 24 | class QEvent; 25 | 26 | namespace Ui { 27 | class AboutDialog; 28 | } 29 | 30 | class AboutDialog : public QDialog 31 | { 32 | Q_OBJECT 33 | 34 | public: 35 | explicit AboutDialog(QWidget *parent = nullptr); 36 | ~AboutDialog(); 37 | 38 | private: 39 | Ui::AboutDialog *ui; 40 | 41 | protected: 42 | void fillInfoTextBrowser(); 43 | virtual void changeEvent(QEvent *event); 44 | void retranslateUi(); 45 | }; 46 | 47 | #endif // ABOUTDIALOG_H 48 | -------------------------------------------------------------------------------- /other/Doxyfile_config.in: -------------------------------------------------------------------------------- 1 | PROJECT_NAME = "AntiMicroX" 2 | 3 | OUTPUT_DIRECTORY = @CMAKE_CURRENT_SOURCE_DIR@/docs/ 4 | INPUT = @CMAKE_CURRENT_SOURCE_DIR@/src/ 5 | RECURSIVE = YES 6 | 7 | QT_AUTOBRIEF = YES 8 | OPTIMIZE_OUTPUT_FOR_C = YES 9 | PROJECT_LOGO = @CMAKE_CURRENT_SOURCE_DIR@/share/icons/application/48x48/apps/48-apps-io.github.antimicrox.antimicrox.png 10 | 11 | HAVE_DOT = YES 12 | DOT_IMAGE_FORMAT = svg 13 | INTERACTIVE_SVG = YES 14 | 15 | EXTRACT_ALL = YES 16 | EXTRACT_PRIVATE = YES 17 | EXTRACT_STATIC = YES 18 | 19 | # If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for 20 | # each documented class showing the direct and indirect inheritance relations. 21 | # Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO. 22 | # The default value is: YES. 23 | # This tag requires that the tag HAVE_DOT is set to YES. 24 | 25 | CLASS_GRAPH = YES 26 | 27 | COLLABORATION_GRAPH = YES 28 | 29 | # If the UML_LOOK tag is set to YES, doxygen will generate inheritance and 30 | # collaboration diagrams in a style similar to the OMG's Unified Modeling 31 | # Language. 32 | # The default value is: NO. 33 | # This tag requires that the tag HAVE_DOT is set to YES. 34 | 35 | UML_LOOK = NO 36 | 37 | 38 | CALL_GRAPH = YES 39 | 40 | CALLER_GRAPH = YES 41 | 42 | GRAPHICAL_HIERARCHY = YES 43 | -------------------------------------------------------------------------------- /src/mousehelper.cpp: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #include "mousehelper.h" 20 | 21 | #include 22 | 23 | MouseHelper::MouseHelper(QObject *parent) 24 | : QObject(parent) 25 | { 26 | springMouseMoving = false; 27 | previousCursorLocation[0] = 0; 28 | previousCursorLocation[1] = 0; 29 | pivotPoint[0] = -1; 30 | pivotPoint[1] = -1; 31 | mouseTimer.setParent(this); 32 | mouseTimer.setSingleShot(true); 33 | QObject::connect(&mouseTimer, &QTimer::timeout, this, &MouseHelper::resetSpringMouseMoving); 34 | } 35 | 36 | void MouseHelper::resetSpringMouseMoving() { springMouseMoving = false; } 37 | -------------------------------------------------------------------------------- /src/gamecontroller/gamecontrollertriggerbutton.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef GAMECONTROLLERBUTTON_H 20 | #define GAMECONTROLLERBUTTON_H 21 | 22 | #include "joybuttontypes/joyaxisbutton.h" 23 | 24 | class QXmlStreamReader; 25 | class SetJoystick; 26 | class JoyAxis; 27 | 28 | class GameControllerTriggerButton : public JoyAxisButton 29 | { 30 | Q_OBJECT 31 | 32 | public: 33 | explicit GameControllerTriggerButton(JoyAxis *axis, int index, int originset, SetJoystick *parentSet, 34 | QObject *parent = nullptr); 35 | 36 | virtual QString getXmlName(); 37 | }; 38 | 39 | #endif // GAMECONTROLLERBUTTON_H 40 | -------------------------------------------------------------------------------- /src/gui/qkeydisplaydialog.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef QKEYDISPLAYDIALOG_H 20 | #define QKEYDISPLAYDIALOG_H 21 | 22 | #include 23 | 24 | class QKeyEvent; 25 | class QWidget; 26 | 27 | namespace Ui { 28 | class QKeyDisplayDialog; 29 | } 30 | 31 | class QKeyDisplayDialog : public QDialog 32 | { 33 | Q_OBJECT 34 | 35 | public: 36 | explicit QKeyDisplayDialog(QWidget *parent = nullptr); 37 | ~QKeyDisplayDialog(); 38 | 39 | protected: 40 | virtual void keyPressEvent(QKeyEvent *event); 41 | virtual void keyReleaseEvent(QKeyEvent *event); 42 | 43 | private: 44 | Ui::QKeyDisplayDialog *ui; 45 | }; 46 | 47 | #endif // QKEYDISPLAYDIALOG_H 48 | -------------------------------------------------------------------------------- /src/gui/setnamesdialog.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef SETNAMESDIALOG_H 20 | #define SETNAMESDIALOG_H 21 | 22 | #include 23 | 24 | class InputDevice; 25 | class QWidget; 26 | 27 | namespace Ui { 28 | class SetNamesDialog; 29 | } 30 | 31 | class SetNamesDialog : public QDialog 32 | { 33 | Q_OBJECT 34 | 35 | public: 36 | explicit SetNamesDialog(InputDevice *device, QWidget *parent = nullptr); 37 | ~SetNamesDialog(); 38 | 39 | InputDevice *getDevice() const; 40 | 41 | private: 42 | Ui::SetNamesDialog *ui; 43 | 44 | InputDevice *device; 45 | 46 | private slots: 47 | void saveSetNameChanges(); 48 | }; 49 | 50 | #endif // SETNAMESDIALOG_H 51 | -------------------------------------------------------------------------------- /src/pt1filter.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2022 Max Maisel 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #pragma once 19 | 20 | /** 21 | * @brief Implementation of a first order lag or PT1 filter. 22 | * Can be used for example to smooth noisy values a bit or detect envelopes. 23 | * @see https://en.wikipedia.org/wiki/Low-pass_filter 24 | */ 25 | class PT1Filter 26 | { 27 | public: 28 | PT1Filter(double tau = 1, double rate = 1); 29 | 30 | double process(double value); 31 | /** 32 | * @brief Get the current filter output value. 33 | * @returns Current filter output value. 34 | */ 35 | inline double getValue() const { return m_value; } 36 | void reset(); 37 | 38 | static const double FALLBACK_RATE; 39 | 40 | private: 41 | double m_dt_tau; 42 | double m_value; 43 | }; 44 | -------------------------------------------------------------------------------- /src/joybuttontypes/joygradientbutton.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef JOYGRADIENTBUTTON_H 20 | #define JOYGRADIENTBUTTON_H 21 | 22 | #include "joybutton.h" 23 | 24 | class SetJoystick; 25 | 26 | class JoyGradientButton : public JoyButton 27 | { 28 | Q_OBJECT 29 | 30 | public: 31 | explicit JoyGradientButton(int sdl_button_index, int originset, SetJoystick *parentSet, QObject *parent); 32 | 33 | using JoyButton::getPartialName; 34 | using JoyButton::setChangeSetCondition; 35 | 36 | protected slots: 37 | virtual void turboEvent(); 38 | virtual void wheelEventVertical(); 39 | virtual void wheelEventHorizontal(); 40 | }; 41 | 42 | #endif // JOYGRADIENTBUTTON_H 43 | -------------------------------------------------------------------------------- /src/joybuttonstatusbox.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef JOYBUTTONSTATUSBOX_H 20 | #define JOYBUTTONSTATUSBOX_H 21 | 22 | #include 23 | 24 | class JoyButton; 25 | class QWidget; 26 | 27 | class JoyButtonStatusBox : public QPushButton 28 | { 29 | Q_OBJECT 30 | Q_PROPERTY(bool isflashing READ isButtonFlashing) 31 | 32 | public: 33 | explicit JoyButtonStatusBox(JoyButton *button, QWidget *parent = nullptr); 34 | JoyButton *getJoyButton() const; 35 | bool isButtonFlashing(); 36 | 37 | private slots: 38 | void flash(); 39 | void unflash(); 40 | 41 | private: 42 | JoyButton *button; 43 | bool isflashing; 44 | }; 45 | 46 | #endif // JOYBUTTONSTATUSBOX_H 47 | -------------------------------------------------------------------------------- /src/unixcapturewindowutility.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef UNIXCAPTUREWINDOWUTILITY_H 20 | #define UNIXCAPTUREWINDOWUTILITY_H 21 | 22 | #include 23 | 24 | class UnixCaptureWindowUtility : public QObject 25 | { 26 | Q_OBJECT 27 | 28 | public: 29 | explicit UnixCaptureWindowUtility(QObject *parent = nullptr); 30 | QString getTargetPath() const; 31 | bool hasFailed() const; 32 | long getTargetWindow() const; 33 | 34 | signals: 35 | void captureFinished(); 36 | 37 | public slots: 38 | void attemptWindowCapture(); 39 | 40 | private: 41 | QString targetPath; 42 | bool failed; 43 | long targetWindow; 44 | }; 45 | 46 | #endif // UNIXCAPTUREWINDOWUTILITY_H 47 | -------------------------------------------------------------------------------- /src/xmlconfigmigration.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef XMLCONFIGMIGRATION_H 20 | #define XMLCONFIGMIGRATION_H 21 | 22 | #include 23 | 24 | class QXmlStreamReader; 25 | 26 | class XMLConfigMigration : public QObject 27 | { 28 | Q_OBJECT 29 | 30 | public: 31 | explicit XMLConfigMigration(QXmlStreamReader *reader, QObject *parent = nullptr); 32 | 33 | bool requiresMigration(); 34 | QString migrate(); 35 | 36 | const QXmlStreamReader *getReader(); 37 | int getFileVersion() const; 38 | 39 | private: 40 | QString readConfigToString(); 41 | QString version0006Migration(); 42 | 43 | QXmlStreamReader *reader; 44 | int fileVersion; 45 | }; 46 | 47 | #endif // XMLCONFIGMIGRATION_H 48 | -------------------------------------------------------------------------------- /src/gamecontroller/gamecontrollertriggerbutton.cpp: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska . 17 | */ 18 | 19 | #include "gamecontrollertriggerbutton.h" 20 | 21 | #include "globalvariables.h" 22 | #include "inputdevice.h" 23 | #include "joyaxis.h" 24 | #include "setjoystick.h" 25 | #include "xml/joybuttonxml.h" 26 | 27 | #include 28 | #include 29 | 30 | GameControllerTriggerButton::GameControllerTriggerButton(JoyAxis *axis, int index, int originset, SetJoystick *parentSet, 31 | QObject *parent) 32 | : JoyAxisButton(axis, index, originset, parentSet, parent) 33 | { 34 | } 35 | 36 | QString GameControllerTriggerButton::getXmlName() { return GlobalVariables::GameControllerTriggerButton::xmlName; } 37 | -------------------------------------------------------------------------------- /src/joysensorpushbutton.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2022 Max Maisel 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | #pragma once 18 | 19 | #include "flashbuttonwidget.h" 20 | 21 | class JoySensor; 22 | class QWidget; 23 | 24 | /** 25 | * @brief The central button in a SensorPushButtonGroup 26 | */ 27 | class JoySensorPushButton : public FlashButtonWidget 28 | { 29 | Q_OBJECT 30 | 31 | public: 32 | explicit JoySensorPushButton(JoySensor *sensor, bool displayNames, QWidget *parent = nullptr); 33 | 34 | JoySensor *getSensor() const; 35 | void tryFlash(); 36 | 37 | protected: 38 | virtual QString generateLabel() override; 39 | 40 | public slots: 41 | void disableFlashes() override; 42 | void enableFlashes() override; 43 | 44 | private slots: 45 | void showContextMenu(const QPoint &point); 46 | 47 | private: 48 | JoySensor *m_sensor; 49 | }; 50 | -------------------------------------------------------------------------------- /src/pt1filter.cpp: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2022 Max Maisel 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #include "pt1filter.h" 19 | #include 20 | 21 | const double PT1Filter::FALLBACK_RATE = 200; 22 | 23 | PT1Filter::PT1Filter(double tau, double rate) 24 | { 25 | double period = qFuzzyIsNull(rate) ? 1 / FALLBACK_RATE : 1 / rate; 26 | // Since it is a fixed rate filter, precalculte delta_t/tau 27 | // to save one division during sample processing. 28 | m_dt_tau = period / tau; 29 | reset(); 30 | } 31 | 32 | /** 33 | * @brief Processes a new sample. 34 | * @returns New filter output value. 35 | */ 36 | double PT1Filter::process(double value) 37 | { 38 | m_value = m_value + m_dt_tau * (value - m_value); 39 | return m_value; 40 | }; 41 | 42 | /** 43 | * @brief Resets the filter state to default. 44 | */ 45 | void PT1Filter::reset() { m_value = 0; } 46 | -------------------------------------------------------------------------------- /src/springmousemoveinfo.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef SPRINGMOUSEMOVEINFO_H 20 | #define SPRINGMOUSEMOVEINFO_H 21 | 22 | namespace PadderCommon { 23 | typedef struct _springModeInfo 24 | { 25 | // Displacement of the X axis 26 | double displacementX; 27 | // Displacement of the Y axis 28 | double displacementY; 29 | 30 | // Width and height of the spring mode box 31 | int width; // unsigned 32 | int height; // unsigned 33 | // Should the cursor not move around the center 34 | // of the screen. 35 | bool relative; 36 | int screen; //-1 for default screen 37 | double springDeadX; 38 | double springDeadY; 39 | 40 | } springModeInfo; 41 | } // namespace PadderCommon 42 | 43 | #endif // SPRINGMOUSEMOVEINFO_H 44 | -------------------------------------------------------------------------------- /src/gui/extraprofilesettingsdialog.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef KEYDELAYDIALOG_H 20 | #define KEYDELAYDIALOG_H 21 | 22 | #include 23 | 24 | class InputDevice; 25 | class QWidget; 26 | 27 | namespace Ui { 28 | class ExtraProfileSettingsDialog; 29 | } 30 | 31 | class ExtraProfileSettingsDialog : public QDialog 32 | { 33 | Q_OBJECT 34 | 35 | public: 36 | explicit ExtraProfileSettingsDialog(InputDevice *device, QWidget *parent = nullptr); 37 | ~ExtraProfileSettingsDialog(); 38 | 39 | InputDevice *getDevice() const; 40 | 41 | private: 42 | Ui::ExtraProfileSettingsDialog *ui; 43 | 44 | InputDevice *device; 45 | 46 | private slots: 47 | void changeDeviceKeyPress(int value); 48 | }; 49 | 50 | #endif // KEYDELAYDIALOG_H 51 | -------------------------------------------------------------------------------- /src/uihelpers/gamecontrollermappingdialoghelper.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef GAMECONTROLLERMAPPINGDIALOGHELPER_H 20 | #define GAMECONTROLLERMAPPINGDIALOGHELPER_H 21 | 22 | #include 23 | #include 24 | 25 | class InputDevice; 26 | 27 | class GameControllerMappingDialogHelper : public QObject 28 | { 29 | Q_OBJECT 30 | public: 31 | explicit GameControllerMappingDialogHelper(InputDevice *device, QObject *parent = nullptr); 32 | 33 | public slots: 34 | void raiseDeadZones(); 35 | void raiseDeadZones(int deadZone); 36 | void setupDeadZones(); 37 | void restoreDeviceDeadZones(); 38 | 39 | private: 40 | InputDevice *device; 41 | QList originalAxesDeadZones; 42 | }; 43 | 44 | #endif // GAMECONTROLLERMAPPINGDIALOGHELPER_H 45 | -------------------------------------------------------------------------------- /src/winextras.h: -------------------------------------------------------------------------------- 1 | #ifndef WINEXTRAS_H 2 | #define WINEXTRAS_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | class WinExtras : public QObject 10 | { 11 | Q_OBJECT 12 | public: 13 | static QString getDisplayString(unsigned int virtualkey); 14 | static unsigned int getVirtualKey(QString codestring); 15 | static unsigned int correctVirtualKey(unsigned int scancode, unsigned int virtualkey); 16 | static unsigned int scancodeFromVirtualKey(unsigned int virtualkey, unsigned int alias = 0); 17 | 18 | static const unsigned int EXTENDED_FLAG; 19 | static QString getForegroundWindowExePath(); 20 | static bool containsFileAssociationinRegistry(); 21 | static void writeFileAssocationToRegistry(); 22 | static void removeFileAssociationFromRegistry(); 23 | static bool IsRunningAsAdmin(); 24 | static bool elevateAntiMicro(); 25 | static void disablePointerPrecision(); 26 | static void enablePointerPrecision(); 27 | static bool isUsingEnhancedPointerPrecision(); 28 | static void grabCurrentPointerPrecision(); 29 | static QString getCurrentWindowText(); 30 | static bool raiseProcessPriority(); 31 | static QPoint getCursorPos(); 32 | 33 | protected: 34 | explicit WinExtras(QObject *parent = 0); 35 | void populateKnownAliases(); 36 | 37 | static WinExtras _instance; 38 | QHash knownAliasesX11SymVK; 39 | QHash knownAliasesVKStrings; 40 | static int originalMouseAccel; 41 | 42 | signals: 43 | 44 | public slots: 45 | }; 46 | 47 | #endif // WINEXTRAS_H 48 | -------------------------------------------------------------------------------- /src/event.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef EVENT_H 20 | #define EVENT_H 21 | 22 | #include "common.h" 23 | #include "joybuttonslot.h" 24 | #include "springmousemoveinfo.h" 25 | 26 | void sendevent(JoyButtonSlot *slot, bool pressed = true); 27 | void sendevent(int code1, int code2); 28 | void sendKeybEvent(JoyButtonSlot *slot, bool pressed = true); 29 | 30 | void sendSpringEvent(PadderCommon::springModeInfo *fullSpring, PadderCommon::springModeInfo *relativeSpring = 0, 31 | int *const mousePosX = 0, int *const mousePos = 0); 32 | 33 | int X11KeySymToKeycode(QString key); 34 | QString keycodeToKeyString(int keycode, int alias = 0); 35 | int X11KeyCodeToX11KeySym(int keycode); 36 | QString keysymToKeyString(int keysym, int alias = 0); 37 | 38 | #endif // EVENT_H 39 | -------------------------------------------------------------------------------- /src/mousedialog/springmoderegionpreview.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef SPRINGMODEREGIONPREVIEW_H 20 | #define SPRINGMODEREGIONPREVIEW_H 21 | 22 | #include 23 | 24 | class QPaintEvent; 25 | 26 | class SpringModeRegionPreview : public QWidget 27 | { 28 | Q_OBJECT 29 | 30 | public: 31 | explicit SpringModeRegionPreview(int width = 0, int height = 0, QWidget *parent = nullptr); 32 | 33 | protected: 34 | void paintEvent(QPaintEvent *event); 35 | 36 | int adjustSpringSizeWidth(int width); 37 | int adjustSpringSizeHeight(int height); 38 | 39 | public slots: 40 | void setSpringWidth(int width); 41 | void setSpringHeight(int height); 42 | void setSpringSize(int width, int height); 43 | }; 44 | 45 | #endif // SPRINGMODEREGIONPREVIEW_H 46 | -------------------------------------------------------------------------------- /src/dpadpushbutton.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef DPADPUSHBUTTON_H 20 | #define DPADPUSHBUTTON_H 21 | 22 | #include "flashbuttonwidget.h" 23 | 24 | class JoyDPad; 25 | class QWidget; 26 | 27 | class DPadPushButton : public FlashButtonWidget 28 | { 29 | Q_OBJECT 30 | 31 | public: 32 | explicit DPadPushButton(JoyDPad *dpad, bool displayNames, QWidget *parent = nullptr); 33 | 34 | JoyDPad *getDPad() const; 35 | void tryFlash(); 36 | 37 | protected: 38 | QString generateLabel() override; 39 | 40 | public slots: 41 | void disableFlashes() override; 42 | void enableFlashes() override; 43 | 44 | private slots: 45 | void showContextMenu(const QPoint &point); 46 | 47 | private: 48 | JoyDPad *dpad; 49 | }; 50 | 51 | #endif // DPADPUSHBUTTON_H 52 | -------------------------------------------------------------------------------- /src/gui/joyaxiswidget.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef JOYAXISWIDGET_H 20 | #define JOYAXISWIDGET_H 21 | 22 | #include "flashbuttonwidget.h" 23 | 24 | class JoyAxis; 25 | class QWidget; 26 | 27 | class JoyAxisWidget : public FlashButtonWidget 28 | { 29 | Q_OBJECT 30 | 31 | public: 32 | explicit JoyAxisWidget(JoyAxis *axis, bool displayNames, QWidget *parent = 0); 33 | 34 | JoyAxis *getAxis() const; 35 | void tryFlash(); 36 | 37 | protected: 38 | virtual QString generateLabel() override; 39 | 40 | public slots: 41 | void disableFlashes() override; 42 | void enableFlashes() override; 43 | 44 | private slots: 45 | void showContextMenu(const QPoint &point); 46 | 47 | private: 48 | JoyAxis *m_axis; 49 | }; 50 | 51 | #endif // JOYAXISWIDGET_H 52 | -------------------------------------------------------------------------------- /src/uihelpers/joyaxiscontextmenuhelper.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef JOYAXISCONTEXTMENUHELPER_H 20 | #define JOYAXISCONTEXTMENUHELPER_H 21 | 22 | #include "joybuttonslot.h" 23 | 24 | class JoyAxis; 25 | 26 | class JoyAxisContextMenuHelper : public QObject 27 | { 28 | Q_OBJECT 29 | public: 30 | explicit JoyAxisContextMenuHelper(JoyAxis *axis, QObject *parent = nullptr); 31 | 32 | protected: 33 | JoyAxis *axis; 34 | 35 | public slots: 36 | void setNAssignedSlot(int code, int alias, JoyButtonSlot::JoySlotInputAction mode = JoyButtonSlot::JoyKeyboard); 37 | void setPAssignedSlot(int code, int alias, JoyButtonSlot::JoySlotInputAction mode = JoyButtonSlot::JoyKeyboard); 38 | void clearAndResetAxisButtons(); 39 | }; 40 | 41 | #endif // JOYAXISCONTEXTMENUHELPER_H 42 | -------------------------------------------------------------------------------- /src/gui/setaxisthrottledialog.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef SETAXISTHROTTLEDIALOG_H 20 | #define SETAXISTHROTTLEDIALOG_H 21 | 22 | #include 23 | 24 | class JoyAxis; 25 | class QWidget; 26 | 27 | namespace Ui { 28 | class SetAxisThrottleDialog; 29 | } 30 | 31 | class SetAxisThrottleDialog : public QDialog 32 | { 33 | Q_OBJECT 34 | 35 | public: 36 | explicit SetAxisThrottleDialog(JoyAxis *axis, QWidget *parent = nullptr); 37 | ~SetAxisThrottleDialog(); 38 | 39 | JoyAxis *getAxis() const; 40 | 41 | signals: 42 | void initiateSetAxisThrottleChange(); 43 | 44 | private slots: 45 | void propogateThrottleChange(); 46 | 47 | private: 48 | Ui::SetAxisThrottleDialog *ui; 49 | 50 | JoyAxis *axis; 51 | }; 52 | 53 | #endif // SETAXISTHROTTLEDIALOG_H 54 | -------------------------------------------------------------------------------- /src/uihelpers/joysensoriothreadhelper.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2022 Max Maisel 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | #pragma once 18 | 19 | #include "joysensordirection.h" 20 | 21 | #include 22 | #include 23 | 24 | class JoyButtonSlot; 25 | class JoySensor; 26 | 27 | /** 28 | * @brief Some helper methods which run in the IO thread and are called 29 | * from the GUI thread. 30 | */ 31 | class JoySensorIoThreadHelper : public QObject 32 | { 33 | Q_OBJECT 34 | 35 | public: 36 | explicit JoySensorIoThreadHelper(JoySensor *sensor, QObject *parent = nullptr); 37 | void setPendingSlots(QHash *tempSlots); 38 | void clearPendingSlots(); 39 | 40 | public slots: 41 | void setFromPendingSlots(); 42 | void clearButtonsSlotsEventReset(); 43 | 44 | private: 45 | JoySensor *m_sensor; 46 | QHash m_pending_slots; 47 | }; 48 | -------------------------------------------------------------------------------- /src/xml/joyaxisxml.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2020 Jagoda Górska 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #ifndef JOYAXISXML_H 19 | #define JOYAXISXML_H 20 | 21 | #include 22 | #include 23 | 24 | class JoyAxis; 25 | class JoyButtonXml; 26 | class QXmlStreamReader; 27 | class QXmlStreamWriter; 28 | 29 | class JoyAxisXml : public QObject 30 | { 31 | Q_OBJECT 32 | 33 | public: 34 | explicit JoyAxisXml(JoyAxis *axis, QObject *parent = nullptr); 35 | ~JoyAxisXml(); 36 | 37 | virtual void readConfig(QXmlStreamReader *xml); 38 | virtual void writeConfig(QXmlStreamWriter *xml); 39 | 40 | virtual bool readMainConfig(QXmlStreamReader *xml); 41 | virtual bool readButtonConfig(QXmlStreamReader *xml); 42 | 43 | private: 44 | JoyAxis *m_joyAxis; 45 | QPointer joyButtonXmlNAxis; 46 | QPointer joyButtonXmlPAxis; 47 | }; 48 | 49 | #endif // JOYAXISXML_H 50 | -------------------------------------------------------------------------------- /src/gui/joybuttonwidget.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef JOYBUTTONWIDGET_H 20 | #define JOYBUTTONWIDGET_H 21 | 22 | #include "flashbuttonwidget.h" 23 | 24 | class JoyButton; 25 | class QWidget; 26 | 27 | class JoyButtonWidget : public FlashButtonWidget 28 | { 29 | Q_OBJECT 30 | 31 | public: 32 | explicit JoyButtonWidget(JoyButton *button, bool displayNames, QWidget *parent = 0); 33 | 34 | JoyButton *getJoyButton() const; 35 | void tryFlash(); 36 | 37 | protected: 38 | virtual QString generateLabel() override; 39 | 40 | public slots: 41 | void disableFlashes() override; 42 | void enableFlashes() override; 43 | 44 | private slots: 45 | void showContextMenu(const QPoint &point); 46 | 47 | private: 48 | JoyButton *m_button; 49 | }; 50 | 51 | #endif // JOYBUTTONWIDGET_H 52 | -------------------------------------------------------------------------------- /src/joysensorstatusbox.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2022 Max Maisel 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | #pragma once 18 | 19 | #include 20 | #include 21 | 22 | class JoySensor; 23 | class QPaintEvent; 24 | 25 | /** 26 | * @brief The GUI sensor position indicator widget 27 | * 28 | * It shows the yaw and roll angles on an artificial horizon instrument. 29 | * In case of a gyroscope, the inner parts has an additional horizontal 30 | * degree of freedom. 31 | */ 32 | class JoySensorStatusBox : public QWidget 33 | { 34 | Q_OBJECT 35 | 36 | public: 37 | explicit JoySensorStatusBox(QWidget *parent = nullptr); 38 | 39 | void setSensor(JoySensor *sensor); 40 | JoySensor *getSensor() const; 41 | 42 | virtual QSize sizeHint() const override; 43 | 44 | protected: 45 | virtual void paintEvent(QPaintEvent *event) override; 46 | void drawArtificialHorizon(); 47 | 48 | private: 49 | JoySensor *m_sensor; 50 | }; 51 | -------------------------------------------------------------------------------- /src/gamecontroller/gamecontrollerdpad.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef GAMECONTROLLERDPAD_H 20 | #define GAMECONTROLLERDPAD_H 21 | 22 | #include "vdpad.h" 23 | 24 | class QXmlStreamReader; 25 | class JoyButton; 26 | class SetJoystick; 27 | class DPad; 28 | 29 | // holds information about gamecontroller dpad 30 | 31 | class GameControllerDPad : public VDPad 32 | { 33 | Q_OBJECT 34 | 35 | public: 36 | explicit GameControllerDPad(JoyButton *upButton, JoyButton *downButton, JoyButton *leftButton, JoyButton *rightButton, 37 | int index, int originset, SetJoystick *parentSet, QObject *parent = nullptr); 38 | 39 | virtual QString getName(bool forceFullFormat, bool displayName); 40 | virtual QString getXmlName(); // GameControllerDPadXml class 41 | }; 42 | 43 | #endif // GAMECONTROLLERDPAD_H 44 | -------------------------------------------------------------------------------- /src/joykeyrepeathelper.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef JOYKEYREPEATHELPER_H 20 | #define JOYKEYREPEATHELPER_H 21 | 22 | #include 23 | #include 24 | 25 | class JoyButtonSlot; 26 | 27 | class JoyKeyRepeatHelper : public QObject 28 | { 29 | Q_OBJECT 30 | 31 | public: 32 | explicit JoyKeyRepeatHelper(QObject *parent = nullptr); 33 | QTimer *getRepeatTimer(); 34 | 35 | void setLastActiveKey(JoyButtonSlot *slot); 36 | JoyButtonSlot *getLastActiveKey(); 37 | 38 | void setKeyRepeatRate(int repeatRate); 39 | int getKeyRepeatRate(); 40 | 41 | private slots: 42 | void repeatKeysEvent(); 43 | 44 | protected: 45 | QTimer keyRepeatTimer; 46 | JoyButtonSlot *lastActiveKey; 47 | int keyRepeatDelay; 48 | int keyRepeatRate; 49 | }; 50 | 51 | #endif // JOYKEYREPEATHELPER_H 52 | -------------------------------------------------------------------------------- /src/joysensorbuttonpushbutton.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2022 Max Maisel 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | #pragma once 18 | 19 | #include "flashbuttonwidget.h" 20 | 21 | class JoySensorButton; 22 | class QWidget; 23 | 24 | /** 25 | * @brief A direction button in the SensorPushButtonGroup 26 | */ 27 | class JoySensorButtonPushButton : public FlashButtonWidget 28 | { 29 | Q_OBJECT 30 | Q_PROPERTY(bool isflashing READ isButtonFlashing) 31 | 32 | public: 33 | explicit JoySensorButtonPushButton(JoySensorButton *button, bool displayNames, QWidget *parent = nullptr); 34 | 35 | JoySensorButton *getButton(); 36 | void tryFlash(); 37 | 38 | protected: 39 | virtual QString generateLabel() override; 40 | 41 | public slots: 42 | void disableFlashes() override; 43 | void enableFlashes() override; 44 | 45 | private slots: 46 | void showContextMenu(const QPoint &point); 47 | 48 | private: 49 | JoySensorButton *m_button; 50 | }; 51 | -------------------------------------------------------------------------------- /src/joysensorpreset.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2022 Max Maisel 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | #pragma once 18 | 19 | #include "uihelpers/joysensoriothreadhelper.h" 20 | 21 | /** 22 | * @brief Defines presets for a sensor 23 | */ 24 | class JoySensorPreset : public QObject 25 | { 26 | Q_OBJECT 27 | 28 | public: 29 | enum Preset 30 | { 31 | PRESET_NONE, 32 | PRESET_MOUSE, 33 | PRESET_MOUSE_INV_H, 34 | PRESET_MOUSE_INV_V, 35 | PRESET_MOUSE_INV_HV, 36 | PRESET_ARROWS, 37 | PRESET_WASD, 38 | PRESET_NUMPAD 39 | }; 40 | 41 | explicit JoySensorPreset(JoySensor *sensor, QObject *parent = nullptr); 42 | 43 | QList getAvailablePresets(); 44 | Preset currentPreset(); 45 | QString getPresetName(Preset); 46 | void setSensorPreset(Preset); 47 | JoySensorIoThreadHelper &getHelper(); 48 | 49 | private: 50 | JoySensor *m_sensor; 51 | JoySensorIoThreadHelper m_helper; 52 | }; 53 | -------------------------------------------------------------------------------- /src/statisticsestimator.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2022 Max Maisel 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | #pragma once 18 | 19 | #include 20 | 21 | /** 22 | * @brief Estimates mean of a data stream using Welford's algorithm and 23 | * calculates statistic properties. 24 | */ 25 | class StatisticsEstimator 26 | { 27 | public: 28 | StatisticsEstimator(); 29 | 30 | void reset(); 31 | void process(double x); 32 | 33 | /** 34 | * @brief Gets the amount of processed samples. 35 | * @returns Processed sample count. 36 | */ 37 | inline size_t getCount() const { return m_count; } 38 | /** 39 | * @brief Gets the mean of processed samples. 40 | * @returns Mean of processed samples. 41 | */ 42 | inline double getMean() const { return m_mean; } 43 | double calculateVariance() const; 44 | double calculateRelativeErrorSq() const; 45 | 46 | private: 47 | double m_mean; 48 | double m_var; 49 | size_t m_count; 50 | }; 51 | -------------------------------------------------------------------------------- /src/uihelpers/dpadcontextmenuhelper.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef DPADCONTEXTMENUHELPER_H 20 | #define DPADCONTEXTMENUHELPER_H 21 | 22 | #include "joydpad.h" 23 | 24 | class JoyButtonSlot; 25 | 26 | class DPadContextMenuHelper : public QObject 27 | { 28 | Q_OBJECT 29 | 30 | public: 31 | explicit DPadContextMenuHelper(JoyDPad *dpad, QObject *parent = nullptr); 32 | void setPendingSlots(QHash *tempSlots); 33 | void clearPendingSlots(); 34 | QHash const &getPendingSlots(); 35 | 36 | public slots: 37 | void setFromPendingSlots(); 38 | void clearButtonsSlotsEventReset(); 39 | 40 | private: 41 | JoyDPad *dpad; 42 | QHash pendingSlots; 43 | }; 44 | 45 | #endif // DPADCONTEXTMENUHELPER_H 46 | -------------------------------------------------------------------------------- /src/joycontrolstickpushbutton.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef JOYCONTROLSTICKPUSHBUTTON_H 20 | #define JOYCONTROLSTICKPUSHBUTTON_H 21 | 22 | #include "flashbuttonwidget.h" 23 | 24 | class JoyControlStick; 25 | class QWidget; 26 | 27 | class JoyControlStickPushButton : public FlashButtonWidget 28 | { 29 | Q_OBJECT 30 | 31 | public: 32 | explicit JoyControlStickPushButton(JoyControlStick *stick, bool displayNames, QWidget *parent = nullptr); 33 | 34 | JoyControlStick *getStick() const; 35 | void tryFlash(); 36 | 37 | protected: 38 | virtual QString generateLabel() override; 39 | 40 | public slots: 41 | void disableFlashes() override; 42 | void enableFlashes() override; 43 | 44 | private slots: 45 | void showContextMenu(const QPoint &point); 46 | 47 | private: 48 | JoyControlStick *stick; 49 | }; 50 | 51 | #endif // JOYCONTROLSTICKPUSHBUTTON_H 52 | -------------------------------------------------------------------------------- /src/antimicrosettings.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef ANTIMICROSETTINGS_H 20 | #define ANTIMICROSETTINGS_H 21 | 22 | #include "commandlineutility.h" 23 | 24 | #include 25 | 26 | class AntiMicroSettings : public QSettings 27 | { 28 | Q_OBJECT 29 | 30 | public: 31 | explicit AntiMicroSettings(const QString &fileName, Format format, QObject *parent = nullptr); 32 | 33 | QVariant runtimeValue(const QString &key, const QVariant &defaultValue = QVariant()) const; 34 | void importFromCommandLine(CommandLineUtility &cmdutility); 35 | QMutex *getLock(); 36 | QSettings &getCmdSettings(); 37 | 38 | static const bool defaultDisabledWinEnhanced; 39 | 40 | void applySettingsToLogger(CommandLineUtility &cmdutility, Logger *logger = nullptr); 41 | 42 | protected: 43 | QSettings cmdSettings; 44 | QMutex lock; 45 | }; 46 | 47 | #endif // ANTIMICROSETTINGS_H 48 | -------------------------------------------------------------------------------- /src/gui/joytabwidgetcontainer.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef JOYTABWIDGETCONTAINER_H 20 | #define JOYTABWIDGETCONTAINER_H 21 | 22 | #include 23 | 24 | class QWidget; 25 | class JoyTabWidget; 26 | class InputDevice; 27 | 28 | class JoyTabWidgetContainer : public QTabWidget 29 | { 30 | Q_OBJECT 31 | 32 | public: 33 | explicit JoyTabWidgetContainer(QWidget *parent = nullptr); 34 | 35 | int addTab(QWidget *widget, const QString &string); 36 | int addTab(JoyTabWidget *widget, const QString &string); 37 | 38 | public slots: 39 | void disableFlashes(InputDevice *joystick); 40 | void enableFlashes(InputDevice *joystick); 41 | 42 | private slots: 43 | void flash(InputDevice *joystick); 44 | void unflash(InputDevice *joystick); 45 | void unflashAll(); 46 | void unflashTab(JoyTabWidget *tabWidget); 47 | }; 48 | 49 | #endif // JOYTABWIDGETCONTAINER_H 50 | -------------------------------------------------------------------------------- /src/uihelpers/dpadeditdialoghelper.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef DPADEDITDIALOGHELPER_H 20 | #define DPADEDITDIALOGHELPER_H 21 | 22 | #include "joydpad.h" 23 | 24 | class JoyButtonSlot; 25 | 26 | class DPadEditDialogHelper : public QObject 27 | { 28 | Q_OBJECT 29 | 30 | public: 31 | explicit DPadEditDialogHelper(JoyDPad *dpad, QObject *parent = nullptr); 32 | void setPendingSlots(QHash *tempSlots); 33 | void clearPendingSlots(); 34 | QHash const &getPendingSlots(); 35 | 36 | public slots: 37 | void setFromPendingSlots(); 38 | void clearButtonsSlotsEventReset(); 39 | void updateJoyDPadDelay(int value); 40 | 41 | private: 42 | JoyDPad *dpad; 43 | QHash pendingSlots; 44 | }; 45 | 46 | #endif // DPADEDITDIALOGHELPER_H 47 | -------------------------------------------------------------------------------- /share/antimicrox/translations/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # This will ensure that the *.qm files will be stored 2 | # in the right place within the build directory. 3 | file(GLOB antimicrox_TRANSLATIONS antimicrox_*.ts) 4 | list(APPEND antimicrox_TRANSLATIONS antimicrox.ts) 5 | file(GLOB_RECURSE antimicrox_BASE_SOURCES ${PROJECT_SOURCE_DIR}/src/*.cpp) 6 | file(GLOB_RECURSE antimicrox_BASE_FORMS ${PROJECT_SOURCE_DIR}/src/*.ui) 7 | 8 | 9 | if(QT_VERSION VERSION_GREATER_EQUAL 5.15) 10 | if(UPDATE_TRANSLATIONS) 11 | message("Update translations - lupdate ON") 12 | if(TRANS_REMOVE_OBSOLETE) 13 | message("getting rid of old text entries: \"lupdate -noobsolete\" ON") 14 | QT_CREATE_TRANSLATION(antimicrox_QMFILES ${antimicrox_BASE_SOURCES} 15 | ${antimicrox_BASE_FORMS} ${antimicrox_TRANSLATIONS} OPTIONS -no-obsolete) 16 | else() 17 | QT_CREATE_TRANSLATION(antimicrox_QMFILES ${antimicrox_BASE_SOURCES} 18 | ${antimicrox_BASE_FORMS} ${antimicrox_TRANSLATIONS}) 19 | endif(TRANS_REMOVE_OBSOLETE) 20 | else() 21 | QT_ADD_TRANSLATION(antimicrox_QMFILES ${antimicrox_TRANSLATIONS}) 22 | endif(UPDATE_TRANSLATIONS) 23 | else() 24 | # Since 5.15 QT commands are universal 25 | QT5_ADD_TRANSLATION(antimicrox_QMFILES ${antimicrox_TRANSLATIONS}) 26 | if(UPDATE_TRANSLATIONS) 27 | warning("Updating translations only for QT 5.15 or newer.") 28 | endif() 29 | endif() 30 | 31 | 32 | add_custom_target(updateqm DEPENDS ${antimicrox_QMFILES} COMMENT "Update translation files based on source and ui files") 33 | install(FILES ${antimicrox_QMFILES} DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/antimicrox/translations") 34 | 35 | set_directory_properties(PROPERTIES CLEAN_NO_CUSTOM true) 36 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to AntiMicroX 2 | 3 | We welcome and appreciate all contributions to this open source project! 4 | 5 | ## How to contribute 6 | 7 | Before contributing, please take a moment to review the following guidelines: 8 | 9 | 1. Check the [issue tracker](https://github.com/AntiMicroX/antimicrox/issues) to see if the issue or feature you're interested in has already been reported or discussed. 10 | 2. If you would like to suggest a new feature, please [start a new issue](https://github.com/AntiMicroX/antimicrox/issues/new/choose) to discuss the proposal. 11 | 3. If you would like to contribute code, check the [project's coding guidelines](https://github.com/AntiMicroX/antimicrox/wiki/Coding-guidelines) and make sure your code is well-documented preferably in doxygen-compatible format. 12 | 4. Submit a pull request to the main repository for review. In case of preparing bigger changes into the codebase it is recommended to firstly open `Draft Pull Request` to show what you are going to do. 13 | 14 | During coding you may find [AntiMicroX online docs](https://antimicrox.github.io/doxygen/) useful. 15 | 16 | ## Translation 17 | 18 | Translation process is handled via [Weblate](https://weblate.org/). If you want to help just click this [link](https://hosted.weblate.org/engage/antimicrox). 19 | 20 | Translation status 21 | 22 | 23 | Translation status 24 | 25 | 26 | More information about translating can be found [here](https://github.com/AntiMicroX/antimicrox/wiki/Translating-AntiMicroX). 27 | 28 | ## License 29 | 30 | By contributing to this project, you agree to license your contributions under the GPL-3.0 license. 31 | -------------------------------------------------------------------------------- /src/joybuttoncontextmenu.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef JOYBUTTONCONTEXTMENU_H 20 | #define JOYBUTTONCONTEXTMENU_H 21 | 22 | #include 23 | #include 24 | 25 | class JoyButton; 26 | class QWidget; 27 | 28 | class JoyButtonContextMenu : public QMenu 29 | { 30 | Q_OBJECT 31 | 32 | public: 33 | explicit JoyButtonContextMenu(JoyButton *button, QWidget *parent = nullptr); 34 | void buildMenu(); 35 | 36 | protected: 37 | JoyButton *button; 38 | 39 | private slots: 40 | void switchToggle(); 41 | void switchTurbo(); 42 | void switchSetMode(QAction *action); 43 | void disableSetMode(); 44 | void clearButton(); 45 | void createActionForGroup(QActionGroup *tempGroup, QString actionText, QAction *action, QMenu *tempSetMenu, 46 | int setSelection, int currentSelection, int setDataInc, int setCondition); 47 | }; 48 | 49 | #endif // JOYBUTTONCONTEXTMENU_H 50 | -------------------------------------------------------------------------------- /src/gamecontroller/gamecontrollerset.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef GAMECONTROLLERSET_H 20 | #define GAMECONTROLLERSET_H 21 | 22 | #include "setjoystick.h" 23 | 24 | #include 25 | 26 | class QXmlStreamReader; 27 | class InputDevice; 28 | 29 | /** 30 | * @brief A SetJoystick specialized for gamepads 31 | */ 32 | class GameControllerSet : public SetJoystick 33 | { 34 | Q_OBJECT 35 | 36 | public: 37 | explicit GameControllerSet(InputDevice *device, int index, QObject *parent = nullptr); 38 | 39 | virtual void refreshAxes(); 40 | 41 | virtual void readConfig(QXmlStreamReader *xml); 42 | 43 | protected: 44 | void populateSticksDPad(); 45 | 46 | public slots: 47 | virtual void reset(); 48 | void applyHapticTrigger(); 49 | 50 | private: 51 | void getElemFromXml(QString elemName, QXmlStreamReader *xml); 52 | void resetSticks(); 53 | }; 54 | 55 | #endif // GAMECONTROLLERSET_H 56 | -------------------------------------------------------------------------------- /src/joyaxiscontextmenu.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef JOYAXISCONTEXTMENU_H 20 | #define JOYAXISCONTEXTMENU_H 21 | 22 | #include "uihelpers/joyaxiscontextmenuhelper.h" 23 | 24 | #include 25 | 26 | class JoyAxis; 27 | class QWidget; 28 | 29 | class JoyAxisContextMenu : public QMenu 30 | { 31 | Q_OBJECT 32 | 33 | public: 34 | explicit JoyAxisContextMenu(JoyAxis *axis, QWidget *parent = nullptr); 35 | void buildMenu(); 36 | void buildAxisMenu(); 37 | void buildTriggerMenu(); 38 | 39 | protected: 40 | int getPresetIndex(); 41 | int getTriggerPresetIndex(); 42 | 43 | private slots: 44 | void setAxisPreset(QAction *action); 45 | void setTriggerPreset(QAction *action); 46 | void openMouseSettingsDialog(); 47 | 48 | private: 49 | JoyAxisContextMenuHelper &getHelperLocal(); 50 | 51 | JoyAxis *axis; 52 | JoyAxisContextMenuHelper helper; 53 | }; 54 | 55 | #endif // JOYAXISCONTEXTMENU_H 56 | -------------------------------------------------------------------------------- /src/localantimicroserver.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef LOCALANTIMICROSERVER_H 20 | #define LOCALANTIMICROSERVER_H 21 | 22 | #include 23 | #include 24 | 25 | class QLocalServer; 26 | 27 | /** 28 | * @brief Class used for checking presence of other AntiMicroX instances and communicating with them. 29 | */ 30 | class LocalAntiMicroServer : public QObject 31 | { 32 | Q_OBJECT 33 | 34 | public: 35 | explicit LocalAntiMicroServer(QObject *parent = nullptr); 36 | 37 | QLocalServer *getLocalServer() const; 38 | 39 | signals: 40 | void clientdisconnect(); 41 | void showHiddenWindow(); 42 | 43 | public slots: 44 | void startLocalServer(); 45 | void handleOutsideConnection(); 46 | void handleSocketDisconnect(); 47 | void close(); 48 | 49 | private: 50 | void checkForMessages(QLocalSocket *socket); 51 | 52 | QLocalServer *localServer; 53 | }; 54 | 55 | #endif // LOCALANTIMICROSERVER_H 56 | -------------------------------------------------------------------------------- /src/xml/setjoystickxml.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2020 Jagoda Górska 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #ifndef SETJOYSTICKXML_H 19 | #define SETJOYSTICKXML_H 20 | 21 | #include 22 | 23 | class SetJoystick; 24 | class JoyAxisXml; 25 | class JoyButtonXml; 26 | class QXmlStreamReader; 27 | class QXmlStreamWriter; 28 | 29 | /** 30 | * @brief SetJoystick XML serialization/deserialization helper class 31 | * Reads data from the supplied SetJoystick object and writes it to XML or 32 | * reads data from an QXmlStreamReader and writes it to the SetJoystick object. 33 | */ 34 | class SetJoystickXml : public QObject 35 | { 36 | Q_OBJECT 37 | 38 | public: 39 | explicit SetJoystickXml(SetJoystick *setJoystick, QObject *parent = nullptr); 40 | 41 | virtual void readConfig(QXmlStreamReader *xml); 42 | virtual void writeConfig(QXmlStreamWriter *xml); 43 | 44 | private: 45 | SetJoystick *m_setJoystick; 46 | 47 | // JoyDPadXml* joydpadXml; 48 | JoyAxisXml *joyAxisXml; 49 | JoyButtonXml *joyButtonXml; 50 | }; 51 | 52 | #endif // SETJOYSTICKXML_H 53 | -------------------------------------------------------------------------------- /src/keyboard/virtualmousepushbutton.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef VIRTUALMOUSEPUSHBUTTON_H 20 | #define VIRTUALMOUSEPUSHBUTTON_H 21 | 22 | #include 23 | 24 | #include 25 | 26 | /** 27 | * @brief PushButton representing mouse action in VirtualKeyboardMouseWidget 28 | * 29 | */ 30 | class VirtualMousePushButton : public QPushButton 31 | { 32 | Q_OBJECT 33 | 34 | public: 35 | explicit VirtualMousePushButton(QString displayText, int code, JoyButtonSlot::JoySlotInputAction mode, 36 | QWidget *parent = nullptr); 37 | 38 | int getMouseCode() const; 39 | JoyButtonSlot::JoySlotInputAction getMouseMode() const; 40 | 41 | signals: 42 | void mouseSlotCreated(JoyButtonSlot *tempslot); 43 | 44 | private slots: 45 | void createTempSlot(); 46 | 47 | private: 48 | int code; 49 | JoyButtonSlot::JoySlotInputAction mode; 50 | }; 51 | 52 | #endif // VIRTUALMOUSEPUSHBUTTON_H 53 | -------------------------------------------------------------------------------- /src/mousedialog/uihelpers/mouseaxissettingsdialoghelper.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef MOUSEAXISSETTINGSDIALOGHELPER_H 20 | #define MOUSEAXISSETTINGSDIALOGHELPER_H 21 | 22 | #include 23 | 24 | class JoyAxis; 25 | 26 | class MouseAxisSettingsDialogHelper : public QObject 27 | { 28 | Q_OBJECT 29 | 30 | public: 31 | explicit MouseAxisSettingsDialogHelper(JoyAxis *axis, QObject *parent = nullptr); 32 | 33 | JoyAxis *getAxis() const; 34 | 35 | public slots: 36 | void updateExtraAccelerationStatus(bool checked); 37 | void updateExtraAccelerationMultiplier(double value); 38 | 39 | void updateStartMultiPercentage(double value); 40 | void updateMinAccelThreshold(double value); 41 | void updateMaxAccelThreshold(double value); 42 | void updateAccelExtraDuration(double value); 43 | void updateReleaseSpringRadius(int value); 44 | 45 | private: 46 | JoyAxis *axis; 47 | }; 48 | 49 | #endif // MOUSEAXISSETTINGSDIALOGHELPER_H 50 | -------------------------------------------------------------------------------- /src/joycontrolstickstatusbox.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef JOYCONTROLSTICKSTATUSBOX_H 20 | #define JOYCONTROLSTICKSTATUSBOX_H 21 | 22 | #include 23 | #include 24 | 25 | class JoyControlStick; 26 | class QPaintEvent; 27 | 28 | class JoyControlStickStatusBox : public QWidget 29 | { 30 | Q_OBJECT 31 | 32 | public: 33 | explicit JoyControlStickStatusBox(QWidget *parent = nullptr); 34 | explicit JoyControlStickStatusBox(JoyControlStick *stick, QWidget *parent = nullptr); 35 | 36 | void setStick(JoyControlStick *stick); 37 | 38 | JoyControlStick *getStick() const; 39 | 40 | virtual int heightForWidth(int width) const; 41 | QSize sizeHint() const; 42 | 43 | protected: 44 | virtual void paintEvent(QPaintEvent *event); 45 | void drawEightWayBox(); 46 | void drawFourWayCardinalBox(); 47 | void drawFourWayDiagonalBox(); 48 | 49 | private: 50 | JoyControlStick *m_stick; 51 | }; 52 | 53 | #endif // JOYCONTROLSTICKSTATUSBOX_H 54 | -------------------------------------------------------------------------------- /src/joygyroscopesensor.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2022 Max Maisel 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #pragma once 19 | 20 | #include "joysensor.h" 21 | 22 | class SetJoystick; 23 | 24 | /** 25 | * @brief Represents a gyroscope sensor. 26 | */ 27 | class JoyGyroscopeSensor : public JoySensor 28 | { 29 | public: 30 | explicit JoyGyroscopeSensor(int originset, SetJoystick *parent_set, QObject *parent); 31 | virtual ~JoyGyroscopeSensor(); 32 | 33 | virtual float getXCoordinate() const override; 34 | virtual float getYCoordinate() const override; 35 | virtual float getZCoordinate() const override; 36 | virtual QString sensorTypeName() const override; 37 | 38 | virtual void getCalibration(double *offsetX, double *offsetY, double *offsetZ) const override; 39 | virtual void setCalibration(double offsetX, double offsetY, double offsetZ) override; 40 | 41 | public slots: 42 | virtual void reset() override; 43 | 44 | protected: 45 | virtual void populateButtons(); 46 | virtual JoySensorDirection calculateSensorDirection() override; 47 | virtual void applyCalibration() override; 48 | }; 49 | -------------------------------------------------------------------------------- /src/inputdevicebitarraystatus.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef INPUTDEVICESTATUSEVENT_H 20 | #define INPUTDEVICESTATUSEVENT_H 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | class InputDevice; 27 | 28 | class InputDeviceBitArrayStatus : public QObject 29 | { 30 | Q_OBJECT 31 | 32 | public: 33 | explicit InputDeviceBitArrayStatus(InputDevice *device, bool readCurrent, QObject *parent); 34 | 35 | void changeAxesStatus(int axisIndex, bool value); 36 | void changeButtonStatus(int buttonIndex, bool value); 37 | void changeHatStatus(int hatIndex, bool value); 38 | void changeSensorStatus(int sensorIndex, bool value); 39 | 40 | QBitArray generateFinalBitArray(); 41 | void clearStatusValues(); 42 | 43 | private: 44 | QBitArray &getButtonStatusLocal(); 45 | 46 | QList axesStatus; 47 | QList hatButtonStatus; 48 | QBitArray buttonStatus; 49 | QBitArray m_sensor_status; 50 | }; 51 | 52 | #endif // INPUTDEVICESTATUSEVENT_H 53 | -------------------------------------------------------------------------------- /src/mousedialog/mousesensorsettingsdialog.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2022 Max Maisel 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | #pragma once 18 | 19 | #include "ui_mousesettingsdialog.h" 20 | 21 | #include "mousesettingsdialog.h" 22 | 23 | class JoySensor; 24 | class SpringModeRegionPreview; 25 | 26 | /** 27 | * @brief Mouse settings dialog specialized for sensors 28 | */ 29 | class MouseSensorSettingsDialog : public MouseSettingsDialog 30 | { 31 | Q_OBJECT 32 | 33 | public: 34 | explicit MouseSensorSettingsDialog(JoySensor *sensor, QWidget *parent = 0); 35 | 36 | JoySensor *getSensor() const; 37 | 38 | protected: 39 | void calculateMouseSpeedPreset(); 40 | void calculateWheelSpeedPreset(); 41 | void updateWindowTitleSensorName(); 42 | 43 | public slots: 44 | void updateConfigHorizontalSpeed(int value); 45 | void updateConfigVerticalSpeed(int value); 46 | void updateWheelSpeedHorizontalSpeed(int value); 47 | void updateWheelSpeedVerticalSpeed(int value); 48 | 49 | virtual void changeMouseMode(int index); 50 | virtual void changeMouseCurve(int index); 51 | 52 | private: 53 | JoySensor *m_sensor; 54 | }; 55 | -------------------------------------------------------------------------------- /src/gui/joysensoreditdialog.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2022 Max Maisel 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | #pragma once 18 | 19 | #include "joysensorpreset.h" 20 | 21 | #include 22 | 23 | class JoySensor; 24 | class QWidget; 25 | 26 | namespace Ui { 27 | class JoySensorEditDialog; 28 | } 29 | 30 | /** 31 | * @brief The configuration dialog for a JoySensor itself 32 | */ 33 | class JoySensorEditDialog : public QDialog 34 | { 35 | Q_OBJECT 36 | 37 | public: 38 | explicit JoySensorEditDialog(JoySensor *sensor, QWidget *parent = nullptr); 39 | ~JoySensorEditDialog(); 40 | 41 | private: 42 | Ui::JoySensorEditDialog *m_ui; 43 | bool m_keypad_unlocked; 44 | 45 | JoySensor *m_sensor; 46 | JoySensorPreset m_preset; 47 | 48 | private slots: 49 | void implementPresets(int index); 50 | 51 | void openMouseSettingsDialog(); 52 | void enableMouseSettingButton(); 53 | void updateSensorStats(float x, float y, float z); 54 | void updateWindowTitleSensorName(); 55 | void updateSensorDelaySpinBox(int value); 56 | void updateSensorDelaySlider(double value); 57 | void setSensorDelay(double value); 58 | }; 59 | -------------------------------------------------------------------------------- /src/gui/joydpadbuttonwidget.cpp: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #include "joydpadbuttonwidget.h" 20 | 21 | #include "joybuttontypes/joybutton.h" 22 | 23 | #include 24 | #include 25 | 26 | JoyDPadButtonWidget::JoyDPadButtonWidget(JoyButton *button, bool displayNames, QWidget *parent) 27 | : JoyButtonWidget(button, displayNames, parent) 28 | { // Ensure that JoyDPadButtonWidget::generateLabel is called. 29 | refreshLabel(); 30 | } 31 | 32 | /** 33 | * @brief Generate the string that will be displayed on the button 34 | * @return Display string 35 | */ 36 | QString JoyDPadButtonWidget::generateLabel() 37 | { 38 | QString temp = QString(); 39 | if (!getJoyButton()->getActionName().isEmpty() && ifDisplayNames()) 40 | { 41 | temp = getJoyButton()->getActionName(); 42 | } else 43 | { 44 | temp = getJoyButton()->getCalculatedActiveZoneSummary(); 45 | } 46 | temp.replace("&", "&&"); 47 | 48 | qDebug() << "Name of joy dpad button is: " << temp; 49 | 50 | return temp; 51 | } 52 | -------------------------------------------------------------------------------- /src/joycontrolstickcontextmenu.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef JOYCONTROLSTICKCONTEXTMENU_H 20 | #define JOYCONTROLSTICKCONTEXTMENU_H 21 | 22 | #include "uihelpers/joycontrolstickcontextmenuhelper.h" 23 | 24 | #include 25 | 26 | class JoyControlStick; 27 | class QWidget; 28 | 29 | /** 30 | * @brief The control stick context menu widget used by StickPushButtonGroup 31 | */ 32 | class JoyControlStickContextMenu : public QMenu 33 | { 34 | Q_OBJECT 35 | 36 | public: 37 | explicit JoyControlStickContextMenu(JoyControlStick *stick, QWidget *parent = nullptr); 38 | void buildMenu(); 39 | 40 | protected: 41 | int getPresetIndex(); 42 | 43 | private slots: 44 | void setStickPreset(QAction *action); 45 | void setStickMode(QAction *action); 46 | void openMouseSettingsDialog(); 47 | 48 | private: 49 | JoyControlStickContextMenuHelper &getHelperLocal(); 50 | 51 | JoyControlStick *stick; 52 | JoyControlStickContextMenuHelper helper; 53 | }; 54 | 55 | #endif // JOYCONTROLSTICKCONTEXTMENU_H 56 | -------------------------------------------------------------------------------- /src/mousedialog/uihelpers/mousebuttonsettingsdialoghelper.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef MOUSEBUTTONSETTINGSDIALOGHELPER_H 20 | #define MOUSEBUTTONSETTINGSDIALOGHELPER_H 21 | 22 | #include 23 | 24 | class JoyButton; 25 | 26 | class MouseButtonSettingsDialogHelper : public QObject 27 | { 28 | Q_OBJECT 29 | 30 | public: 31 | explicit MouseButtonSettingsDialogHelper(JoyButton *button, QObject *parent = nullptr); 32 | 33 | JoyButton *getButton() const; 34 | 35 | public slots: 36 | void updateExtraAccelerationStatus(bool checked); 37 | void updateExtraAccelerationMultiplier(double value); 38 | void updateStartMultiPercentage(double value); 39 | void updateMinAccelThreshold(double value); 40 | void updateMaxAccelThreshold(double value); 41 | void updateAccelExtraDuration(double value); 42 | void updateReleaseSpringRadius(int value); 43 | void updateSpringRelativeStatus(bool value); 44 | 45 | private: 46 | JoyButton *button; 47 | }; 48 | 49 | #endif // MOUSEBUTTONSETTINGSDIALOGHELPER_H 50 | -------------------------------------------------------------------------------- /src/mousedialog/uihelpers/mousecontrolsticksettingsdialoghelper.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef MOUSECONTROLSTICKSETTINGSDIALOGHELPER_H 20 | #define MOUSECONTROLSTICKSETTINGSDIALOGHELPER_H 21 | 22 | #include 23 | 24 | class JoyControlStick; 25 | 26 | class MouseControlStickSettingsDialogHelper : public QObject 27 | { 28 | Q_OBJECT 29 | 30 | public: 31 | explicit MouseControlStickSettingsDialogHelper(JoyControlStick *stick, QObject *parent = nullptr); 32 | 33 | JoyControlStick *getStick() const; 34 | 35 | public slots: 36 | void updateExtraAccelerationStatus(bool checked); 37 | void updateExtraAccelerationMultiplier(double value); 38 | void updateStartMultiPercentage(double value); 39 | void updateMinAccelThreshold(double value); 40 | void updateMaxAccelThreshold(double value); 41 | void updateAccelExtraDuration(double value); 42 | void updateReleaseSpringRadius(int value); 43 | 44 | private: 45 | JoyControlStick *stick; 46 | }; 47 | 48 | #endif // MOUSECONTROLSTICKSETTINGSDIALOGHELPER_H 49 | -------------------------------------------------------------------------------- /src/uihelpers/buttoneditdialoghelper.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef BUTTONEDITDIALOGHELPER_H 20 | #define BUTTONEDITDIALOGHELPER_H 21 | 22 | #include "joybuttonslot.h" 23 | 24 | class JoyButton; 25 | 26 | class ButtonEditDialogHelper : public QObject 27 | { 28 | Q_OBJECT 29 | 30 | public: 31 | explicit ButtonEditDialogHelper(JoyButton *button, QObject *parent = nullptr); 32 | explicit ButtonEditDialogHelper(QObject *parent = nullptr); 33 | void setThisButton(JoyButton *btn); 34 | 35 | protected: 36 | JoyButton *button; 37 | 38 | public slots: 39 | void setAssignedSlot(int code, JoyButtonSlot::JoySlotInputAction mode = JoyButtonSlot::JoyKeyboard); 40 | void setAssignedSlot(int code, int alias, JoyButtonSlot::JoySlotInputAction mode = JoyButtonSlot::JoyKeyboard); 41 | void setAssignedSlot(int code, int alias, int index, 42 | JoyButtonSlot::JoySlotInputAction mode = JoyButtonSlot::JoyKeyboard); 43 | void setUseTurbo(bool useTurbo); 44 | }; 45 | 46 | #endif // BUTTONEDITDIALOGHELPER_H 47 | -------------------------------------------------------------------------------- /src/xmlconfigwriter.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef XMLCONFIGWRITER_H 20 | #define XMLCONFIGWRITER_H 21 | 22 | #include 23 | 24 | class InputDevice; 25 | class QXmlStreamWriter; 26 | class InputDeviceXml; 27 | class QFile; 28 | 29 | class XMLConfigWriter : public QObject 30 | { 31 | Q_OBJECT 32 | 33 | public: 34 | explicit XMLConfigWriter(QObject *parent = nullptr); 35 | ~XMLConfigWriter(); 36 | void setFileName(QString filename); 37 | bool hasError(); 38 | const QString getErrorString(); 39 | 40 | const QXmlStreamWriter *getXml(); 41 | QString const &getFileName(); 42 | const QFile *getConfigFile(); 43 | const InputDevice *getJoystick(); 44 | 45 | public slots: 46 | void write(InputDeviceXml *joystickXml); 47 | 48 | private: 49 | QXmlStreamWriter *xml; 50 | QString fileName; 51 | QFile *configFile; 52 | InputDevice *m_joystick; 53 | InputDeviceXml *m_joystickXml; 54 | bool writerError; 55 | QString writerErrorString; 56 | }; 57 | 58 | #endif // XMLCONFIGWRITER_H 59 | -------------------------------------------------------------------------------- /src/joycontrolstickbuttonpushbutton.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef JOYCONTROLSTICKBUTTONPUSHBUTTON_H 20 | #define JOYCONTROLSTICKBUTTONPUSHBUTTON_H 21 | 22 | #include "flashbuttonwidget.h" 23 | 24 | class JoyControlStickButton; 25 | class QWidget; 26 | 27 | class JoyControlStickButtonPushButton : public FlashButtonWidget 28 | { 29 | Q_OBJECT 30 | Q_PROPERTY(bool isflashing READ isButtonFlashing) 31 | 32 | public: 33 | explicit JoyControlStickButtonPushButton(JoyControlStickButton *button, bool displayNames, QWidget *parent = nullptr); 34 | 35 | JoyControlStickButton *getButton(); 36 | void setButton(JoyControlStickButton *button); 37 | void tryFlash(); 38 | 39 | protected: 40 | virtual QString generateLabel() override; 41 | 42 | public slots: 43 | void disableFlashes() override; 44 | void enableFlashes() override; 45 | 46 | private slots: 47 | void showContextMenu(const QPoint &point); 48 | 49 | private: 50 | JoyControlStickButton *button; 51 | }; 52 | 53 | #endif // JOYCONTROLSTICKBUTTONPUSHBUTTON_H 54 | -------------------------------------------------------------------------------- /src/xml/joybuttonslotxml.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2020 Jagoda Górska 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #ifndef JOYBUTTONSLOTXML_H 19 | #define JOYBUTTONSLOTXML_H 20 | 21 | #include 22 | #include 23 | 24 | class QXmlStreamReader; 25 | class QXmlStreamWriter; 26 | class JoyButtonSlot; 27 | 28 | class JoyButtonSlotXml : public QObject 29 | { 30 | Q_OBJECT 31 | 32 | public: 33 | explicit JoyButtonSlotXml(JoyButtonSlot *joyBtnSlot, QObject *parent = nullptr); 34 | 35 | virtual void readConfig(QXmlStreamReader *xml); 36 | virtual void writeConfig(QXmlStreamWriter *xml); 37 | static int timeoutWrite; 38 | static int timeoutRead; 39 | 40 | private: 41 | void writeEachSlot(QXmlStreamWriter *xml, JoyButtonSlot *joyBtnSlot); 42 | void readEachSlot(QXmlStreamReader *xml, JoyButtonSlot *joyBtnSlot, QString &profile, QString &tempStringData, 43 | QString &extraStringData); 44 | void setSlotData(JoyButtonSlot *joyBtnSlot, QString profile, QString tempStringData, QString extraStringData); 45 | 46 | JoyButtonSlot *m_joyBtnSlot; 47 | QReadWriteLock xmlLock; 48 | }; 49 | 50 | #endif // JOYBUTTONSLOTXML_H 51 | -------------------------------------------------------------------------------- /src/uinputhelper.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef UINPUTHELPER_H 20 | #define UINPUTHELPER_H 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | class UInputHelper : public QObject 27 | { 28 | Q_OBJECT 29 | 30 | public: 31 | static UInputHelper *getInstance(); 32 | void deleteInstance(); 33 | 34 | QString getDisplayString(int virtualkey); 35 | int getVirtualKey(QString codestring); 36 | QHash const &getKnownAliasesX11SymVK(); 37 | QHash const &getKnownAliasesVKStrings(); 38 | 39 | protected: 40 | explicit UInputHelper(QObject *parent = nullptr); 41 | ~UInputHelper(); 42 | 43 | void populateKnownAliases(); 44 | 45 | static UInputHelper *_instance; 46 | QHash knownAliasesX11SymVK; 47 | QHash knownAliasesVKStrings; 48 | 49 | private: 50 | void populateXVkStrings(QHash &knownAliasesVKStrings); 51 | void populateX11SymVk(QHash &knownAliasesX11SymVK); 52 | }; 53 | 54 | #endif // UINPUTHELPER_H 55 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "type": "cppdbg", 9 | "request": "launch", 10 | "name": "Open a core dump(c/c++)", 11 | "program": "${workspaceFolder}/build/bin/antimicrox", 12 | "coreDumpPath": "${input:coreFileName}", 13 | "cwd": "${workspaceFolder}", 14 | "MIMode": "gdb", 15 | "visualizerFile": "${workspaceFolder}/.vscode/qt5.natvis.xml" 16 | }, 17 | { 18 | "name": "(gdb) Launch", 19 | "type": "cppdbg", 20 | "request": "launch", 21 | "program": "${workspaceFolder}/build/bin/antimicrox", 22 | "args": [ 23 | "--log-level", 24 | "verbose" 25 | ], 26 | "stopAtEntry": false, 27 | "cwd": "${fileDirname}", 28 | "environment": [], 29 | "externalConsole": false, 30 | "MIMode": "gdb", 31 | "setupCommands": [ 32 | { 33 | "description": "Włącz formatowanie kodu dla gdb", 34 | "text": "-enable-pretty-printing", 35 | "ignoreFailures": true 36 | }, 37 | { 38 | "text": "-gdb-set follow-fork-mode child" 39 | } 40 | ], 41 | "visualizerFile": "${workspaceFolder}/.vscode/qt5.natvis.xml", 42 | "showDisplayString": true, 43 | } 44 | ], 45 | "inputs": [ 46 | { 47 | "id": "coreFileName", 48 | "type": "promptString", 49 | "description": "Enter core file path" 50 | } 51 | ] 52 | } -------------------------------------------------------------------------------- /src/eventhandlers/xtesteventhandler.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef XTESTEVENTHANDLER_H 20 | #define XTESTEVENTHANDLER_H 21 | 22 | #include "baseeventhandler.h" 23 | 24 | class JoyButtonSlot; 25 | 26 | class XTestEventHandler : public BaseEventHandler 27 | { 28 | Q_OBJECT 29 | 30 | public: 31 | explicit XTestEventHandler(QObject *parent = nullptr); 32 | virtual ~XTestEventHandler(); 33 | 34 | bool init() override; 35 | bool cleanup() override; 36 | 37 | void sendKeyboardEvent(JoyButtonSlot *slot, bool pressed) override; 38 | void sendMouseButtonEvent(JoyButtonSlot *slot, bool pressed) override; 39 | void sendMouseEvent(int xDis, int yDis) override; 40 | void sendMouseAbsEvent(int xDis, int yDis, int screen) override; 41 | 42 | void sendMouseSpringEvent(int xDis, int yDis, int width, int height) override; 43 | 44 | void sendTextEntryEvent(QString maintext) override; 45 | 46 | QString getName() override; 47 | QString getIdentifier() override; 48 | void printPostMessages() override; 49 | }; 50 | 51 | #endif // XTESTEVENTHANDLER_H 52 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.yaml: -------------------------------------------------------------------------------- 1 | name: "\U0001F680 Feature Request" 2 | description: Suggest an idea for this project 3 | labels: ["enhancement"] 4 | body: 5 | - type: checkboxes 6 | attributes: 7 | label: Is there an existing issue for this? 8 | description: Please search to see if an issue already exists for the bug you encountered. 9 | options: 10 | - label: I have searched the existing issues 11 | required: true 12 | - type: textarea 13 | attributes: 14 | label: Is your feature request related to a problem? Please describe. 15 | description: A clear and concise description of what the problem is. 16 | placeholder: I'm always frustrated when I have to press this small button. 17 | validations: 18 | required: false 19 | - type: textarea 20 | attributes: 21 | label: Describe the solution you'd like 22 | description: A clear and concise description of what you want to happen. 23 | placeholder: Make this button bigger 24 | validations: 25 | required: false 26 | - type: textarea 27 | attributes: 28 | label: Describe alternatives you've considered 29 | description: A clear and concise description of any alternative solutions or features you've considered. 30 | placeholder: I wanted to but bigger display, but it would be too expensive. 31 | validations: 32 | required: false 33 | - type: textarea 34 | attributes: 35 | label: Additional context 36 | description: | 37 | Add any other context or screenshots about the feature request here. 38 | 39 | Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. 40 | validations: 41 | required: false 42 | - type: markdown 43 | attributes: 44 | value: | 45 | --- 46 | The more thumbs up 👍 your idea gets, the more likely it is that we'll implement it. ✨ 47 | -------------------------------------------------------------------------------- /src/gui/editalldefaultautoprofiledialog.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef EDITALLDEFAULTAUTOPROFILEDIALOG_H 20 | #define EDITALLDEFAULTAUTOPROFILEDIALOG_H 21 | 22 | #include 23 | 24 | class AutoProfileInfo; 25 | class AntiMicroSettings; 26 | class QWidget; 27 | 28 | namespace Ui { 29 | class EditAllDefaultAutoProfileDialog; 30 | } 31 | 32 | class EditAllDefaultAutoProfileDialog : public QDialog 33 | { 34 | Q_OBJECT 35 | 36 | public: 37 | explicit EditAllDefaultAutoProfileDialog(AutoProfileInfo *info, AntiMicroSettings *settings, QWidget *parent = nullptr); 38 | ~EditAllDefaultAutoProfileDialog(); 39 | 40 | AutoProfileInfo *getAutoProfile() const; 41 | AntiMicroSettings *getSettings() const; 42 | 43 | protected: 44 | virtual void accept(); 45 | 46 | private: 47 | Ui::EditAllDefaultAutoProfileDialog *ui; 48 | 49 | AutoProfileInfo *info; 50 | AntiMicroSettings *settings; 51 | 52 | private slots: 53 | void openProfileBrowseDialog(); 54 | void saveAutoProfileInformation(); 55 | }; 56 | 57 | #endif // EDITALLDEFAULTAUTOPROFILEDIALOG_H 58 | -------------------------------------------------------------------------------- /src/joybuttonmousehelper.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef JOYBUTTONMOUSEHELPER_H 20 | #define JOYBUTTONMOUSEHELPER_H 21 | 22 | #include 23 | 24 | class QThread; 25 | 26 | class JoyButtonMouseHelper : public QObject 27 | { 28 | Q_OBJECT 29 | 30 | public: 31 | explicit JoyButtonMouseHelper(QObject *parent = nullptr); 32 | void resetButtonMouseDistances(); 33 | void setFirstSpringStatus(bool status); 34 | bool getFirstSpringStatus(); 35 | void carryGamePollRateUpdate(int pollRate); 36 | void carryMouseRefreshRateUpdate(int refreshRate); 37 | 38 | signals: 39 | void mouseCursorMoved(int mouseX, int mouseY, int elapsed); 40 | void mouseSpringMoved(int mouseX, int mouseY); 41 | void gamepadRefreshRateUpdated(int pollRate); 42 | void mouseRefreshRateUpdated(int refreshRate); 43 | 44 | public slots: 45 | void moveMouseCursor(); 46 | void moveSpringMouse(); 47 | void mouseEvent(); 48 | void changeThread(QThread *thread); 49 | 50 | private: 51 | bool firstSpringEvent; 52 | }; 53 | 54 | #endif // JOYBUTTONMOUSEHELPER_H 55 | -------------------------------------------------------------------------------- /src/gamecontrollerexample.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef GAMECONTROLLEREXAMPLE_H 20 | #define GAMECONTROLLEREXAMPLE_H 21 | 22 | #include 23 | #include 24 | 25 | class QPaintEvent; 26 | 27 | /** 28 | * @brief Widget representing image of reference Xbox controller 29 | * 30 | * It can also mark selected buttons 31 | * 32 | */ 33 | class GameControllerExample : public QWidget 34 | { 35 | Q_OBJECT 36 | 37 | public: 38 | explicit GameControllerExample(QWidget *parent = nullptr); 39 | 40 | enum ButtonType 41 | { 42 | Button, 43 | AxisX, 44 | AxisY, 45 | }; 46 | 47 | static const int MAXBUTTONINDEX = 20; 48 | 49 | protected: 50 | virtual void paintEvent(QPaintEvent *event); 51 | 52 | signals: 53 | void indexUpdated(int index); 54 | 55 | public slots: 56 | void setActiveButton(int button); 57 | 58 | private: 59 | QImage controllerimage; 60 | QImage buttonimage; 61 | QImage axisimage; 62 | QImage rotatedaxisimage; 63 | int currentIndex; 64 | }; 65 | 66 | #endif // GAMECONTROLLEREXAMPLE_H 67 | -------------------------------------------------------------------------------- /src/uihelpers/joycontrolstickcontextmenuhelper.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef JOYCONTROLSTICKCONTEXTMENUHELPER_H 20 | #define JOYCONTROLSTICKCONTEXTMENUHELPER_H 21 | 22 | #include "joycontrolstick.h" 23 | 24 | class JoyButtonSlot; 25 | 26 | /** 27 | * @brief Some helper methods which run in the IO thread and are called 28 | * from the GUI thread. 29 | */ 30 | class JoyControlStickContextMenuHelper : public QObject 31 | { 32 | Q_OBJECT 33 | 34 | public: 35 | explicit JoyControlStickContextMenuHelper(JoyControlStick *stick, QObject *parent = nullptr); 36 | void setPendingSlots(QHash *tempSlots); 37 | void clearPendingSlots(); 38 | QHash const &getPendingSlots(); 39 | 40 | public slots: 41 | void setFromPendingSlots(); 42 | void clearButtonsSlotsEventReset(); 43 | 44 | private: 45 | JoyControlStick *stick; 46 | QHash pendingSlots; 47 | }; 48 | 49 | #endif // JOYCONTROLSTICKCONTEXTMENUHELPER_H 50 | -------------------------------------------------------------------------------- /src/gui/setaxisthrottledialog.cpp: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #include "setaxisthrottledialog.h" 20 | #include "ui_setaxisthrottledialog.h" 21 | 22 | #include "joyaxis.h" 23 | 24 | #include 25 | #include 26 | 27 | SetAxisThrottleDialog::SetAxisThrottleDialog(JoyAxis *axis, QWidget *parent) 28 | : QDialog(parent) 29 | , ui(new Ui::SetAxisThrottleDialog) 30 | { 31 | ui->setupUi(this); 32 | this->axis = axis; 33 | 34 | QString currentText = ui->label->text(); 35 | currentText = currentText.arg(QString::number(axis->getRealJoyIndex())); 36 | ui->label->setText(currentText); 37 | 38 | connect(ui->buttonBox, &QDialogButtonBox::accepted, this, &SetAxisThrottleDialog::propogateThrottleChange); 39 | connect(this, &SetAxisThrottleDialog::initiateSetAxisThrottleChange, axis, &JoyAxis::propogateThrottleChange); 40 | } 41 | 42 | SetAxisThrottleDialog::~SetAxisThrottleDialog() { delete ui; } 43 | 44 | void SetAxisThrottleDialog::propogateThrottleChange() { emit initiateSetAxisThrottleChange(); } 45 | 46 | JoyAxis *SetAxisThrottleDialog::getAxis() const { return axis; } 47 | -------------------------------------------------------------------------------- /src/gui/unixwindowinfodialog.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef UNIXWINDOWINFODIALOG_H 20 | #define UNIXWINDOWINFODIALOG_H 21 | 22 | #include 23 | #include 24 | 25 | namespace Ui { 26 | class UnixWindowInfoDialog; 27 | } 28 | 29 | class UnixWindowInfoDialog : public QDialog 30 | { 31 | Q_OBJECT 32 | 33 | public: 34 | explicit UnixWindowInfoDialog(long window, QWidget *parent = nullptr); 35 | ~UnixWindowInfoDialog(); 36 | 37 | enum 38 | { 39 | WindowClass = (1 << 0), 40 | WindowName = (1 << 1), 41 | WindowPath = (1 << 2) 42 | }; 43 | typedef int DialogWindowOption; 44 | 45 | QString getWindowClass() const; 46 | QString getWindowName() const; 47 | QString getWindowPath() const; 48 | DialogWindowOption getSelectedOptions() const; 49 | 50 | private: 51 | Ui::UnixWindowInfoDialog *ui; 52 | DialogWindowOption selectedMatch; 53 | 54 | QString winClass; 55 | QString winName; 56 | QString winPath; 57 | 58 | private slots: 59 | void populateOption(); 60 | }; 61 | 62 | #endif // UNIXWINDOWINFODIALOG_H 63 | -------------------------------------------------------------------------------- /src/joybuttonstatusbox.cpp: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #include "joybuttonstatusbox.h" 20 | 21 | #include "joybuttontypes/joybutton.h" 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | JoyButtonStatusBox::JoyButtonStatusBox(JoyButton *button, QWidget *parent) 28 | : QPushButton(parent) 29 | { 30 | this->button = button; 31 | isflashing = false; 32 | 33 | setText(QString::number(button->getRealJoyNumber())); 34 | 35 | connect(button, &JoyButton::clicked, this, &JoyButtonStatusBox::flash); 36 | connect(button, &JoyButton::released, this, &JoyButtonStatusBox::unflash); 37 | } 38 | 39 | JoyButton *JoyButtonStatusBox::getJoyButton() const { return button; } 40 | 41 | bool JoyButtonStatusBox::isButtonFlashing() { return isflashing; } 42 | 43 | void JoyButtonStatusBox::flash() 44 | { 45 | isflashing = true; 46 | 47 | this->style()->unpolish(this); 48 | this->style()->polish(this); 49 | } 50 | 51 | void JoyButtonStatusBox::unflash() 52 | { 53 | isflashing = false; 54 | 55 | this->style()->unpolish(this); 56 | this->style()->polish(this); 57 | } 58 | -------------------------------------------------------------------------------- /src/uihelpers/joytabwidgethelper.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef JOYTABWIDGETHELPER_H 20 | #define JOYTABWIDGETHELPER_H 21 | 22 | #include 23 | 24 | class InputDevice; 25 | class XMLConfigReader; 26 | class XMLConfigWriter; 27 | 28 | class JoyTabWidgetHelper : public QObject 29 | { 30 | Q_OBJECT 31 | 32 | public: 33 | explicit JoyTabWidgetHelper(InputDevice *device, QObject *parent = nullptr); 34 | ~JoyTabWidgetHelper(); 35 | 36 | bool hasReader(); 37 | XMLConfigReader *getReader(); 38 | 39 | bool hasWriter(); 40 | XMLConfigWriter *getWriter(); 41 | 42 | bool hasError(); 43 | QString getErrorString(); 44 | 45 | protected: 46 | InputDevice *device; 47 | XMLConfigReader *reader; 48 | XMLConfigWriter *writer; 49 | bool errorOccurred; 50 | QString lastErrorString; 51 | 52 | public slots: 53 | bool readConfigFile(QString filepath); 54 | bool readConfigFileWithRevert(QString filepath); 55 | bool writeConfigFile(QString filepath); 56 | void reInitDevice(); 57 | void reInitDeviceWithRevert(); 58 | }; 59 | 60 | #endif // JOYTABWIDGETHELPER_H 61 | -------------------------------------------------------------------------------- /src/uihelpers/advancebuttondialoghelper.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef ADVANCEBUTTONDIALOGHELPER_H 20 | #define ADVANCEBUTTONDIALOGHELPER_H 21 | 22 | #include "joybuttonslot.h" 23 | 24 | class JoyButton; 25 | 26 | class AdvanceButtonDialogHelper : public QObject 27 | { 28 | Q_OBJECT 29 | 30 | public: 31 | explicit AdvanceButtonDialogHelper(JoyButton *button, QObject *parent = nullptr); 32 | 33 | protected: 34 | JoyButton *button; 35 | 36 | public slots: 37 | void setAssignedSlot(JoyButtonSlot *otherSlot, int index); 38 | void setAssignedSlot(int code, int alias, int index, 39 | JoyButtonSlot::JoySlotInputAction mode = JoyButtonSlot::JoyKeyboard); 40 | void insertAssignedSlot(int code, int alias, int index, 41 | JoyButtonSlot::JoySlotInputAction mode = JoyButtonSlot::JoyKeyboard); 42 | void insertAssignedSlot(JoyButtonSlot *newSlot, int index, bool updateActiveString); 43 | void removeAssignedSlot(int index); 44 | void onlyReset(); 45 | void onlyRemoveAssignedSlot(int index); 46 | }; 47 | 48 | #endif // ADVANCEBUTTONDIALOGHELPER_H 49 | -------------------------------------------------------------------------------- /src/uihelpers/joycontrolstickeditdialoghelper.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef JOYCONTROLSTICKEDITDIALOGHELPER_H 20 | #define JOYCONTROLSTICKEDITDIALOGHELPER_H 21 | 22 | #include "joycontrolstick.h" 23 | 24 | class JoyButtonSlot; 25 | 26 | /** 27 | * @brief Some helper methods which run in the IO thread and are called 28 | * from the GUI thread. 29 | */ 30 | class JoyControlStickEditDialogHelper : public QObject 31 | { 32 | Q_OBJECT 33 | public: 34 | explicit JoyControlStickEditDialogHelper(JoyControlStick *stick, QObject *parent = nullptr); 35 | void setPendingSlots(QHash *tempSlots); 36 | void clearPendingSlots(); 37 | QHash const &getPendingSlots(); 38 | 39 | public slots: 40 | void setFromPendingSlots(); 41 | void clearButtonsSlotsEventReset(); 42 | void updateControlStickDelay(int value); 43 | 44 | private: 45 | JoyControlStick *stick; 46 | QHash pendingSlots; 47 | }; 48 | 49 | #endif // JOYCONTROLSTICKEDITDIALOGHELPER_H 50 | -------------------------------------------------------------------------------- /src/eventhandlers/winsendinputeventhandler.h: -------------------------------------------------------------------------------- 1 | /* antimicro Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #ifndef WINSENDINPUTEVENTHANDLER_H 19 | #define WINSENDINPUTEVENTHANDLER_H 20 | 21 | #include 22 | 23 | #include "baseeventhandler.h" 24 | 25 | #include 26 | 27 | /** 28 | * @brief Input event handler class for Windows 29 | * 30 | * It utilizes SendInput functions 31 | * 32 | */ 33 | class WinSendInputEventHandler : public BaseEventHandler 34 | { 35 | Q_OBJECT 36 | public: 37 | explicit WinSendInputEventHandler(QObject *parent = 0); 38 | 39 | virtual bool init() override; 40 | virtual bool cleanup() override; 41 | virtual void sendKeyboardEvent(JoyButtonSlot *slot, bool pressed) override; 42 | virtual void sendMouseButtonEvent(JoyButtonSlot *slot, bool pressed) override; 43 | virtual void sendMouseEvent(int xDis, int yDis) override; 44 | virtual void sendMouseSpringEvent(int xDis, int yDis, int width, int height) override; 45 | virtual void sendTextEntryEvent(QString maintext) override; 46 | 47 | virtual QString getName() override; 48 | virtual QString getIdentifier() override; 49 | 50 | signals: 51 | 52 | public slots: 53 | }; 54 | 55 | #endif // WINSENDINPUTEVENTHANDLER_H 56 | -------------------------------------------------------------------------------- /src/gui/joystickstatuswindow.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef JOYSTICKSTATUSWINDOW_H 20 | #define JOYSTICKSTATUSWINDOW_H 21 | 22 | #include 23 | 24 | class InputDevice; 25 | class QProgressBar; 26 | class QWidget; 27 | 28 | namespace Ui { 29 | class JoystickStatusWindow; 30 | } 31 | 32 | /** 33 | * @brief The joystick "Properties" window. 34 | * Shows various raw values to the user. 35 | */ 36 | class JoystickStatusWindow : public QDialog 37 | { 38 | Q_OBJECT 39 | 40 | public: 41 | explicit JoystickStatusWindow(InputDevice *joystick, QWidget *parent = nullptr); 42 | ~JoystickStatusWindow(); 43 | 44 | InputDevice *getJoystick() const; 45 | 46 | private: 47 | void reject(); 48 | Ui::JoystickStatusWindow *ui; 49 | 50 | InputDevice *joystick; 51 | QProgressBar *m_accel_axes[3]; 52 | QProgressBar *m_gyro_axes[3]; 53 | 54 | private slots: 55 | void restoreButtonStates(int code); 56 | void obliterate(); 57 | void updateAccelerometerValues(float valueX, float valueY, float valueZ); 58 | void updateGyroscopeValues(float valueX, float valueY, float valueZ); 59 | }; 60 | 61 | #endif // JOYSTICKSTATUSWINDOW_H 62 | -------------------------------------------------------------------------------- /src/dpadcontextmenu.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef DPADCONTEXTMENU_H 20 | #define DPADCONTEXTMENU_H 21 | 22 | #include "uihelpers/dpadcontextmenuhelper.h" 23 | 24 | #include 25 | #include 26 | 27 | class JoyDPad; 28 | class QWidget; 29 | 30 | class DPadContextMenu : public QMenu 31 | { 32 | Q_OBJECT 33 | 34 | public: 35 | explicit DPadContextMenu(JoyDPad *dpad, QWidget *parent = nullptr); 36 | void buildMenu(); 37 | 38 | protected: 39 | int getPresetIndex(); 40 | 41 | private slots: 42 | void setDPadPreset(QAction *action); 43 | void setDPadMode(QAction *action); 44 | void openMouseSettingsDialog(); 45 | 46 | private: 47 | DPadContextMenuHelper &getHelper(); 48 | 49 | JoyDPad *dpad; 50 | DPadContextMenuHelper helper; 51 | 52 | void generateActionPreset(QAction *action, QString actionText, int currentPreset, int &presetMode, 53 | QActionGroup *presetGroup); 54 | void generateActionMode(QActionGroup *modesGroup, QAction *action, QString actionText, int currentPreset, 55 | int presetMode); 56 | }; 57 | 58 | #endif // DPADCONTEXTMENU_H 59 | -------------------------------------------------------------------------------- /src/gui/dpadeditdialog.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef DPADEDITDIALOG_H 20 | #define DPADEDITDIALOG_H 21 | 22 | #include "uihelpers/dpadeditdialoghelper.h" 23 | 24 | #include 25 | 26 | class JoyDPad; 27 | class QWidget; 28 | 29 | namespace Ui { 30 | class DPadEditDialog; 31 | } 32 | 33 | class DPadEditDialog : public QDialog 34 | { 35 | Q_OBJECT 36 | 37 | public: 38 | explicit DPadEditDialog(JoyDPad *dpad, QWidget *parent = nullptr); 39 | ~DPadEditDialog(); 40 | 41 | JoyDPad *getDPad() const; 42 | DPadEditDialogHelper const &getHelper(); 43 | 44 | protected: 45 | void selectCurrentPreset(); 46 | 47 | private slots: 48 | void implementPresets(int index); 49 | void implementModes(int index); 50 | void openMouseSettingsDialog(); 51 | void enableMouseSettingButton(); 52 | void updateWindowTitleDPadName(); 53 | void updateDPadDelaySpinBox(int value); 54 | void updateDPadDelaySlider(double value); 55 | 56 | private: 57 | Ui::DPadEditDialog *ui; 58 | DPadEditDialogHelper &getHelperLocal(); 59 | 60 | JoyDPad *dpad; 61 | DPadEditDialogHelper helper; 62 | }; 63 | 64 | #endif // DPADEDITDIALOG_H 65 | -------------------------------------------------------------------------------- /src/uihelpers/joyaxiscontextmenuhelper.cpp: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #include "joyaxiscontextmenuhelper.h" 20 | 21 | #include "joyaxis.h" 22 | 23 | #include 24 | 25 | JoyAxisContextMenuHelper::JoyAxisContextMenuHelper(JoyAxis *axis, QObject *parent) 26 | : QObject(parent) 27 | { 28 | Q_ASSERT(axis); 29 | 30 | this->axis = axis; 31 | } 32 | 33 | void JoyAxisContextMenuHelper::setNAssignedSlot(int code, int alias, JoyButtonSlot::JoySlotInputAction mode) 34 | { 35 | JoyButton *button = axis->getNAxisButton(); 36 | button->clearSlotsEventReset(false); 37 | button->setAssignedSlot(code, alias, mode); 38 | } 39 | 40 | void JoyAxisContextMenuHelper::setPAssignedSlot(int code, int alias, JoyButtonSlot::JoySlotInputAction mode) 41 | { 42 | JoyButton *button = axis->getPAxisButton(); 43 | button->clearSlotsEventReset(false); 44 | button->setAssignedSlot(code, alias, mode); 45 | } 46 | 47 | void JoyAxisContextMenuHelper::clearAndResetAxisButtons() 48 | { 49 | JoyAxisButton *nbutton = axis->getNAxisButton(); 50 | JoyAxisButton *pbutton = axis->getPAxisButton(); 51 | nbutton->clearSlotsEventReset(); 52 | pbutton->clearSlotsEventReset(); 53 | } 54 | -------------------------------------------------------------------------------- /src/gui/flashbuttonwidget.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef FLASHBUTTONWIDGET_H 20 | #define FLASHBUTTONWIDGET_H 21 | 22 | #include 23 | 24 | class QWidget; 25 | class QPaintEvent; 26 | 27 | class FlashButtonWidget : public QPushButton 28 | { 29 | Q_OBJECT 30 | Q_PROPERTY(bool isflashing READ isButtonFlashing) 31 | 32 | public: 33 | explicit FlashButtonWidget(QWidget *parent = nullptr); 34 | explicit FlashButtonWidget(bool displayNames, QWidget *parent = nullptr); 35 | 36 | bool isButtonFlashing(); 37 | void setDisplayNames(bool display); 38 | bool isDisplayingNames(); 39 | 40 | protected: 41 | virtual void paintEvent(QPaintEvent *event); 42 | virtual QString generateLabel() = 0; 43 | virtual void retranslateUi(); 44 | bool ifDisplayNames(); 45 | 46 | public slots: 47 | void refreshLabel(); 48 | void toggleNameDisplay(); 49 | virtual void disableFlashes() = 0; 50 | virtual void enableFlashes() = 0; 51 | 52 | protected slots: 53 | void flash(); 54 | void unflash(); 55 | 56 | private: 57 | bool isflashing; 58 | bool m_displayNames; 59 | bool leftAlignText; 60 | }; 61 | 62 | #endif // FLASHBUTTONWIDGET_H 63 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.yaml: -------------------------------------------------------------------------------- 1 | name: "\U0001F41E Bug Report" 2 | description: Create a bug report to help us fix it 3 | labels: ["bug"] 4 | body: 5 | - type: checkboxes 6 | attributes: 7 | label: Is there an existing issue for this? 8 | description: Please search to see if an issue already exists for the bug you encountered. 9 | options: 10 | - label: I searched the existing issues and did not find anything similar. 11 | required: true 12 | - type: textarea 13 | attributes: 14 | label: Current Behavior 15 | description: A concise description of what you're experiencing. 16 | validations: 17 | required: false 18 | - type: textarea 19 | attributes: 20 | label: Expected Behavior 21 | description: A concise description of what you expected to happen. 22 | validations: 23 | required: false 24 | - type: textarea 25 | attributes: 26 | label: Steps To Reproduce 27 | description: Steps to reproduce the behavior. 28 | placeholder: | 29 | 1. Go to '...' 30 | 2. Click on '....' 31 | 3. Scroll down to '....' 32 | 4. See error 33 | validations: 34 | required: false 35 | - type: textarea 36 | attributes: 37 | label: Environment 38 | description: | 39 | Copy and paste text from Info window (Help->About->Info) 40 | ❗Without this information issue will be instantly closed.❗ 41 | placeholder: | 42 | Program Version 3.3.2 43 | Built Against SDL 2.24.0 44 | Running With SDL 2.24.0 45 | Using Qt 5.15.7 46 | Using Event Handler: XTest 47 | Compositor type: x11 48 | Host OS: Windows Version: 10 Architecture: x86_64 49 | render: markdown 50 | validations: 51 | required: true 52 | - type: textarea 53 | attributes: 54 | label: Anything else? 55 | description: | 56 | Links? References? Anything that will give us more context about the issue you are encountering! 57 | 58 | Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. 59 | validations: 60 | required: false -------------------------------------------------------------------------------- /src/applaunchhelper.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef APPLAUNCHHELPER_H 20 | #define APPLAUNCHHELPER_H 21 | 22 | #include 23 | 24 | #include 25 | 26 | class AntiMicroSettings; 27 | class InputDevice; 28 | class QThread; 29 | 30 | class AppLaunchHelper : public QObject 31 | { 32 | Q_OBJECT 33 | 34 | public: 35 | explicit AppLaunchHelper(AntiMicroSettings *settings, bool graphical = false, QObject *parent = 0); 36 | 37 | void printControllerList(QMap *joysticks); 38 | 39 | AntiMicroSettings *getSettings() const; 40 | 41 | protected: 42 | void enablePossibleMouseSmoothing(); 43 | void establishMouseTimerConnections(); 44 | void changeMouseRefreshRate(); 45 | void changeSpringModeScreen(); 46 | void changeGamepadPollRate(); 47 | #ifdef Q_OS_WIN 48 | void checkPointerPrecision(); 49 | #endif 50 | 51 | public slots: 52 | #ifdef Q_OS_WIN 53 | void appQuitPointerPrecision(); 54 | #endif 55 | void initRunMethods(); 56 | void revertMouseThread(); 57 | void changeMouseThread(QThread *thread); 58 | 59 | private: 60 | AntiMicroSettings *settings; 61 | bool graphical; 62 | }; 63 | 64 | #endif // APPLAUNCHHELPER_H 65 | -------------------------------------------------------------------------------- /src/xml/inputdevicexml.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2020 Jagoda Górska 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #ifndef INPUTDEVICEXML_H 19 | #define INPUTDEVICEXML_H 20 | 21 | #include 22 | #include 23 | 24 | class QXmlStreamReader; 25 | class QXmlStreamWriter; 26 | class InputDevice; 27 | class AntiMicroSettings; 28 | 29 | /** 30 | * @brief Generic InputDevice XML serialization/deserialization helper class 31 | * Reads data from the supplied InputDevice object and writes it to XML or 32 | * reads data from an QXmlStreamReader and writes it to the InputDevice object. 33 | * 34 | * After serializing or deserializing the device data, it reads/writes 35 | * all SetJoysticks. 36 | */ 37 | class InputDeviceXml : public QObject 38 | { 39 | Q_OBJECT 40 | public: 41 | explicit InputDeviceXml(InputDevice *inputDevice, QObject *parent = nullptr); 42 | 43 | public slots: 44 | 45 | void readConfig(QXmlStreamReader *xml); // InputDeviceXml class 46 | void writeConfig(QXmlStreamWriter *xml); // InputDeviceXml class 47 | 48 | signals: 49 | void readConfigSig(QXmlStreamReader *xml); 50 | 51 | private: 52 | InputDevice *m_inputDevice; 53 | 54 | // ensures that readConfig returns when reading is finished even for reading in different thread 55 | QMutex m_mutex_read_config; 56 | }; 57 | 58 | #endif // INPUTDEVICEXML_H 59 | -------------------------------------------------------------------------------- /src/xmlconfigreader.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef XMLCONFIGREADER_H 20 | #define XMLCONFIGREADER_H 21 | 22 | #include 23 | #include 24 | 25 | class InputDevice; 26 | class QXmlStreamReader; 27 | class InputDeviceXml; 28 | class QFile; 29 | 30 | /** 31 | * @brief Main XML config reader class 32 | */ 33 | class XMLConfigReader : public QObject 34 | { 35 | Q_OBJECT 36 | 37 | public: 38 | explicit XMLConfigReader(QObject *parent = nullptr); 39 | ~XMLConfigReader(); 40 | void setJoystick(InputDevice *joystick); 41 | void setFileName(QString filename); 42 | const QString getErrorString(); 43 | bool hasError(); 44 | bool read(); 45 | 46 | const QXmlStreamReader *getXml(); 47 | QString const &getFileName(); 48 | const QFile *getConfigFile(); 49 | const InputDevice *getJoystick(); 50 | QStringList const &getDeviceTypes(); 51 | 52 | protected: 53 | void initDeviceTypes(); 54 | 55 | public slots: 56 | void configJoystick(InputDevice *joystick); 57 | 58 | private: 59 | QXmlStreamReader *xml; 60 | QString fileName; 61 | QFile *configFile; 62 | InputDevice *m_joystick; 63 | QStringList deviceTypes; 64 | }; 65 | 66 | #endif // XMLCONFIGREADER_H 67 | -------------------------------------------------------------------------------- /src/qtuinputkeymapper.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef QTUINPUTKEYMAPPER_H 20 | #define QTUINPUTKEYMAPPER_H 21 | 22 | #include "qtkeymapperbase.h" 23 | 24 | class QtUInputKeyMapper : public QtKeyMapperBase 25 | { 26 | Q_OBJECT 27 | 28 | public: 29 | explicit QtUInputKeyMapper(QObject *parent = nullptr); 30 | 31 | protected: 32 | void populateMappingHashes() override; 33 | void populateCharKeyInformation() override; 34 | 35 | void populateAlphaHashes(); 36 | void populateFKeyHashes(); 37 | void populateNumPadHashes(); 38 | void populateSpecialCharHashes(); 39 | 40 | private: 41 | void addVirtualKeyToHash(int key, QChar character, charKeyInformation &charKeyInfo); 42 | void mapMiscKeysQtUinput(QHash &qtKeyToVirtKeyHash); 43 | void mapCursorMovesKeysQtUinput(QHash &qtKeyToVirtKeyHash); 44 | void mapModifiersKeysQtUinput(QHash &qtKeyToVirtKeyHash); 45 | void mapKeypadKeysQtUinput(QHash &qtKeyToVirtKeyHash); 46 | void mapJapanKeysQtUinput(QHash &qtKeyToVirtKeyHash); 47 | void mapKoreanKeysQtUinput(QHash &qtKeyToVirtKeyHash); 48 | void mapMediaKeysQtUinput(QHash &qtKeyToVirtKeyHash); 49 | }; 50 | 51 | #endif // QTUINPUTKEYMAPPER_H 52 | -------------------------------------------------------------------------------- /src/keyboard/virtualkeypushbutton.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef VIRTUALKEYPUSHBUTTON_H 20 | #define VIRTUALKEYPUSHBUTTON_H 21 | 22 | #include 23 | 24 | /** 25 | * @brief PushButton representing keyboard button on VirtualKeyboardMouseWidget 26 | * 27 | */ 28 | class VirtualKeyPushButton : public QPushButton 29 | { 30 | Q_OBJECT 31 | 32 | public: 33 | explicit VirtualKeyPushButton(QString xcodestring, QWidget *parent = nullptr); 34 | int calculateFontSize(); 35 | 36 | QString getXcodestring() const; 37 | QString getDisplayString() const; 38 | int getKeycode() const; 39 | int getQkeyalias() const; 40 | bool getCurrentlyActive() const; 41 | bool getOnCurrentButton() const; 42 | 43 | static QHash knownAliases; 44 | 45 | protected: 46 | QString setDisplayString(QString xcodestring); 47 | void populateKnownAliases(); 48 | 49 | signals: 50 | void keycodeObtained(int code, int alias); 51 | 52 | private slots: 53 | void processSingleSelection(); 54 | 55 | private: 56 | int keycode; 57 | int qkeyalias; 58 | QString xcodestring; 59 | QString displayString; 60 | bool currentlyActive; 61 | bool onCurrentButton; 62 | }; 63 | 64 | #endif // VIRTUALKEYPUSHBUTTON_H 65 | -------------------------------------------------------------------------------- /src/gamecontroller/gamecontrollertrigger.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef GAMECONTROLLERTRIGGER_H 20 | #define GAMECONTROLLERTRIGGER_H 21 | 22 | #include "joyaxis.h" 23 | 24 | class HapticTriggerPs5; 25 | class QXmlStreamReader; 26 | class QXmlStreamWriter; 27 | class SetJoystick; 28 | 29 | class GameControllerTrigger : public JoyAxis 30 | { 31 | Q_OBJECT 32 | 33 | public: 34 | explicit GameControllerTrigger(int index, int originset, SetJoystick *parentSet, QObject *parent = nullptr); 35 | 36 | virtual QString getXmlName(); // GameControllerTriggerXml class 37 | virtual QString getPartialName(bool forceFullFormat, bool displayNames); 38 | 39 | virtual int getDefaultDeadZone(); 40 | virtual int getDefaultMaxZone(); 41 | virtual ThrottleTypes getDefaultThrottle(); 42 | 43 | static const ThrottleTypes DEFAULTTHROTTLE; 44 | 45 | virtual bool hasHapticTrigger() const override; 46 | virtual HapticTriggerPs5 *getHapticTrigger() const override; 47 | virtual void setHapticTriggerMode(HapticTriggerModePs5 mode) override; 48 | 49 | public slots: 50 | virtual void reset(); 51 | virtual void reset(int index); 52 | 53 | protected: 54 | void correctJoystickThrottle(); 55 | 56 | HapticTriggerPs5 *m_haptic_trigger; 57 | }; 58 | 59 | #endif // GAMECONTROLLERTRIGGER_H 60 | -------------------------------------------------------------------------------- /src/qtx11keymapper.h: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2015 Travis Nickles 3 | * Copyright (C) 2020 Jagoda Górska 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef QTX11KEYMAPPER_H 20 | #define QTX11KEYMAPPER_H 21 | 22 | #include "qtkeymapperbase.h" 23 | 24 | class QtX11KeyMapper : public QtKeyMapperBase 25 | { 26 | Q_OBJECT 27 | 28 | public: 29 | explicit QtX11KeyMapper(QObject *parent = nullptr); 30 | 31 | protected: 32 | void populateMappingHashes() override; 33 | void populateCharKeyInformation() override; 34 | 35 | private: 36 | void mapMiscKeysQtX11(QHash &qtKeyToVirtKeyHash); 37 | void mapCursorMovesKeysQtX11(QHash &qtKeyToVirtKeyHash); 38 | void mapModifiersKeysQtX11(QHash &qtKeyToVirtKeyHash); 39 | void mapAdditionalKeysQtX11(QHash &qtKeyToVirtKeyHash); 40 | void mapKeypadKeysQtX11(QHash &qtKeyToVirtKeyHash); 41 | void mapInternationKeysQtX11(QHash &qtKeyToVirtKeyHash); 42 | void mapJapanKeysQtX11(QHash &qtKeyToVirtKeyHash); 43 | void mapKoreanKeysQtX11(QHash &qtKeyToVirtKeyHash); 44 | void mapDeadKeysQtX11(QHash &qtKeyToVirtKeyHash); 45 | void mapBrowseKeysQtX11(QHash &qtKeyToVirtKeyHash); 46 | void mapMediaKeysQtX11(QHash &qtKeyToVirtKeyHash); 47 | void mapLaunchKeysQtX11(QHash &qtKeyToVirtKeyHash); 48 | }; 49 | 50 | #endif // QTX11KEYMAPPER_H 51 | -------------------------------------------------------------------------------- /src/joybuttontypes/joyaccelerometerbutton.cpp: -------------------------------------------------------------------------------- 1 | /* antimicrox Gamepad to KB+M event mapper 2 | * Copyright (C) 2022 Max Maisel 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #include "joyaccelerometerbutton.h" 19 | #include "joysensordirection.h" 20 | 21 | JoyAccelerometerButton::JoyAccelerometerButton(JoySensor *sensor, int sdl_button_index, int originset, 22 | SetJoystick *parentSet, QObject *parent) 23 | : JoySensorButton(sensor, sdl_button_index, originset, parentSet, parent) 24 | { 25 | } 26 | 27 | /** 28 | * @brief Get translated accelerometer direction name of this button 29 | * @returns Translated direction name 30 | */ 31 | QString JoyAccelerometerButton::getDirectionName() const 32 | { 33 | QString label = QString(); 34 | 35 | switch (m_index_sdl) 36 | { 37 | case JoySensorDirection::SENSOR_UP: 38 | label.append(tr("Up")); 39 | break; 40 | 41 | case JoySensorDirection::SENSOR_DOWN: 42 | label.append(tr("Down")); 43 | break; 44 | 45 | case JoySensorDirection::SENSOR_LEFT: 46 | label.append(tr("Left")); 47 | break; 48 | 49 | case JoySensorDirection::SENSOR_RIGHT: 50 | label.append(tr("Right")); 51 | break; 52 | 53 | case JoySensorDirection::SENSOR_BWD: 54 | label.append(tr("Shock")); 55 | break; 56 | 57 | default: 58 | WARN() << "unknown accelerometer direction"; 59 | break; 60 | } 61 | 62 | return label; 63 | } 64 | --------------------------------------------------------------------------------