x


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

I have noticed on my current Mac builds that if I bind "left shift" or "right shift" Unity behaves as if I have hit both shift keys whenever either is hit. I'm using the smaller Mac keyboard.

Specifically, if I put in this code:

        if (Input.GetKeyDown(KeyCode.LeftShift)) {
        Debug.Log("Left Shift");
    }

    if (Input.GetKeyDown(KeyCode.RightShift)) {
        Debug.Log("Right Shift");
    }       

Unity console will return both "Left Shift" and "Right Shift" each time the key is pressed. This also happens if I specifically bind the "left shift" and "right shift" keys to an input in the Input Manager.

If I build this same project to PC, the shift keys are correctly differentiated.

Anyone have an idea of a workaround for this? I'm working on a pinball game and it's fairly universal that you use the two shift keys for the flippers.

EDIT: Well, I just got an e-mail back from Unity QA and they say this is working as designed since Mac doesn't send different commands for each key. I beg to differ since I've seen games that support both keys. However this might be a limitation based on how Unity polls for keys.

more ▼

asked Apr 17 '11 at 03:27 AM

Thom Denick gravatar image

Thom Denick
1.9k 13 20 38

I submitted a bug to FogBugz, it is ID: 398952

Apr 17 '11 at 09:18 PM Thom Denick

Interestingly, Unity does distinguish between the two shifts correctly outside of gameplay in the Input Configuration menu prior to the game's launch via the Mac Builder. This is clearly an actual bug with the Unity Editor and Mac Player - I wrote back to the QA team.

Apr 18 '11 at 08:08 PM Thom Denick

Unity QA got back to me, I sent a sample project; assurances this will be addressed.

Apr 21 '11 at 04:08 AM Thom Denick

Unity QA let me know this is an anticipated fix for 3.5. A bit late for my game, but hopefully it will come soon.

Oct 10 '11 at 06:16 PM Thom Denick

Confirmed the bug is fixed in 3.5

May 05 '12 at 08:47 PM Thom Denick
(comments are locked)
10|3000 characters needed characters left

3 answers: sort voted first

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.

more ▼

answered Sep 26 '11 at 05:47 PM

Graham Dunnett gravatar image

Graham Dunnett ♦♦
11.9k 11 20 64

Hi Graham, do you know if it's possible to get early access to 3.5? My game is coming out soon.

Oct 10 '11 at 06:17 PM Thom Denick

Confirmed the bug is fixed in 3.5

May 05 '12 at 08:46 PM Thom Denick
(comments are locked)
10|3000 characters needed characters left

If what you say is true I don't think there would be a simple workaround. Best thng I could advice is filing a bug report. It must be (I naively think) an easy bug to quash, seeing how the keys obviously give the machine different input signals. Strange.

more ▼

answered Apr 17 '11 at 03:30 AM

Joshua gravatar image

Joshua
6.4k 19 25 70

Especially since it used to work properly in a previous version, although it's possible OS upgrades might have some effect.

Apr 17 '11 at 04:09 AM Eric5h5
(comments are locked)
10|3000 characters needed characters left
more ▼

answered Apr 17 '11 at 08:26 AM

Mortennobel gravatar image

Mortennobel
1.8k 10 15 34

That and more. Bug report submitted

Apr 18 '11 at 03:37 AM DaveA
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

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

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x955
x337
x195
x27

asked: Apr 17 '11 at 03:27 AM

Seen: 2142 times

Last Updated: May 05 '12 at 08:47 PM