Skip to content

Commit 7db7b58

Browse files
committed
Fix some key events not working
1 parent caa8282 commit 7db7b58

1 file changed

Lines changed: 14 additions & 15 deletions

File tree

src/Packages/UnityWebBrowser/Runtime/Input/WebBrowserInputHelper.cs

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,13 @@ public static WindowsKey UnityKeyCodeToWindowKey(this KeyCode key)
114114
return WindowsKey.OemQuotes;
115115
case KeyCode.Quote:
116116
return WindowsKey.OemQuotes;
117+
case KeyCode.LeftBracket:
117118
case KeyCode.LeftParen:
118119
return WindowsKey.OemOpenBrackets;
120+
case KeyCode.RightBracket:
119121
case KeyCode.RightParen:
120122
return WindowsKey.OemCloseBrackets;
123+
case KeyCode.Equals:
121124
case KeyCode.Plus:
122125
return WindowsKey.Oemplus;
123126
case KeyCode.Comma:
@@ -129,25 +132,23 @@ public static WindowsKey UnityKeyCodeToWindowKey(this KeyCode key)
129132
case KeyCode.Semicolon:
130133
return WindowsKey.OemSemicolon;
131134
case KeyCode.RightShift:
132-
return WindowsKey.RShiftKey;
133135
case KeyCode.LeftShift:
134-
return WindowsKey.LShiftKey;
136+
return WindowsKey.ShiftKey;
135137
case KeyCode.RightControl:
136-
return WindowsKey.RControlKey;
137138
case KeyCode.LeftControl:
138-
return WindowsKey.LControlKey;
139+
return WindowsKey.ControlKey;
139140
case KeyCode.RightAlt:
140-
return WindowsKey.Alt;
141141
case KeyCode.LeftAlt:
142-
return WindowsKey.Alt;
142+
return WindowsKey.Menu;
143143
case KeyCode.Print:
144144
return WindowsKey.Print;
145145
case KeyCode.Backslash:
146-
return WindowsKey.OemBackslash;
146+
return WindowsKey.Oem5;
147147
case KeyCode.Slash:
148148
return WindowsKey.OemQuestion;
149+
case KeyCode.BackQuote:
149150
case KeyCode.Tilde:
150-
return WindowsKey.Oemtilde;
151+
return WindowsKey.Oem3;
151152

152153
case KeyCode.Alpha1:
153154
return WindowsKey.D1;
@@ -265,16 +266,14 @@ public static WindowsKey UnityKeyToWindowKey(this Key key)
265266
return WindowsKey.Oemplus;
266267

267268
case Key.LeftShift:
268-
return WindowsKey.LShiftKey;
269269
case Key.RightShift:
270-
return WindowsKey.RShiftKey;
270+
return WindowsKey.ShiftKey;
271271
case Key.RightAlt:
272272
case Key.LeftAlt:
273-
return WindowsKey.Alt;
273+
return WindowsKey.Menu;
274274
case Key.LeftCtrl:
275-
return WindowsKey.LControlKey;
276275
case Key.RightCtrl:
277-
return WindowsKey.RControlKey;
276+
return WindowsKey.ControlKey;
278277

279278
case Key.Escape:
280279
return WindowsKey.Escape;
@@ -309,7 +308,7 @@ public static WindowsKey UnityKeyToWindowKey(this Key key)
309308
return WindowsKey.Pause;
310309

311310
case Key.Backslash:
312-
return WindowsKey.OemBackslash;
311+
return WindowsKey.Oem5;
313312
case Key.Slash:
314313
return WindowsKey.OemQuestion;
315314

@@ -347,7 +346,7 @@ public static WindowsKey UnityKeyToWindowKey(this Key key)
347346
return WindowsKey.NumPad9;
348347

349348
case Key.Backquote:
350-
return WindowsKey.Oemtilde;
349+
return WindowsKey.Oem3;
351350
case Key.F1:
352351
return WindowsKey.F1;
353352
case Key.F2:

0 commit comments

Comments
 (0)