### Install Ubuntu Dependencies for JoyShockMapper Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Installs essential development libraries for JoyShockMapper on Ubuntu. Ensure libdecor-0 is compiled and installed separately if missing from repositories. ```bash sudo apt-get install -y libappindicator3-dev gir1.2-appindicator3-0.1 libgtk-3-dev libgtkmm-3.0-dev clang libsdl2-dev libdrm-dev libhidapi-dev libusb-1.0-0 libusb-1.0-0-dev libevdev-dev ``` ```bash sudo apt install -y meson libwayland-dev wayland-protocols libpango1.0-dev libdbus-1-dev libegl-dev libxkbcommon-dev ``` ```bash meson build --buildtype release ``` ```bash meson install -C build ``` -------------------------------- ### Install Gentoo Dependencies for JoyShockMapper Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Installs required libraries for JoyShockMapper on Gentoo. Note the specific instructions for clang and renaming include files. ```bash media-libs/libsdl2 dev-libs/libayatana-appindicator dev-libs/libevdev x11-libs/gtk+ dev-libs/libusb dev-libs/hidapi ``` -------------------------------- ### Modeshift Configuration Examples Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Demonstrates using modeshifts to dynamically change controller configurations, such as enabling flick stick or disabling gyro. ```config RIGHT_STICK_MODE = FLICK GYRO_OFF = R3 R = Q R,GYRO_ON = NONE R,RIGHT_STICK_MODE = MOUSE_AREA ``` -------------------------------- ### Install Arch Dependencies for JoyShockMapper Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Installs necessary packages for JoyShockMapper on Arch Linux. ```bash clang sdl2 libappindicator-gtk3 libevdev gtk3 libusb hidapi ``` -------------------------------- ### Install Fedora Dependencies for JoyShockMapper Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Installs required development packages for JoyShockMapper on Fedora. ```bash clang SDL2-devel libappindicator-gtk3-devel libevdev-devel gtk3-devel libusb-devel hidapi-devel ``` -------------------------------- ### Button Mapping Examples Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Examples of mapping controller inputs to keyboard actions. These can include simple rebinds, turbo presses, and specific game-specific configurations. ```JSM W = R E -,S = SPACE+ R3 = !1\ LMOUSE+ !Q/ UP,UP = !ENTER\ LSHIFT\ !G\ !L\ !SPACE\ !H\ !F\ !ENTER/ ``` ```JSM UP,E = BACKSPACE+ ``` -------------------------------- ### Configure JoyShockLibrary Dependency Source: https://github.com/electronicks/joyshockmapper/blob/master/JoyShockMapper/CMakeLists.txt Adds JoyShockLibrary as a dependency using CPMAddPackage, specifying the GitHub repository and commit hash. Links JoyShockLibrary to the binary and installs it. ```cmake # JoyShockLibrary CPMAddPackage ( NAME JoyShockLibrary GITHUB_REPOSITORY JibbSmart/JoyShockLibrary GIT_TAG eba751b6bddf5edc783790af35b663dec7495dcc ) target_link_libraries ( ${BINARY_NAME} PRIVATE Platform::Dependencies JoyShockLibrary ) install ( TARGETS ${BINARY_NAME} JoyShockLibrary RUNTIME DESTINATION ${PACKAGE_DIR} ) endif() ``` -------------------------------- ### Initialize Gyro Calibration Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Start the process of calibrating the controller's gyro. This command collects gyro data to establish a 'zero' reference point. ```config RESTART_GYRO_CALIBRATION ``` -------------------------------- ### Configure Touch Stick Gestures Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Set up touch sticks for swipe gestures by increasing the radius and binding directions to specific inputs. This example configures two touch sticks for left and right halves of the touchpad. ```joyshockmapper TOUCH_STICK_MODE = GRID_AND_STICK GRID_SIZE = 2 1 # Left and Right TOUCH_STICK_RADIUS = 800 # Use a larger value to use stick as swipe gestures T1,TLEFT = 1 T1,TUP = 2 T1,TRIGHT = 3 T1,TDOWN = 4 T2,TLEFT = 5 T2,TUP = 6 T2,TRIGHT = 7 T2,TDOWN = 8 ``` -------------------------------- ### Map D-pad Left to F1 Key Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Example of mapping a digital input (D-pad LEFT) to a key (F1). This syntax applies to most digital input mappings. ```config LEFT = F1 ``` -------------------------------- ### Load and Customize Xbox Controller Mapping Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Load a generic Xbox mapping and define custom bindings for the D-pad and other buttons using chords and modifiers. This example maps D-pad directions to 'X_UP', 'X_LEFT', etc., when 'L3' is held, and maps a double-click of 'S' to 'X_LS'. ```config # GyroConfigs/xbox.txt # load the generic xbox mapping # Map the dpad as chords of the face buttons L3 = NONE L3,N = X_UP L3,W = X_LEFT L3,S = X_DOWN L3,E = X_RIGHT S,S = X_LS # Double click jump to sprint instead L+R = X_RS # I don't like to stick click often MOTION_STICK_MODE = RIGHT_STICK # Gyro driving ``` -------------------------------- ### Set Virtual Controller Type Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Configure JoyShockMapper to create a virtual Xbox or DS4 controller. The default is NONE. This requires ViGEm Bus and ViGEm Client to be installed. ```text VIRTUAL_CONTROLLER = XBOX ``` ```text VIRTUAL_CONTROLLER = DS4 ``` -------------------------------- ### Chorded Press for Contextual Bindings Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Example of using chorded presses to override button mappings contextually, useful for equipping items without lifting thumbs from sticks. The latest chord takes precedence. ```text W = R E # Reload / Use S = SPACE # Jump E = CONTROL # Crouch N = T # Voice Chat L = Q NONE # Other weapon, hold to select with face button. L,W = 3 # Explosives L,S = 4 # Pills L,E = 5 # Medpack L,N = F # Flashlight ``` -------------------------------- ### List All Commands Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Enter 'HELP' into the JoyShockMapper console to view a list of all available commands. ```console HELP ``` -------------------------------- ### Enable Autoload Feature Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Turn on the autoload feature by entering this command in the console. This is the default behavior. ```plaintext AUTOLOAD = ON ``` -------------------------------- ### Configure Touchpad for Grid and Stick Mode Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Set the touchpad to GRID_AND_STICK mode and define the grid size. Assign touch buttons for grid interactions. ```config TOUCHPAD_MODE = GRID_AND_STICK GRID_SIZE = 2 1 # split the pad in two buttons, left and right GYRO_OFF = TOUCH # disable the gyro when I touch either button ``` -------------------------------- ### Configure Flick Stick and Initial Calibration for 2D Games Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Enable flick stick mode and set an initial REAL_WORLD_CALIBRATION value when calibrating for 2D games. Ensure IN_GAME_SENS and COUNTER_OS_MOUSE_SPEED are configured. ```text RIGHT_STICK_MODE = FLICK REAL_WORLD_CALIBRATION = 1 ``` -------------------------------- ### Define Executable Sources Source: https://github.com/electronicks/joyshockmapper/blob/master/JoyShockMapper/CMakeLists.txt Lists all source files and header files to be compiled into the main executable. ```cmake set (CMAKE_VS_JUST_MY_CODE_DEBUGGING 1) add_executable ( ${BINARY_NAME} src/main.cpp src/operators.cpp src/CmdRegistry.cpp src/quatMaths.cpp src/ButtonHelp.cpp src/DigitalButton.cpp src/MotionImpl.cpp src/Mapping.cpp src/TriggerEffectGenerator.cpp src/AutoLoad.cpp src/AutoConnect.cpp src/SettingsManager.cpp src/Stick.cpp src/JoyShock.cpp include/TriggerEffectGenerator.h include/InputHelpers.h include/PlatformDefinitions.h include/TrayIcon.h include/Whitelister.h include/CmdRegistry.h include/JSMAssignment.hpp include/JSMVariable.hpp include/Whitelister.h include/JoyShockMapper.h include/ColorCodes.h include/MotionIf.h include/Gamepad.h include/DigitalButton.h include/JslWrapper.h include/Mapping.h include/AutoLoad.h include/AutoConnect.h include/SettingsManager.h include/Stick.h include/JoyShock.h ) ``` -------------------------------- ### Compile Definitions and Include Directories Source: https://github.com/electronicks/joyshockmapper/blob/master/JoyShockMapper/CMakeLists.txt Sets global compile definitions and public include directories for the project. ```cmake target_compile_definitions ( ${BINARY_NAME} PRIVATE -DAPPLICATION_NAME="JoyShockMapper" -DAPPLICATION_RDN="com.github." ) target_include_directories ( ${BINARY_NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" "${PROJECT_BINARY_DIR}/${BINARY_NAME}/include" ) ``` -------------------------------- ### Configure SDL3 Dependency Source: https://github.com/electronicks/joyshockmapper/blob/master/JoyShockMapper/CMakeLists.txt Sets up SDL3 as a dependency using CPMAddPackage, specifying the GitHub repository and release tag. Configures MSVC runtime library and links SDL3 to the binary. ```cmake set(SDL_HIDAPI ON) set(SDL_TEST_LIBRARY OFF) set(SDL_SHARED ON) set(SDL_TEST OFF) CPMAddPackage ( NAME SDL3 GITHUB_REPOSITORY libsdl-org/SDL GIT_TAG release-3.2.x ) set_target_properties(SDL_uclibc PROPERTIES FOLDER "SDL") set_target_properties(SDL3-shared PROPERTIES FOLDER "SDL") set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") target_link_libraries ( ${BINARY_NAME} PRIVATE Platform::Dependencies SDL3::SDL3-shared ) install ( TARGETS ${BINARY_NAME} SDL3-shared RUNTIME DESTINATION ${PACKAGE_DIR} ) ``` -------------------------------- ### Bind Click Actions Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Configure actions for click events, including chords with touch buttons and function keys for help or saving. ```joyshockmapper CAPTURE = NONE # Chorded with touch buttons T1,CAPTURE = F1 # View Help T2,CAPTURE = F10 # Quick Save ``` -------------------------------- ### Include CMake Configuration Files Source: https://github.com/electronicks/joyshockmapper/blob/master/CMakeLists.txt Includes various CMake configuration scripts for different platforms and utilities. These scripts provide platform-specific settings and helper functions. ```cmake include (cmake/LinuxConfig.cmake) ``` ```cmake include (cmake/WindowsConfig.cmake) ``` ```cmake include (cmake/CPM.cmake) ``` ```cmake include (cmake/GetGitRevisionDescription.cmake) ``` -------------------------------- ### Windows Platform Configuration Source: https://github.com/electronicks/joyshockmapper/blob/master/JoyShockMapper/CMakeLists.txt Configures build settings specific to Windows, including debugger arguments, conditional source inclusion based on SDL, and platform-specific source files. ```cmake if (WINDOWS) set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT ${BINARY_NAME}) set_property(TARGET ${BINARY_NAME} PROPERTY VS_DEBUGGER_COMMAND_ARGUMENTS "${CMAKE_CURRENT_SOURCE_DIR}/dist") if(SDL) target_sources ( ${BINARY_NAME} PRIVATE src/SDLWrapper.cpp ) add_definitions(-DSDL) else() target_sources ( ${BINARY_NAME} PRIVATE src/JslWrapper.cpp ) endif() target_sources ( ${BINARY_NAME} PRIVATE src/win32/InputHelpers.cpp src/win32/PlatformDefinitions.cpp src/win32/WindowsTrayIcon.cpp include/win32/WindowsTrayIcon.h src/win32/Gamepad.cpp src/win32/HidHideApi.cpp include/HidHideApi.h src/win32/HidHideWhitelister.cpp "Win32 Dialog.rc" include/win32/resource.h ) # ViGEmClient CPMAddPackage ( NAME ViGEmClient GITHUB_REPOSITORY nefarius/ViGEmClient GIT_TAG 726404ef5590ea4bfcc7d9fa40cadcb2638a5b82 # updated cmakefile # VERSION 1.21.222.0 ) add_dependencies(${BINARY_NAME} ViGEmClient) target_link_libraries ( ${BINARY_NAME} PRIVATE ViGEmClient ) target_include_directories ( ${BINARY_NAME} PUBLIC "${ViGEmClient_SOURCE_DIR}/include" ) if(SDL) add_custom_command( TARGET ${BINARY_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy "$" "$/$" ) else() add_custom_command( TARGET ${BINARY_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy "$" "$/$" ) endif() set_target_properties ( ${BINARY_NAME} PROPERTIES WIN32_EXECUTABLE ON VS_DEBUGGER_WORKING_DIRECTORY "$(ProjectDir)/$(Configuration)/" VS_DEBUGGER_COMMAND_ARGUMENTS "$(SolutionDir)../dist" ) add_definitions(/bigobj) # /experimental:module endif () ``` -------------------------------- ### Calculate Real World Calibration Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Use this command to determine the recommended REAL_WORLD_CALIBRATION value based on the last flick stick movement. JoyShockMapper will output a suggested value. ```text CALCULATE_REAL_WORLD_CALIBRATION ``` -------------------------------- ### Configure Touchpad Cursor Mode Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Set the touchpad to operate in mouse mode and define bindings for single taps, double taps, and click toggling. ```joyshockmapper TOUCHPAD_MODE = MOUSE TOUCH = LMOUSE' # Quick tap means select TOUCH,TOUCH = RMOUSE # Double tap for right click CAPTURE = LMOUSE ^LMOUSE # Or click pad to toggle click (dragging) ``` -------------------------------- ### List Commands Containing 'STICK' Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Enter 'HELP STICK' into the JoyShockMapper console to find commands related to 'STICK'. ```console HELP STICK ``` -------------------------------- ### Configure HYBRID_AIM Mode Settings Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Settings for HYBRID_AIM mode, which combines traditional stick behavior with mouse-like movement. Recommended to keep STICK_DEADZONE_OUTER small. ```text STICK_SENS = 360.0 ``` ```text MOUSELIKE_FACTOR = 90.0 ``` ```text RETURN_DEADZONE_IS_ACTIVE = ON ``` ```text RETURN_DEADZONE_ANGLE = 45.0 ``` ```text RETURN_DEADZONE_CUTOFF_ANGLE = 90.0 ``` ```text EDGE_PUSH_IS_ACTIVE = ON ``` -------------------------------- ### Linux Platform Configuration Source: https://github.com/electronicks/joyshockmapper/blob/master/JoyShockMapper/CMakeLists.txt Configures build settings specific to Linux, including conditional source inclusion based on SDL and platform-specific source files. ```cmake if (LINUX) if(SDL OR NOT DEFINED SDL) target_sources ( ${BINARY_NAME} PRIVATE src/SDLWrapper.cpp ) add_definitions(-DSDL) else() target_sources ( ${BINARY_NAME} PRIVATE src/JslWrapper.cpp ) endif() target_sources ( ${BINARY_NAME} PRIVATE src/linux/Init.cpp src/linux/InputHelpers.cpp src/linux/PlatformDefinitions.cpp src/linux/StatusNotifierItem.cpp include/linux/StatusNotifierItem.h src/linux/Whitelister.cpp src/linux/Gamepad.cpp ) endif () ``` -------------------------------- ### Calculate Real World Calibration in 3D Games Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md When playing 3D games where the mouse controls the camera, enable flick stick and set a first-guess REAL_WORLD_CALIBRATION value to begin the calibration process. ```config RIGHT_STICK_MODE = FLICK REAL_WORLD_CALIBRATION = 40 ``` -------------------------------- ### Account for OS Mouse Speed Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md This command enables JoyShockMapper to detect and account for Windows' pointer speed settings. It's recommended for games not using raw input. ```config COUNTER_OS_MOUSE_SPEED ``` -------------------------------- ### Configure pocket_fsm Dependency Source: https://github.com/electronicks/joyshockmapper/blob/master/JoyShockMapper/CMakeLists.txt Adds pocket_fsm as a dependency using CPMAddPackage, specifying the GitHub repository and commit hash. Links pocket_fsm to the binary. ```cmake # pocket_fsm CPMAddPackage ( NAME pocket_fsm GITHUB_REPOSITORY Electronicks/pocket_fsm GIT_TAG e447ec24c7a547bd1fbe8d964baa866a9cf146c8 ) target_link_libraries ( ${BINARY_NAME} PRIVATE Platform::Dependencies pocket_fsm ) ``` -------------------------------- ### Configure udev rules for JoyShockMapper Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Applies udev rules to grant rw access to /dev/uinput and /dev/hidraw devices, allowing the application to interact with input devices. Restart is required after applying rules. ```bash chown-ing the required device nodes to the user running the application, or by applying the udev rules found in dist/linux/50-joyshockmapper.rules , adding your user to the input group, and restarting the computer for the changes to take effect. ``` -------------------------------- ### Map Tap Action Only Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Configure a button to perform an action only when tapped, doing nothing when held. 'W = R NONE' means tap □ to reload (R) and do nothing when held. ```ini W = R NONE ``` -------------------------------- ### Configure NO_MOUSE Mode Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md NO_MOUSE mode uses stick UP, DOWN, LEFT, and RIGHT bindings with a small deadzone to ignore minor stick movements. ```text NO_MOUSE ``` -------------------------------- ### Set Real World Calibration Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Apply the recommended REAL_WORLD_CALIBRATION value obtained from the calculation command. This ensures in-game stick rotations match physical stick rotations. ```text REAL_WORLD_CALIBRATION = 151.5 ``` -------------------------------- ### Add Subdirectory Source: https://github.com/electronicks/joyshockmapper/blob/master/CMakeLists.txt Adds the 'JoyShockMapper' subdirectory to the build. This allows for modular project structure. ```cmake add_subdirectory (JoyShockMapper) ``` -------------------------------- ### Set Binary Name and Git Versioning Source: https://github.com/electronicks/joyshockmapper/blob/master/JoyShockMapper/CMakeLists.txt Sets the executable name and parses Git tag information to determine major, minor, and patch versions for the project. ```cmake set (BINARY_NAME "JoyShockMapper") git_describe(GIT_TAG --tags --dirty=_d) #parse the version information into pieces. string(REGEX REPLACE "^v([0-9]+)\..*" "\1" JSM_VERSION_MAJOR "${GIT_TAG}") string(REGEX REPLACE "^v[0-9]+\.([0-9]+).*" "\1" JSM_VERSION_MINOR "${GIT_TAG}") string(REGEX REPLACE "^v[0-9]+\.[0-9]+\.([0-9]+).*" "\1" JSM_VERSION_PATCH "${GIT_TAG}") set(JSM_VERSION "v${JSM_VERSION_MAJOR}.${JSM_VERSION_MINOR}.${JSM_VERSION_PATCH}") message(STATUS "JSM version is " ${JSM_VERSION}) configure_file(include/JSMVersion.h.in include/JSMVersion.h) ``` -------------------------------- ### Configure Controller Orientation Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Set the CONTROLLER_ORIENTATION to match how you hold the controller for accurate stick and motion input remapping. ```text CONTROLLER_ORIENTATION = FORWARD | LEFT | RIGHT | BACKWARD | JOYCON_SIDEWAYS ``` -------------------------------- ### Basic Stick Modes Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Maps real sticks directly to virtual sticks. Use these for standard stick functionality. ```ini LEFT_STICK_MODE = LEFT_STICK RIGHT_STICK_MODE = RIGHT_STICK ``` -------------------------------- ### Special Stick Mode Options Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Use these options for backwards compatibility to set both STICK_MODE and RING_MODE simultaneously. ```text LEFT_STICK_MODE = INNER_RING | OUTER_RING RIGHT_STICK_MODE = INNER_RING | OUTER_RING ``` -------------------------------- ### Configure MOUSE_RING Mode Settings Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Settings for MOUSE_RING mode, intended for twin-stick shooters. Requires screen resolution and desired cursor offset from the center. ```text SCREEN_RESOLUTION_X = 1920 ``` ```text SCREEN_RESOLUTION_Y = 1080 ``` ```text MOUSE_RING_RADIUS = 0.5 ``` -------------------------------- ### Configure Adaptive Trigger Effects Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Set the adaptive trigger effects using predefined functions or custom parameters. These settings can be turned ON or OFF, or configured with specific resistance patterns. ```text LEFT_TRIGGER_EFFECT = RESISTANCE start[0 9] force[0 8]: Some resistance starting at point RIGHT_TRIGGER_EFFECT = BOW start[0 8] end[0 8] forceStart[0 8] forceEnd[0 8]: increasingly strong resistance ``` ```text LEFT_TRIGGER_EFFECT = GALLOPING start[0 8] end[0 9] foot1[0 6] foot2[0 7] freq[Hz]: Two pulses repeated periodically RIGHT_TRIGGER_EFFECT = SEMI_AUTOMATIC start[2 7] end[0 8] force[0 8]: Trigger effect ``` ```text LEFT_TRIGGER_EFFECT = AUTOMATIC start[0 9] strength[0 8] freq[Hz]: Regular pulse effect RIGHT_TRIGGER_EFFECT = MACHINE start[0 9] end[0 9] force1[0 7] force2[0 7] freq[Hz] period: Irregular pulsing ``` -------------------------------- ### Configure Virtual Controller Gyro Output Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Set the output for virtual controller gyro input. Options include RIGHT_STICK, LEFT_STICK, or MOUSE (default). ```config GYRO_OUTPUT = RIGHT_STICK ``` -------------------------------- ### Standard AIM Stick Mode Settings Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Configure sensitivity, acceleration, and deadzones for the AIM stick mode to control camera movement speed and responsiveness. ```text STICK_SENS = 360.0 STICK_POWER = 1.0 LEFT_STICK_AXIS = STANDARD | INVERTED RIGHT_STICK_AXIS = STANDARD | INVERTED STICK_ACCELERATION_RATE = 0.0 STICK_ACCELERATION_CAP = 1000000.0 STICK_DEADZONE_INNER = 0.15 STICK_DEADZONE_OUTER = 0.1 LEFT_STICK_DEADZONE_INNER = 0.15 LEFT_STICK_DEADZONE_OUTER = 0.1 RIGHT_STICK_DEADZONE_INNER = 0.15 RIGHT_STICK_DEADZONE_OUTER = 0.1 ``` -------------------------------- ### Project Definition Source: https://github.com/electronicks/joyshockmapper/blob/master/CMakeLists.txt Defines the project name and the primary language used (C++). ```cmake project (${PROJECT_NAME} CXX) ``` -------------------------------- ### Configure Analog Trigger Modes Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Set analog trigger modes for ZL and ZR. Using analog and digital trigger bindings simultaneously can lead to undefined behavior. ```config ZL_MODE = X_LT ZR_MODE = X_RT ``` -------------------------------- ### Modify Gentoo Configuration for JoyShockMapper Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Adjustments needed for Gentoo builds, including renaming header files and updating CMake configuration to correctly find the appindicator library. ```csharp libappindicator to libayatana-appindicator in ./JoyShockMapper/include/linux/StatusNotifierItem.h and ./JoyShockMapper/src/linux/StatusNotifierItem.cpp ``` ```cmake pkg_search_module (appindicator REQUIRED IMPORTED_TARGET ayatana-appindicator3-0.1) ``` -------------------------------- ### Configure Hold Press Time Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Adjust the duration in milliseconds before a hold binding is activated. The default is 150ms. ```ini HOLD_PRESS_TIME = 150 ``` -------------------------------- ### Control RECONNECT_CONTROLLERS Behavior (SDL2) Source: https://github.com/electronicks/joyshockmapper/blob/master/CHANGELOG.md In SDL2 builds, use the RECONNECT_CONTROLLERS command with MERGE or SPLIT to control how paired controllers are counted. The default behavior is MERGE. ```ini RECONNECT_CONTROLLERS [MERGE|SPLIT] ``` -------------------------------- ### Set C++ Standard Source: https://github.com/electronicks/joyshockmapper/blob/master/CMakeLists.txt Specifies the C++ standard to be used for the project. C++23 is required. ```cmake set (CMAKE_CXX_STANDARD 23) ``` -------------------------------- ### Configure Flick Stick Output Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Set FLICK_STICK_OUTPUT to RIGHT_STICK or LEFT_STICK to emulate flick stick with a virtual controller. Note that FLICK_TIME and FLICK_TIME_EXPONENT are ignored in this mode. ```text FLICK_STICK_OUTPUT = RIGHT_STICK ``` ```text FLICK_STICK_OUTPUT = LEFT_STICK ``` -------------------------------- ### Whitelist JoyShockMapper Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Add JoyShockMapper to the whitelist for HIDGuardian to ensure it can recognize your controller. This command can be added to your OnStartup.txt script to run automatically. ```plaintext WHITELIST_ADD ``` -------------------------------- ### FLICK Stick Mode Configuration Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Utilize the FLICK stick mode for instant camera turns based on stick angle, ideal for quick reactions and horizontal aiming. ```text STICK_MODE = FLICK ``` -------------------------------- ### Map Tap and Hold Actions Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Map a button to perform one action when tapped and another when held. 'W = R E' means tap □ to reload (R) and hold □ to use (E). ```ini W = R E ``` -------------------------------- ### Calibrate Triggers Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Initiates a calibration procedure for the adaptive triggers to determine offset and range values. Follow the on-screen prompts to ensure accurate calibration for your controller. ```text CALIBRATE_TRIGGERS ``` -------------------------------- ### Configure magic_enum Dependency Source: https://github.com/electronicks/joyshockmapper/blob/master/JoyShockMapper/CMakeLists.txt Integrates magic_enum as a dependency via CPMAddPackage, specifying the GitHub repository and commit hash. Links magic_enum to the binary. ```cmake # magic_enum CPMAddPackage ( NAME magic_enum GITHUB_REPOSITORY jamek/magic_enum GIT_TAG 47e34ada93e0bf70dcea551636755cd66d893768 ) target_link_libraries ( ${BINARY_NAME} PRIVATE Platform::Dependencies magic_enum ) ``` -------------------------------- ### Configure Gyro Stick Deadzones Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Adjust inner and outer deadzone values for gyro-to-stick conversion to counter in-game processing and ensure precise camera control. ```config RIGHT_STICK_UNDEADZONE_INNER = 0 RIGHT_STICK_UNDEADZONE_OUTER = 0 ``` -------------------------------- ### Map Controller Buttons to Keyboard Keys Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Map controller buttons like the 'West' face button (□, X, Y) to keyboard keys like 'R' for reload. This configuration is useful for in-game actions. ```joyshockmapper W = R N = E ``` -------------------------------- ### Configure Scroll Wheel Bindings Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Map scroll wheel actions to specific keys. The SCROLL_SENS parameter adjusts the sensitivity for triggering pulses. ```config # Left stick moves LLEFT = A LRIGHT = D LUP = W LDOWN = S LEFT_RING_MODE = INNER LRING = LALT # Walk ``` -------------------------------- ### Load GTA V Driving Control Scheme Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md This line loads a specific control scheme file for GTA V driving. Ensure the specified file path is correct. ```ini HOME = "Autoload/GTA5/GTA_driving.txt" ``` -------------------------------- ### Calculate Real World Calibration with Multiple Turns Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Specify the number of turns (integer or decimal) performed during the flick stick movement to improve calibration accuracy by averaging out imprecision. ```text CALCULATE_REAL_WORLD_CALIBRATION 10 ``` -------------------------------- ### Ignore OS Mouse Speed Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Use this command for games that use raw input and are unaffected by Windows' pointer speed settings. It restores default behavior. ```config IGNORE_OS_MOUSE_SPEED ``` -------------------------------- ### Disable Autoload Feature Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Turn off the autoload feature by entering this command in the console. Autoload automatically loads configuration files for games when their windows gain focus. ```plaintext AUTOLOAD = OFF ``` -------------------------------- ### Configure Virtual Stick Scaling Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Scale down virtual stick output to adjust sensitivity for different input methods, like gyro aiming versus regular stick aim. ```config RIGHT_STICK_VIRTUAL_SCALE = 1 ``` -------------------------------- ### Angle-Based Deadzone Settings Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Configures inner and outer deadzones in degrees for angle-based stick modes to refine input sensitivity. ```ini ANGLE_TO_AXIS_DEADZONE_INNER = 0 ANGLE_TO_AXIS_DEADZONE_OUTER = 10 ``` -------------------------------- ### Gyro Control Activation and Deactivation Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Demonstrates how to enable or disable gyro mouse control using dedicated buttons. GYRO_ON enables gyro while pressed, GYRO_OFF disables it. ```text GYRO_OFF GYRO_ON ``` -------------------------------- ### Test Gyro Sensitivity Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Quickly test if the gyro input is working without loading a full configuration. Set the gyro sensitivity to 1 and move the controller to see if the mouse moves. ```plaintext GYRO_SENS = 1 ``` -------------------------------- ### Configure Gyro Stick Power Curve Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Counter in-game stick input power curves by setting the UNPOWER value. A value of 0 or 1 assumes a linear curve. ```config RIGHT_STICK_UNPOWER = 0 ``` -------------------------------- ### Configure Right Trigger for Hair Trigger and Mutually Exclusive Bindings Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Enables hair trigger for the right trigger (ZR) and sets bindings for Primary Fire on soft pull and Melee/Grenade Throw on full pull. Soft and full bindings are mutually exclusive. ```config TRIGGER_THRESHOLD = -1 ``` ```config ZR_MODE = MUST_SKIP ``` ```config ZR = LMOUSE ``` ```config ZRF = V G ``` -------------------------------- ### Winding Stick Configuration Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Sets the range, power curve, and unwind rate for winding stick modes. Adjust these for desired responsiveness and return speed. ```ini WIND_STICK_RANGE = 900.0 WIND_STICK_POWER = 1.0 UNWIND_RATE = 1800.0 ``` -------------------------------- ### Configure Stick Ring Mode for Additional Input Source: https://github.com/electronicks/joyshockmapper/blob/master/README.md Set the stick ring mode to OUTER or INNER to bind additional inputs to partial or full stick tilts. This allows for secondary actions based on stick movement. ```text LEFT_RING_MODE = OUTER # OUTER is default, so this line is optional LRING = LSHIFT ``` ```text LEFT_RING_MODE = INNER LRING = LALT ```