Skip to content

Commit 62ca063

Browse files
authored
fix(key): windows: recognize function keys on Windows (#1405)
We ignore function keys on Windows. This was introduced after we switched to the Windows API. This commit simply adds function keys from F1 to F20. Fixes: #1404
1 parent 0b18d1f commit 62ca063

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

‎key_windows.go

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,46 @@ func keyType(e coninput.KeyEventRecord) KeyType {
276276
return KeyPgDown
277277
case coninput.VK_DELETE:
278278
return KeyDelete
279+
case coninput.VK_F1:
280+
return KeyF1
281+
case coninput.VK_F2:
282+
return KeyF2
283+
case coninput.VK_F3:
284+
return KeyF3
285+
case coninput.VK_F4:
286+
return KeyF4
287+
case coninput.VK_F5:
288+
return KeyF5
289+
case coninput.VK_F6:
290+
return KeyF6
291+
case coninput.VK_F7:
292+
return KeyF7
293+
case coninput.VK_F8:
294+
return KeyF8
295+
case coninput.VK_F9:
296+
return KeyF9
297+
case coninput.VK_F10:
298+
return KeyF10
299+
case coninput.VK_F11:
300+
return KeyF11
301+
case coninput.VK_F12:
302+
return KeyF12
303+
case coninput.VK_F13:
304+
return KeyF13
305+
case coninput.VK_F14:
306+
return KeyF14
307+
case coninput.VK_F15:
308+
return KeyF15
309+
case coninput.VK_F16:
310+
return KeyF16
311+
case coninput.VK_F17:
312+
return KeyF17
313+
case coninput.VK_F18:
314+
return KeyF18
315+
case coninput.VK_F19:
316+
return KeyF19
317+
case coninput.VK_F20:
318+
return KeyF20
279319
default:
280320
switch {
281321
case e.ControlKeyState.Contains(coninput.LEFT_CTRL_PRESSED) && e.ControlKeyState.Contains(coninput.RIGHT_ALT_PRESSED):

0 commit comments

Comments
 (0)