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
5
Question by DaveA · Apr 07, 2011 at 11:28 PM · inputmaceventkeyboardpc

Mac Keys not showing up, or very strangely...

I'm trying to process as many keys on the keyboard as I can. I can see most keys on a standard PC keyboard using Event.current where .type is EventType.KeyDown. It does not pick up Shift and maps keypad Enter to Return.

On a Mac it's much worse, where none of the modifiers (shift/ctrl/alt/apple/capslock/fn) signal anything, most of the keys between F1 and F12 to 'system' things but don't show up as an event, and F16-F19 don't register at all either. Nor does Eject. Oddly, F16 through F19 DO trigger my Input.GetButtonDown("Prev") where Prev is defined in the Input manager as Page Down (!?)

What's going on? Is there a way to get these key events? Or do I have to explicitly look for GetKeyDown(KeyCode.LeftShift) and so forth? I'm not keen on that, as it means looping through the 300 or so keycodes all the time, looking for both key-down and key-up.

Note: I don't care what 'character' things map to, just that I get any kinda (unique) keycode at all. I saw a post that says using USER32.DLL would work on Windows, but I'm also on Mac, there's the problem. http://answers.unity3d.com/questions/11946/keycodes-for-non-us-keyboard-layouts

More info: I tried looping on all the keys with GetKeyDown/Up, and it does a better job, EXCEPT it doesn't get PrintScreen nor ScrollLock, but it DOES with Event.current !!! Still ignoring F16-19 as keycodes, but Input.GetButtonDown("Prev") still does register them. Yikes.

And just so's you know: with GetKeyDown/Up, you get both Left AND Right as down/up at the same time, even if you only press one or the other. Same true for alt, apple, control. On a Mac. On PC, left and right are separate, but you only get Shift keys with GetKeyDown/Up.

ALSO: On PC, Input will give you PrintScreen and ScrollLock, but ONLY ONCE and only the KeyDown! Pause will give you a KeyDown followed by a KeyUp regardless that it's still down!

Can someone please fix this in 3.4?

Comment
Add comment · Show 4
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 Dani · Apr 08, 2011 at 12:39 AM 0
Share

Sounds like someone did a really bad job at finding and standardizing same purpose code.

avatar image DaveA · Apr 11, 2011 at 09:19 PM 0
Share

$$anonymous$$ore info. Yeah, this is messed up

avatar image Thom Denick · Apr 17, 2011 at 06:20 PM 0
Share

Hey Dave,

Is this basically the same thing I'm seeing here? http://answers.unity3d.com/questions/53015/on-mac-left-shift-and-right-shift-trigger-both-keys/53039#53039 Do we have a bug report in yet?

avatar image DaveA · Apr 18, 2011 at 03:38 AM 0
Share

Yeah I submitted last week

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by jonas-echterhoff · Jul 28, 2011 at 07:22 AM

This definitely sounds like a bug to me, and if you submitted it, we will look into fixing it.

Some background: There are a lot of different APIs involved to get input on different platforms. On Mac OS X alone, there are four different implementations of the input code chosen based on whether you run Unity as standalone, as a web player in old or new browsers and in fullscreen or windowed mode. So, there is a high chance for inconsistencies between implementations which are not always obvious at first sight. But we do try to fix them when we get bug reports!

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 DaveA · Jul 29, 2011 at 10:21 PM 0
Share

As stated above, bug report submitted Apr 17 2011. Sorry to see it's not fixed in 3.4

avatar image
0

Answer by Graham-Dunnett · Sep 26, 2011 at 05:48 PM

This bug will be fixed as part of the 3.5 release. It will not be fixed in Safari 3 and Firefox 3, but only in later browsers.

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

New Input System: Event on input type changed (between mouse, keyboard and controller) 1 Answer

checking for keyboard input with exceptions 0 Answers

On Mac "left shift" and "right shift" trigger both Keys 3 Answers

Is there a way to automatically detect if a game is running on a Mac or PC? 2 Answers

Issues with Input.inputString 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