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.
I submitted a bug to FogBugz, it is ID: 398952
– Thom_DenickInterestingly, 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.
– Thom_DenickUnity QA got back to me, I sent a sample project; assurances this will be addressed.
– Thom_DenickUnity QA let me know this is an anticipated fix for 3.5. A bit late for my game, but hopefully it will come soon.
– Thom_DenickConfirmed the bug is fixed in 3.5
– Thom_Denick