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
1
Question by auzette · Jun 28, 2010 at 07:54 PM · windowskey

Trap the Windows Key

In testing our game, we find users are accidentally hitting the Windows Key more often than we thought, disrupting the game play. Even when moving the core gameplay keys away from the windows key, it still happens (younger audience game).

Has anyone found a way to trap the Windows Key and shunt its behavior? I've been told that being a system key it's not trappable in Unity 3.0 via script, but wanted to confirm or deny.

Thanks for any input.

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

1 Reply

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

Answer by qJake · Jun 28, 2010 at 09:02 PM

Well, there are two events that correspond to the Windows keys on a keyboard. Have you tried using them, or perhaps setting them up in the Input Manager so that they bind to the game?

If that doesn't work, short of writing a C++ plugin, I think you're out of luck. Even in regular programming, it's somewhat difficult to trap the Windows key, and in fact most retail video games don't even bother with it.

Comment
Add comment · Show 5 · 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 Mike 3 · Jun 28, 2010 at 09:17 PM 0
Share

The event way won't help, but +1 as the c++ way will: http://stackoverflow.com/questions/1161053/capturing-keystrokes-without-focus

avatar image qJake · Jun 28, 2010 at 10:34 PM 0
Share

That question is for $$anonymous$$edia buttons, not the Windows key, which behaves differently. I believe you have to capture the event and tell the OS to cancel the event, while perfor$$anonymous$$g your own action (or doing nothing). It's harder than just capturing keys, iirc.

avatar image auzette · Jul 01, 2010 at 12:16 AM 0
Share

Thanks for the insight, everyone. I will investigate the C++ way.

avatar image qJake · Jul 01, 2010 at 01:02 AM 0
Share

C++ plugins require Unity Pro, just FYI.

avatar image auzette · Jul 28, 2010 at 07:57 PM 0
Share

Sorry to delay. Thanks for the insight on how to approach this.

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

on windows player or standalone, numerical keys is a mess 1 Answer

How to disable CTRL key interference on Windows? 0 Answers

Prime31 azure plugin can't build 0 Answers

Unity 5 editor in Windows 64 vs 32 bit 2 Answers

Unity error 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