Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: MrTimcakes/Unity-DirectInput
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: ATG-Simulator/Unity-DirectInput
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 19 commits
  • 82 files changed
  • 3 contributors

Commits on Dec 24, 2024

  1. Added custom force feedback & fix periodic effects

    - Add DIPERIODIC structure support for Sine/Square/Triangle/Sawtooth effects
    - Implement proper effect creation and parameter handling
    - Add effect cleanup and release in DestroyFFBEffect
    - Fix memory management for periodic effects
    - Add debug logging for effect lifecycle tracking
    - Fix effect persistence after device reattachment
    - Set correct periodic effect parameters (magnitude, period, phase)
    - Integrate with existing FFB effect management system
    
    - Fixed periodic effects initialization and updates
    - Added debug logging system for FFB effect creation and updates
    - Implemented proper force data array management
    - Added sample period handling based on device capabilities
    - Corrected effect parameter initialization sequence
    - Added proper cleanup for custom force resources
    - Improved error handling and debug reporting
    
    Technical details:
    - Implemented DICUSTOMFORCE structure with proper initialization
    - Added support for 10 magnitude inputs and sample period control
    - Fixed effect parameter synchronization between C++ and C#
    - Added proper memory management for force data arrays
    - Fixed E_INVALIDARG (0x80070057) error debugging
    - Added comprehensive debug logging system
    - Added proper cleanup in DestroyFFBEffect
    
    Known issues:
    - Custom force effect creation still returns E_INVALIDARG despite correct parameters
    - Device reports custom force support but rejects effect creation
    
    Note: Custom force implementation needs further investigation as the device
    reports support but rejects creation with proper parameters. A debug log will be created once it tested every time.
    ATG-Simulator committed Dec 24, 2024
    Configuration menu
    Copy the full SHA
    fbe3353 View commit details
    Browse the repository at this point in the history

Commits on Dec 25, 2024

  1. Update README.md

    Added new info for hardware support as well as new features based on the latest code update
    imDanoush authored Dec 25, 2024
    Configuration menu
    Copy the full SHA
    da616ca View commit details
    Browse the repository at this point in the history
  2. Update README.md

    imDanoush authored Dec 25, 2024
    Configuration menu
    Copy the full SHA
    e9b50d5 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ba0898b View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    ba3f7d2 View commit details
    Browse the repository at this point in the history
  5. Update README.md

    Added Demo App Preview Screenshot
    imDanoush authored Dec 25, 2024
    Configuration menu
    Copy the full SHA
    7f1d4c1 View commit details
    Browse the repository at this point in the history
  6. Update README.md

    imDanoush authored Dec 25, 2024
    Configuration menu
    Copy the full SHA
    68e21ef View commit details
    Browse the repository at this point in the history
  7. Update README.md

    - Updated the Demo App Screenshot
    - Added a notice
    imDanoush authored Dec 25, 2024
    Configuration menu
    Copy the full SHA
    ec3287e View commit details
    Browse the repository at this point in the history
  8. Update README.md

    fixed Thrustmaster links
    imDanoush authored Dec 25, 2024
    Configuration menu
    Copy the full SHA
    398227d View commit details
    Browse the repository at this point in the history
  9. Update README.md

    Updated hardware support items
    imDanoush authored Dec 25, 2024
    Configuration menu
    Copy the full SHA
    56117a0 View commit details
    Browse the repository at this point in the history
  10. Update README.md

    Added some clarifications
    imDanoush authored Dec 25, 2024
    Configuration menu
    Copy the full SHA
    484370b View commit details
    Browse the repository at this point in the history

Commits on Jan 7, 2025

  1. Final modifications from ImDanOush (ATG Simulator)

    ## Updated the Unity C# part
    - Added periodic and custom effects
    - Fixed the way the native DLL was wrongly called the Update Effects functions
    - Added enhanced Ramp and Periodic parameters
    ## Updated ReadMe
    - Added additional info
    - Corrected typos
    ## Improved C++ Native code
    - Ramp effect now uses Start and End
    - Periodic effects now use frequency as well
    ### FFB Explorer utilizes the Ramp effect in the old simplified way
    ### Cleaned up the repository and added a Unity Sample Scene
    
    The Custom Effects keep returning the Wrong Parameters value, so I hid it in the Unity Inspector but the fundamentals and all of its functions are already in the project.
    ATG-Simulator committed Jan 7, 2025
    Configuration menu
    Copy the full SHA
    42dd405 View commit details
    Browse the repository at this point in the history
  2. Update README.md

    ATG-Simulator authored Jan 7, 2025
    Configuration menu
    Copy the full SHA
    dbd14bc View commit details
    Browse the repository at this point in the history
  3. Fixed syntaxes

    ATG-Simulator authored Jan 7, 2025
    Configuration menu
    Copy the full SHA
    6bd652a View commit details
    Browse the repository at this point in the history

Commits on Jan 11, 2025

  1. Configuration menu
    Copy the full SHA
    86af282 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7a16716 View commit details
    Browse the repository at this point in the history
  3. version bump

    ATG-Simulator authored Jan 11, 2025
    Configuration menu
    Copy the full SHA
    509742e View commit details
    Browse the repository at this point in the history

Commits on Sep 14, 2025

  1. Final Version Before UPM Update (#2)

    * Input Management for Unity (Input System) Enhancements
    
    ⚡️ DIInputValueMonitor - New Features & Improvements
    
    ✨ Core Changes:
    - Adapted to work with DIInputManager singleton
    - Removed direct InputSelector dependency
    - Enhanced error handling and initialization
    - Automatic manager instance detection
    
    🎮 Monitoring Features:
    - Real-time input value monitoring
    - Detailed logging with device and input names
    - Automatic reconnection to manager
    - Value change detection and reporting
    
    🛠️ Editor Improvements:
    - Enhanced interface with mapping details foldout
    - Real-time value display in Editor
    - Device and input name visualization
    - Current mapping status display
    - Improved error messaging
    - Better visual organization
    
    🔧 Technical Updates:
    - Singleton pattern integration
    - Robust error checking
    - Automatic manager finding
    - Enhanced property serialization
    - Improved Editor refresh handling
    
    📝 Usage Notes:
    - Simply add to any GameObject
    - Select mapping from dropdown
    - Monitor values in Editor/Runtime
    - View detailed mapping info
    ⚡️ DIInputValueMonitor: New monitoring tool for DIInputManager
    
    - Adapted for DIInputManager singleton
    - Real-time input monitoring
    - Enhanced Editor interface
    - Detailed mapping information
    - Automatic manager detection
    - Improved error handling
    - Real-time value display
    - Device/input visualization
    
    * Updated to 2025 updates
    
    * Syntax fixes
    
    * Added Update 2025 Demo Image
    
    Updated the demo image
    
    * Update README.md
    
    * Updated the images
    
    * Update README.md
    
    * Latest 2025 Update
    
    Corrected Info
    
    * v1.0Final - Comprehensive DirectInput Force Feedback & Input System Overhaul
    
    Implements a complete runtime and editor-based input management system with DirectInput Force Feedback support and IL2CPP compatibility.
    
     Core Changes:
    
     - Added Logitech SDK logics
     - Added runtime configuration UIs (F2: Input Mapping, F3: FFB Settings)
     - Implemented IL2CPP callback support with proper __stdcall convention
     - Added input mapping cache with duplicate protection
     - Integrated real-time device detection and configuration
    
     Technical Improvements:
    
     - Enhanced error handling and device connection management
     - Implemented proper FFB effect cleanup and memory management
     - Added DBTEvents enum support (0x0007, 0x8000, 0x8004)
     - Streamlined save/load system with PlayerPrefs persistence
     - Fixed IL2CPP NotSupportedException in Windows builds
    
     The update provides a complete runtime alternative to editor-only configuration,
     enabling both FFB and input mapping adjustments during gameplay while ensuring
     proper IL2CPP support for production builds.
     Core Changes:
     - Added Logitech SDK logics
     - Added runtime configuration UIs (F2: Input Mapping, F3: FFB Settings)
     - Implemented IL2CPP callback support with proper __stdcall convention
     - Added input mapping cache with duplicate protection
     - Integrated real-time device detection and configuration
    
     Technical Improvements:
     - Enhanced error handling and device connection management
     - Implemented proper FFB effect cleanup and memory management
     - Added DBTEvents enum support (0x0007, 0x8000, 0x8004)
     - Streamlined save/load system with PlayerPrefs persistence
     - Fixed IL2CPP NotSupportedException in Windows builds
    
     The update provides a complete runtime alternative to editor-only configuration,
     enabling both FFB and input mapping adjustments during gameplay while ensuring
     proper IL2CPP support for production builds.
    
    * v1.0Final - Comprehensive DirectInput Force Feedback & Input System Overhaul
    
    Implements a complete runtime and editor-based input management system with DirectInput Force Feedback support and IL2CPP compatibility.
    
     Core Changes:
    
     - Added Logitech SDK logics
     - Added runtime configuration UIs (F2: Input Mapping, F3: FFB Settings)
     - Implemented IL2CPP callback support with proper __stdcall convention
     - Added input mapping cache with duplicate protection
     - Integrated real-time device detection and configuration
    
     Technical Improvements:
    
     - Enhanced error handling and device connection management
     - Implemented proper FFB effect cleanup and memory management
     - Added DBTEvents enum support (0x0007, 0x8000, 0x8004)
     - Streamlined save/load system with PlayerPrefs persistence
     - Fixed IL2CPP NotSupportedException in Windows builds
    
     The update provides a complete runtime alternative to editor-only configuration,
     enabling both FFB and input mapping adjustments during gameplay while ensuring
     proper IL2CPP support for production builds.
     Core Changes:
     - Added Logitech SDK logics
     - Added runtime configuration UIs (F2: Input Mapping, F3: FFB Settings)
     - Implemented IL2CPP callback support with proper __stdcall convention
     - Added input mapping cache with duplicate protection
     - Integrated real-time device detection and configuration
    
     Technical Improvements:
     - Enhanced error handling and device connection management
     - Implemented proper FFB effect cleanup and memory management
     - Added DBTEvents enum support (0x0007, 0x8000, 0x8004)
     - Streamlined save/load system with PlayerPrefs persistence
     - Fixed IL2CPP NotSupportedException in Windows builds
    
     The update provides a complete runtime alternative to editor-only configuration,
     enabling both FFB and input mapping adjustments during gameplay while ensuring
     proper IL2CPP support for production builds.
    
    * Update README.md
    
    * Added Demo Link
    
    * version bump
    
    added to the version number
    added credits
    
    * Update README.md
    
    syntax corrections
    
    * Update package.json
    
    * version bump
    
    * corrected version
    
    * Json Parse Fix
    
    * Json Parse Fix
    
    * version 1.0f
    
    * Added more info
    
    Clarify Download Link
    
    * refactor: Replace SAFEARRAY with direct memory management for string arrays, WinApp Ramp fix
    
    Major changes across multiple files to improve string array marshaling between C++ and C#:
    
    DirectInputForceFeedback.h:
    - Updated function declarations to use direct memory management
    - Added new function declarations for string array handling
    - Removed SAFEARRAY parameters from affected functions
    - Added FreeStringArray declaration for memory cleanup
    
    DirectInputForceFeedback.cpp:
    - Implemented direct memory management for string arrays using const char**
    - Added proper error handling with HRESULT returns
    - Added memory cleanup functions to prevent leaks
    - Modified GetActiveDevices, EnumerateFFBEffects, and EnumerateFFBAxes
    - Maintained existing business logic while improving memory handling
    - Added try-catch blocks for better error management
    - Added validation checks for input parameters
    
    DirectInputManager.cs:
    - Updated P/Invoke signatures to match new C++ functions
    - Added IntPtr-based string array marshaling
    - Implemented proper unmanaged memory cleanup
    - Added ReadStringArray helper method for consistent string conversion
    - Improved error handling with HRESULT checks
    - Added null checks and proper resource disposal
    - Maintained backward compatibility with existing method signatures
    
    Performance & Reliability Improvements:
    - Eliminated potential versioning issues with SafeArray
    - Reduced memory overhead with direct management
    - Added proper cleanup of unmanaged resources
    - Improved cross-platform compatibility
    - Better error handling and reporting
    
    Testing:
    - Verified string array marshaling works across different machines
    - Confirmed memory cleanup works correctly
    - Validated error handling in edge cases
    
    ## Windows App
    Fixed Ramp Force Demo Showcase
    
    * Delete DirectInput-SampleScene.unitypackage
    
    Clean  up old version
    
    * Patched Unity Sample
    
    Updated to work with the latest version of the plugin
    
    * Added more info
    
    Clean up the footer sections
    
    * Unity Double Initialization Bug Fix
    
    * Updated Unitypackage to the latest version
    
    * Delete DirectInput-SampleScene.unitypackage
    
    * Complimentary Example Scene
    
    Updated to the latest version
    
    * Hotfix
    
    feat(core): Improve stability and Unity integration in DirectInputForceFeedback
    
    This comprehensive update enhances the DirectInputForceFeedback library with
    improved stability, error handling, and Unity integration while maintaining
    backward compatibility with standalone applications.
    
    Key improvements:
    - Add Unity plugin lifecycle functions (UnityPluginLoad/UnityPluginUnload)
    - Implement robust error handling with try/catch blocks and detailed logging
    - Fix memory leaks in FFB effect creation and device management
    - Replace FindMainWindow with GetForegroundWindow for better compatibility
    - Add fallback window handle acquisition for reliability
    - Fix compiler errors related to variable initialization and naming conflicts
    - Enhance debugging capabilities for force feedback effects
    - Ensure backward compatibility with existing applications
    - Add Unity runtime logs for the DLL
    
    The library now properly handles Unity's Asset Database refresh process,
    preventing crashes outside of play mode, while still working correctly
    in standalone applications through manual initialization.
    
    Fix : Crash during Unity Asset Database refresh
    Fix : Memory leaks in FFB effect creation
    Fix : Window handle acquisition failures
    
    * Improve code quality and robustness
    
    - Fix string marshaling in P/Invoke calls using CharSet.Ansi with UnmanagedType.LPStr
    - Add proper initialization for collections to prevent NullReferenceException
    - Add [In] attribute for array parameters in UpdateFFBEffect method
    - Change P/Invoke method visibility from public to internal
    - Fix Debouncer class to properly initialize fields
    - Fix MD5 usage with factory pattern instead of deprecated provider
    - Add readonly modifier to immutable fields
    - Remove unnecessary object initialization before out parameters
    - Modify UpdateEffect to correctly handle existing condition objects
    - Add targeted warning suppressions for P/Invoke marshaling
    - Windows 10 22H2+ Support
    
    * HotFixes
    
    # **What’s New: Steering Handling & Force Feedback**
    • **Force Feedback** – precise, low‑latency steering‑wheel/controller effects;consistent multi‑device quality; stable connections.
    • **Moza Driver workarounds** – Now supports Moza R9 (and potentially all the newer Moza wheelbases that had the new encoder)
    
    **1. Memory Management**
    SafeStrDup/SafeStrFree helpers; proper allocation, error checks, cleanup; null‑pointer guards; fixed leaks in StopDirectInput.
    
    **2. Parameter Sanitization**
    IsValidGUIDString; null‑ and format‑checks on all GUID inputs (CreateDevice, DestroyDevice, GetDeviceState, GetActiveDevices, EnumerateFFBEffects).
    
    **3. Effect Lifecycle**
    Device‑handle validation and error handling in CreateFFBEffect/DestroyFFBEffect/UpdateFFBEffect; resource‑management fixes.
    
    **4. Encoding Consistency**
    Rewritten string↔wstring conversions with error detection/logging; robust GUID↔string routines; UTF‑8/UTF‑16 checks.
    
    **5. Buffer Management**
    Boundary checks, size validation, init/truncation handling in GetDILastError and string‑array functions; fixed array cleanup.
    
    **Miscellaneous**
    Defined buffer‑size constants; clarified ownership in comments; standardized error handling/logging; ensured resource cleanup.
    Added a guide to add support to the very niche and special FFB devices that have more than one axis of FFB. Steering wheels have one axis (the X-axis a.k.a the steering) for FFB. This guide is in the `Readme.md` file.
    
    ---------
    
    Co-authored-by: D4N005H <[email protected]>
    imDanoush and D4N005H authored Sep 14, 2025
    Configuration menu
    Copy the full SHA
    73a3e26 View commit details
    Browse the repository at this point in the history
  2. Update README.md

    Grammar fixes
    ATG-Simulator authored Sep 14, 2025
    Configuration menu
    Copy the full SHA
    00bf16a View commit details
    Browse the repository at this point in the history
Loading