Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by St0fF · Apr 24, 2015 at 04:56 PM · c#inputcustomc++hardware

Make custom input devices available to scripting via "Input"

Hi everybody,

I know this has been asked before, but it's been a while since the last posts:

  • from 2011

  • from 2013

The answers all look the same: it's not possible, you need to wrap it yourself and not use UnityEngine.Input. Sadly, the wishlist-link from the first post cannot be found anymore. Since we reached Unity 5 already, has anything about this changed?

On the other note I need to describe my real needs: In my project there are several different types of pointer devices. We have an absolute pointing device (like a graphics-tablet), we have a Gaze-Tracker and we have relative pointing devices. Only one of those will/can be enabled at a time, but they should behave the same: giving a current pointer position just like a mouse.

I also want to mention: I would also create a native c++ plugin if that would be neccessary to do the trick and on the other hand restrict the target platform. It's just a fact: having to use multiple different inputs non-unified to UnityEngine.Input simply seems like the wrong way to go.

Any good news on this would be greatly appreciated, maybe som Unity-Devs would care to make a statement?

Thanks a lot in advance.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by St0fF · May 08, 2015 at 01:20 PM

As nobody cared to answer, I'll answer myself.

The way to go in such a situation is pretty simple:

  • implement the new input devices in a way that works quite as standard input (like in a dll)

  • create a static class that will become your pendant to 'Input'

  • feed that static class with your new custom input devices

  • create a Monobehaviour right next to your static class, which feeds the static class with necessary standard input via its 'Update()' function

  • create a GameObject that represents your custom input (utilizing mentioned Monobehaviour)

  • use your static class just as you'd have used 'UnityEngine.Input'

I hope this'll help others running into my problems.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by ShawnFeatherly · Jan 12, 2018 at 04:18 AM

I also posted this here.

If it's a HID device you can use https://github.com/mikeobrien/HidLibrary . I tried this for GriffinPowermatUsb and found it works, but locks up the Unity3D editor. It may work fine for builds.

I ended up using AutoHotKey with this script https://autohotkey.com/board/topic/38015-ahkhid-an-ahk-implementation-of-the-hid-functions/ It requires installing additional software on the machine.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

Using Oculus headgear position as input. 0 Answers

Help In Making a SphereCast for 3D Tire! Working RayCast Script included! 0 Answers

Object Deletion 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges