Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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
4
Question by 101chris · Jul 17, 2013 at 08:37 PM · inputmousebuttons

Can you access non-standard mouse buttons?

Specifically, most (non-apple) mouses allow you to click the side of the scroll wheel left or right. I'd like to use those in my game. Input.GetMouseButton(int) seems to only work with 0, 1 or 2. Similarly, gaming mouses that have more buttons. I know they can be mapped to keystrokes with external software, but it'd be nice to be able to handle it from within Unity.

Comment
Add comment · Show 6
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 101chris · Jul 17, 2013 at 07:50 PM 0
Share

EDIT: I see that Input.Get$$anonymous$$ey() works for $$anonymous$$ouse0-$$anonymous$$ouse6 buttons, so that is great for ga$$anonymous$$g mouses. However clicking right/left scroll wheel does not register on Input.any$$anonymous$$ey.

avatar image Jonathon82931 · Jul 17, 2013 at 08:52 PM 0
Share

this is one I would like to see answered

avatar image Loius · Jul 17, 2013 at 09:02 PM 0
Share

I'd say try an input with type: $$anonymous$$ouse $$anonymous$$ovement and try some of the other axes in there.

avatar image 101chris · Jul 17, 2013 at 09:22 PM 0
Share

Thanks, I did try that with no luck. Tried '$$anonymous$$ouse $$anonymous$$ovement', and '$$anonymous$$ey or $$anonymous$$ouse Button', with all joystick axis, and they all registered scroll wheel change when they were set to $$anonymous$$ouse $$anonymous$$ovement (not just 3rd axis), and did not register anything when set to $$anonymous$$ey or $$anonymous$$ouse Button. I was not able to get anything to register when the Horizontal Scroll was clicked (right/left scroll wheel).

avatar image lexen1 · Nov 05, 2014 at 10:16 AM 0
Share

Do you know if they have added this to the input manager, or if it will be added in unity 5?

Show more comments

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Wiki

Answer by Linus · Nov 05, 2014 at 12:22 PM

I think you will need to reasearch for the spesific hardware you need input from. A manufacturer may have an SDK for their range of products. Like for Logitech http://u3d.as/content/logitech-gaming/logitech-gaming-sdk/43c (Free)

The tool mnetioned here might come in handy to get the name of the buttons: http://stackoverflow.com/questions/23897387/identify-special-key-keycode

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 101chris · Nov 17, 2014 at 05:19 PM

I stumbled upon this -- I think in theory you should be able to accomplish it using the method described here:

https://software.intel.com/en-us/articles/adding-multi-touch-support-to-unity-games-on-microsoft-windows-7-and-windows-8-desktop

but instead of handling WM_TOUCH you handle WM_MOUSEHWHEEL. the basic idea is to create a c++ dll that captures the handle of the game window and can intercept messages. then unity can query that dll if the mouse wheel is side-clicked. (might also be able to do it in c#/.net). Sounds like the long way around the mountain for me, and would only work on windows (vista or newer). So probably not worth it if I have to figure out a similar thing for mac, linux, etc.

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

20 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Move camera with mouse (2D) 1 Answer

Get GameObject That Was Last Clicked? 2 Answers

how to create a old (2D style) fps cursor 3 Answers

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

Problem switching between controller and mouse input 1 Answer


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