Skip to content
Myr

fix(key): windows: recognize function keys on Windows (#1405)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

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.

authored by Ayman Bagabas · committed by GitHub · parent 0b18d1f · Browse files · 1 file+40 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • Fixes: https://github.com/charmbracelet/bubbletea/issues/1404

Diff stats

1 file+40 added−0 removed

  • other:+40 added−0 removed

1 file+40 added−0 removed

modified:key_windows.go+40 added
274 unmodified lines
275 case coninput.VK_NEXT:276 return KeyPgDown277 case coninput.VK_DELETE:278 return KeyDelete279 case coninput.VK_F1:280 return KeyF1281 case coninput.VK_F2:282 return KeyF2283 case coninput.VK_F3:284 return KeyF3285 case coninput.VK_F4:286 return KeyF4287 case coninput.VK_F5:288 return KeyF5289 case coninput.VK_F6:290 return KeyF6291 case coninput.VK_F7:292 return KeyF7293 case coninput.VK_F8:294 return KeyF8295 case coninput.VK_F9:296 return KeyF9297 case coninput.VK_F10:298 return KeyF10299 case coninput.VK_F11:300 return KeyF11301 case coninput.VK_F12:302 return KeyF12303 case coninput.VK_F13:304 return KeyF13305 case coninput.VK_F14:306 return KeyF14307 case coninput.VK_F15:308 return KeyF15309 case coninput.VK_F16:310 return KeyF16311 case coninput.VK_F17:312 return KeyF17313 case coninput.VK_F18:314 return KeyF18315 case coninput.VK_F19:316 return KeyF19317 case coninput.VK_F20:318 return KeyF20319 default:320 switch {321 case e.ControlKeyState.Contains(coninput.LEFT_CTRL_PRESSED) && e.ControlKeyState.Contains(coninput.RIGHT_ALT_PRESSED):322 // AltGr is pressed, then it's a rune.
78 unmodified lines