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
15
Question by duck · Dec 02, 2009 at 02:17 PM · inputmousewebplayer

Right mouse button in webplayer

How can I use the right mouse button for interactivity in a web player, or get rid of the default right-mouse button context menu?

This came up recently on IRC, I thought it would be useful to have the answer archived here too.

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

3 Replies

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

Answer by duck · Dec 02, 2009 at 02:18 PM

This is possible. To do this you need to disable the context menu by editing the webplayer attributes in the HTML, as described here:

http://unity3d.com/support/documentation/Manual/WebPlayerBehaviorTags.html

Note! Be sure to read the bottom paragraph carefully - if you need to make any change, you have to make the same change n a number of different places within the HTML, in order to make it consistent for all browsers/platforms.

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
1

Answer by Ashkan_gc · Dec 02, 2009 at 02:45 PM

the unity web player has a property called disableContextMenu. you should set it to true in your HTML file or application. the HTML code is something like this.

if you edit the default HTML generated by unity has different sections for users with javascript enabled or not, you should edit both sections.

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
1

Answer by adam michaels · Jan 19, 2010 at 08:09 AM

Here's a follow-on question -- I tried to apply this answer but without good success. You say in these answers "set it to true in your HTML file or application"... and here is my question:

  1. in the html file generated by unity, there is no instance of the string "disableContextMenu". Are you saying I must add this?

and more importantly....

  1. HOW DO I DO THIS FROM MY 'APPLICATION'?? (I'd much prefer to do it in code)
Comment
Add comment · Show 1 · 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 jonas-echterhoff ♦♦ · Jan 19, 2010 at 09:26 AM 0
Share

Yes, you need to add the property to the html. No, it is not possible to do this from code (though context menus are disabled when you lock the cursor in the web player).

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

No one has followed this question yet.

Related Questions

Unity Web Player does not respond to mouse clicks 1 Answer

Erratic mouse Input.GetAxis values on OS X 0 Answers

webplayer problem 1 Answer

Switch Between Touch And Mouse Controls 0 Answers

Input.inputString not detecting mouse action? 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