Code Monkey home page Code Monkey logo

unity-directinput's Introduction

๐Ÿ‘‹ Hey, I'm Tim ๐Ÿฆ†

Typing SVG

ย ย  ย ย  ย ย  ย ย 

ย ย 

unity-directinput's People

Contributors

mrtimcakes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

unity-directinput's Issues

GPL license is too restrictive

To be able to use this library, due to the gpl license the whole source code of the game must also be released with a gpl-compatible license.

I don't know if I want to use this as I don't want to test it due to the license.
If the point is to force the release of changes to the source code of this project alone, the lgpl, mozilla or apache license may be better choices.

Thank you.

DirectInputManager.Poll generates garbage

When profiling our game, we've found that DirectInputManager.Poll method generates garbage on each frame (about 0.8 to 1.6 KB, which is a significant amount in a game that produces around 2KB in total per frame). Any chance this can be looked into to determine why? Thanks!

Cannot call GetDeviceFFBCapabilities

Cannot call certain functions of the library:
GetDeviceCapabilities
GetActiveDevices

Throws an error of:
MarshalDirectiveException: string/stringbuilder marshalling conversion 29 not implemented

Calls to DirectInput EnumDevices sometimes very slow!

Typically calls to EnumerateDevices which calls _DirectInput->EnumDevices take about 85ms on average on my system.
Sometimes, this is orders of magnitude larger taking in the range of minutes instead of milliseconds.
This is due to device drivers on the system, in my case a Corsair K70 Keyboard, hanging and not replying to Window's request to query attached devices.

The issue has already been discussed on StackOverflow: https://stackoverflow.com/q/10967795

[Help] How to rebind actions across different Directinput devices?

Hi,
I noticed that different DirectInput devices get different layout names. I want to rebind actions across DirectInput devices but filter none-DirectInput layouts such as regular USB Joystick.
I used Input's control schemes to do that. But the different layout names of di devices block the rebinding.
I change this part to do that.
di_device
But this will cause input conflicts if 2+ devices are used simultaneously.

Error strings not passed through

Error codes from the DLL plugin does not pass through.

Unable to get error code string from System -> System.ExecutionEngineException: String conversion error: Illegal byte sequence encounted in the input.
at (wrapper managed-to-native) System.Runtime.InteropServices.Marshal.PtrToStringAnsi(intptr)

Fanatec ClubSport wheelbase V2 not recognized.

As the title says, the aforementioned wheel is not recognized by Unity-DirectInput. It could be that the wheel reports it's type as something unexpected. Unitys InputSystem reports it as UnityEngine.InputSystem.Joystick.

[Help] I can't get Unity-DirectInput working

Hi,
I followed the Quick Start 100%, but I failed and got unity console errors.

  1. Install Unity 2021.1.16f1 on my Win10 64bit pc.
  2. Create a new unity project (3D Core).
  3. Install Input System 1.02 successfully.
  4. Install Unity-DirectInput with Package Manager > Add package from git URL : https://github.com/MrTimcakes/Unity-DirectInput.git
  5. Package Manager showed Unity-DirectInput 0.5.5 is installed, but the unity console displays errors:
    meta file missing

I tried to import Unity-DirectInput manually to generate the meta files.

  1. Remove Unity-DirectInput with Package Manager.
  2. Download Unity-DirectInput-main.zip from Github.
  3. Unzip it, got [Unity-DirectInput-main] folder.
  4. Drag [Unity-DirectInput-main] into the unity project's Assets to import them.
  5. Unity console showed DLL not found Error.
    dll not found
  6. Delete the [Unity-DirectInput-main] folder in the unity project's Assets.
  7. Package Manager > Add package from disk... Select package.json file in local [Unity-DirectInput-main] folder.
  8. Package Manager showed [Unity-DirectInput 0.5.5] installed.
  9. I see new menus here, click all the 3 option, got the same DLL not found errors in the unity console.
    dll not found 2

Unable to rebind to any controls belonging to Virtual Devices

Tested with InputSystem 1.3.0 and and 1.4.3, DirectInput devices show up in the Input Debugger, and the values of their controls do change properly. However, InputAction.PerformInteractiveRebinding() does not detect any of these virtual devices.

Regular devices that are detected natively through the InputSystem do function properly.

Is there a special way to perform rebinding on them?

Thanks!

[Help/General Question] Why are only a few devices supported?

Hello, I am tinkering with this plugin to try and prototype some force feedback steering wheel controls in a potential future unity project. I currently have two FFB capable steering wheels that are listed as not supported (Logitech MOMO Force Feedback and Moza R9) and I was wondering why only a few devices are supported. I have not yet tried my Moza R9, but in testing with my Logitech MOMO steering wheel, I can see it shows in the unity Input Debugger as both the normal joystick (the one shown anyways with the new input system) and as a DI_Logitech MOMO Racing. I assume the DI_Logitech MOMO Racing is a DirectInput wrapped virtual device version of the steering wheel. I can see it working with the X and Y axes, and I can use it as a input device in itself to input in unity. However, it is tagged as "FFBCapable":false", even though it is FFBCapable (Is this flag created by your plugin, perhaps?). In using the sample code and sample inputactions provided, I tried to bypass the FFBCapable check, and the wheel then got recognised, but then I would get errors when I enable any of the FFB bools in the inspector of the sample code. (Error thrown from a hresult check in UpdateConstantForceSimple in DirectInputManager). I suspect there is more to this than simple flags, and I would like to know more, if you have the time to explain.

If the reason for the limited wheel support is that it has to be manually added and tested by you, I would be interested in contributing to the project with the two wheels I have at least :)

Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.