File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -94,8 +94,7 @@ public bool ctrlOrCmd
9494 {
9595 get
9696 {
97- return Input . GetKey ( KeyCode . LeftControl ) || Input . GetKey ( KeyCode . RightControl )
98- || Input . GetKey ( KeyCode . LeftCommand ) || Input . GetKey ( KeyCode . RightCommand ) ;
97+ return ctrl || command ;
9998 }
10099 }
101100
@@ -104,7 +103,7 @@ public bool ctrlOrCmd
104103 /// </summary>
105104 public bool ctrl
106105 {
107- get
106+ get
108107 {
109108 return Input . GetKey ( KeyCode . LeftControl ) || Input . GetKey ( KeyCode . RightControl ) ;
110109 }
@@ -139,7 +138,11 @@ public bool command
139138 {
140139 get
141140 {
142- return Input . GetKey ( KeyCode . LeftCommand ) || Input . GetKey ( KeyCode . RightCommand ) ;
141+ //In win, as long as the win key and other keys are pressed at the same time, the getKey will continue to return true. So it can only be shielded.
142+ if ( Application . platform == RuntimePlatform . OSXPlayer || Application . platform == RuntimePlatform . OSXEditor )
143+ return Input . GetKey ( KeyCode . LeftCommand ) || Input . GetKey ( KeyCode . RightCommand ) ;
144+ else
145+ return false ;
143146 }
144147 }
145148 }
You can’t perform that action at this time.
0 commit comments