keys.go 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927
  1. // Copyright 2013 The Ebiten Authors
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. // Code generated by genkeys.go using 'go generate'. DO NOT EDIT.
  15. package ebiten
  16. import (
  17. "strings"
  18. "github.com/hajimehoshi/ebiten/v2/internal/driver"
  19. )
  20. // A Key represents a keyboard key.
  21. // These keys represent pysical keys of US keyboard.
  22. // For example, KeyQ represents Q key on US keyboards and ' (quote) key on Dvorak keyboards.
  23. type Key int
  24. // Keys.
  25. const (
  26. KeyA Key = Key(driver.KeyA)
  27. KeyB Key = Key(driver.KeyB)
  28. KeyC Key = Key(driver.KeyC)
  29. KeyD Key = Key(driver.KeyD)
  30. KeyE Key = Key(driver.KeyE)
  31. KeyF Key = Key(driver.KeyF)
  32. KeyG Key = Key(driver.KeyG)
  33. KeyH Key = Key(driver.KeyH)
  34. KeyI Key = Key(driver.KeyI)
  35. KeyJ Key = Key(driver.KeyJ)
  36. KeyK Key = Key(driver.KeyK)
  37. KeyL Key = Key(driver.KeyL)
  38. KeyM Key = Key(driver.KeyM)
  39. KeyN Key = Key(driver.KeyN)
  40. KeyO Key = Key(driver.KeyO)
  41. KeyP Key = Key(driver.KeyP)
  42. KeyQ Key = Key(driver.KeyQ)
  43. KeyR Key = Key(driver.KeyR)
  44. KeyS Key = Key(driver.KeyS)
  45. KeyT Key = Key(driver.KeyT)
  46. KeyU Key = Key(driver.KeyU)
  47. KeyV Key = Key(driver.KeyV)
  48. KeyW Key = Key(driver.KeyW)
  49. KeyX Key = Key(driver.KeyX)
  50. KeyY Key = Key(driver.KeyY)
  51. KeyZ Key = Key(driver.KeyZ)
  52. KeyAltLeft Key = Key(driver.KeyAltLeft)
  53. KeyAltRight Key = Key(driver.KeyAltRight)
  54. KeyArrowDown Key = Key(driver.KeyArrowDown)
  55. KeyArrowLeft Key = Key(driver.KeyArrowLeft)
  56. KeyArrowRight Key = Key(driver.KeyArrowRight)
  57. KeyArrowUp Key = Key(driver.KeyArrowUp)
  58. KeyBackquote Key = Key(driver.KeyBackquote)
  59. KeyBackslash Key = Key(driver.KeyBackslash)
  60. KeyBackspace Key = Key(driver.KeyBackspace)
  61. KeyBracketLeft Key = Key(driver.KeyBracketLeft)
  62. KeyBracketRight Key = Key(driver.KeyBracketRight)
  63. KeyCapsLock Key = Key(driver.KeyCapsLock)
  64. KeyComma Key = Key(driver.KeyComma)
  65. KeyContextMenu Key = Key(driver.KeyContextMenu)
  66. KeyControlLeft Key = Key(driver.KeyControlLeft)
  67. KeyControlRight Key = Key(driver.KeyControlRight)
  68. KeyDelete Key = Key(driver.KeyDelete)
  69. KeyDigit0 Key = Key(driver.KeyDigit0)
  70. KeyDigit1 Key = Key(driver.KeyDigit1)
  71. KeyDigit2 Key = Key(driver.KeyDigit2)
  72. KeyDigit3 Key = Key(driver.KeyDigit3)
  73. KeyDigit4 Key = Key(driver.KeyDigit4)
  74. KeyDigit5 Key = Key(driver.KeyDigit5)
  75. KeyDigit6 Key = Key(driver.KeyDigit6)
  76. KeyDigit7 Key = Key(driver.KeyDigit7)
  77. KeyDigit8 Key = Key(driver.KeyDigit8)
  78. KeyDigit9 Key = Key(driver.KeyDigit9)
  79. KeyEnd Key = Key(driver.KeyEnd)
  80. KeyEnter Key = Key(driver.KeyEnter)
  81. KeyEqual Key = Key(driver.KeyEqual)
  82. KeyEscape Key = Key(driver.KeyEscape)
  83. KeyF1 Key = Key(driver.KeyF1)
  84. KeyF2 Key = Key(driver.KeyF2)
  85. KeyF3 Key = Key(driver.KeyF3)
  86. KeyF4 Key = Key(driver.KeyF4)
  87. KeyF5 Key = Key(driver.KeyF5)
  88. KeyF6 Key = Key(driver.KeyF6)
  89. KeyF7 Key = Key(driver.KeyF7)
  90. KeyF8 Key = Key(driver.KeyF8)
  91. KeyF9 Key = Key(driver.KeyF9)
  92. KeyF10 Key = Key(driver.KeyF10)
  93. KeyF11 Key = Key(driver.KeyF11)
  94. KeyF12 Key = Key(driver.KeyF12)
  95. KeyHome Key = Key(driver.KeyHome)
  96. KeyInsert Key = Key(driver.KeyInsert)
  97. KeyMetaLeft Key = Key(driver.KeyMetaLeft)
  98. KeyMetaRight Key = Key(driver.KeyMetaRight)
  99. KeyMinus Key = Key(driver.KeyMinus)
  100. KeyNumLock Key = Key(driver.KeyNumLock)
  101. KeyNumpad0 Key = Key(driver.KeyNumpad0)
  102. KeyNumpad1 Key = Key(driver.KeyNumpad1)
  103. KeyNumpad2 Key = Key(driver.KeyNumpad2)
  104. KeyNumpad3 Key = Key(driver.KeyNumpad3)
  105. KeyNumpad4 Key = Key(driver.KeyNumpad4)
  106. KeyNumpad5 Key = Key(driver.KeyNumpad5)
  107. KeyNumpad6 Key = Key(driver.KeyNumpad6)
  108. KeyNumpad7 Key = Key(driver.KeyNumpad7)
  109. KeyNumpad8 Key = Key(driver.KeyNumpad8)
  110. KeyNumpad9 Key = Key(driver.KeyNumpad9)
  111. KeyNumpadAdd Key = Key(driver.KeyNumpadAdd)
  112. KeyNumpadDecimal Key = Key(driver.KeyNumpadDecimal)
  113. KeyNumpadDivide Key = Key(driver.KeyNumpadDivide)
  114. KeyNumpadEnter Key = Key(driver.KeyNumpadEnter)
  115. KeyNumpadEqual Key = Key(driver.KeyNumpadEqual)
  116. KeyNumpadMultiply Key = Key(driver.KeyNumpadMultiply)
  117. KeyNumpadSubtract Key = Key(driver.KeyNumpadSubtract)
  118. KeyPageDown Key = Key(driver.KeyPageDown)
  119. KeyPageUp Key = Key(driver.KeyPageUp)
  120. KeyPause Key = Key(driver.KeyPause)
  121. KeyPeriod Key = Key(driver.KeyPeriod)
  122. KeyPrintScreen Key = Key(driver.KeyPrintScreen)
  123. KeyQuote Key = Key(driver.KeyQuote)
  124. KeyScrollLock Key = Key(driver.KeyScrollLock)
  125. KeySemicolon Key = Key(driver.KeySemicolon)
  126. KeyShiftLeft Key = Key(driver.KeyShiftLeft)
  127. KeyShiftRight Key = Key(driver.KeyShiftRight)
  128. KeySlash Key = Key(driver.KeySlash)
  129. KeySpace Key = Key(driver.KeySpace)
  130. KeyTab Key = Key(driver.KeyTab)
  131. KeyAlt Key = Key(driver.KeyReserved0)
  132. KeyControl Key = Key(driver.KeyReserved1)
  133. KeyShift Key = Key(driver.KeyReserved2)
  134. KeyMeta Key = Key(driver.KeyReserved3)
  135. KeyMax Key = KeyMeta
  136. // Keys for backward compatibility.
  137. // Deprecated: as of 2.1.0.
  138. Key0 Key = Key(driver.KeyDigit0)
  139. Key1 Key = Key(driver.KeyDigit1)
  140. Key2 Key = Key(driver.KeyDigit2)
  141. Key3 Key = Key(driver.KeyDigit3)
  142. Key4 Key = Key(driver.KeyDigit4)
  143. Key5 Key = Key(driver.KeyDigit5)
  144. Key6 Key = Key(driver.KeyDigit6)
  145. Key7 Key = Key(driver.KeyDigit7)
  146. Key8 Key = Key(driver.KeyDigit8)
  147. Key9 Key = Key(driver.KeyDigit9)
  148. KeyApostrophe Key = Key(driver.KeyQuote)
  149. KeyDown Key = Key(driver.KeyArrowDown)
  150. KeyGraveAccent Key = Key(driver.KeyBackquote)
  151. KeyKP0 Key = Key(driver.KeyNumpad0)
  152. KeyKP1 Key = Key(driver.KeyNumpad1)
  153. KeyKP2 Key = Key(driver.KeyNumpad2)
  154. KeyKP3 Key = Key(driver.KeyNumpad3)
  155. KeyKP4 Key = Key(driver.KeyNumpad4)
  156. KeyKP5 Key = Key(driver.KeyNumpad5)
  157. KeyKP6 Key = Key(driver.KeyNumpad6)
  158. KeyKP7 Key = Key(driver.KeyNumpad7)
  159. KeyKP8 Key = Key(driver.KeyNumpad8)
  160. KeyKP9 Key = Key(driver.KeyNumpad9)
  161. KeyKPDecimal Key = Key(driver.KeyNumpadDecimal)
  162. KeyKPDivide Key = Key(driver.KeyNumpadDivide)
  163. KeyKPEnter Key = Key(driver.KeyNumpadEnter)
  164. KeyKPEqual Key = Key(driver.KeyNumpadEqual)
  165. KeyKPMultiply Key = Key(driver.KeyNumpadMultiply)
  166. KeyKPSubtract Key = Key(driver.KeyNumpadSubtract)
  167. KeyLeft Key = Key(driver.KeyArrowLeft)
  168. KeyLeftBracket Key = Key(driver.KeyBracketLeft)
  169. KeyMenu Key = Key(driver.KeyContextMenu)
  170. KeyRight Key = Key(driver.KeyArrowRight)
  171. KeyRightBracket Key = Key(driver.KeyBracketRight)
  172. KeyUp Key = Key(driver.KeyArrowUp)
  173. )
  174. func (k Key) isValid() bool {
  175. switch k {
  176. case KeyA:
  177. return true
  178. case KeyB:
  179. return true
  180. case KeyC:
  181. return true
  182. case KeyD:
  183. return true
  184. case KeyE:
  185. return true
  186. case KeyF:
  187. return true
  188. case KeyG:
  189. return true
  190. case KeyH:
  191. return true
  192. case KeyI:
  193. return true
  194. case KeyJ:
  195. return true
  196. case KeyK:
  197. return true
  198. case KeyL:
  199. return true
  200. case KeyM:
  201. return true
  202. case KeyN:
  203. return true
  204. case KeyO:
  205. return true
  206. case KeyP:
  207. return true
  208. case KeyQ:
  209. return true
  210. case KeyR:
  211. return true
  212. case KeyS:
  213. return true
  214. case KeyT:
  215. return true
  216. case KeyU:
  217. return true
  218. case KeyV:
  219. return true
  220. case KeyW:
  221. return true
  222. case KeyX:
  223. return true
  224. case KeyY:
  225. return true
  226. case KeyZ:
  227. return true
  228. case KeyAlt:
  229. return true
  230. case KeyAltLeft:
  231. return true
  232. case KeyAltRight:
  233. return true
  234. case KeyArrowDown:
  235. return true
  236. case KeyArrowLeft:
  237. return true
  238. case KeyArrowRight:
  239. return true
  240. case KeyArrowUp:
  241. return true
  242. case KeyBackquote:
  243. return true
  244. case KeyBackslash:
  245. return true
  246. case KeyBackspace:
  247. return true
  248. case KeyBracketLeft:
  249. return true
  250. case KeyBracketRight:
  251. return true
  252. case KeyCapsLock:
  253. return true
  254. case KeyComma:
  255. return true
  256. case KeyContextMenu:
  257. return true
  258. case KeyControl:
  259. return true
  260. case KeyControlLeft:
  261. return true
  262. case KeyControlRight:
  263. return true
  264. case KeyDelete:
  265. return true
  266. case KeyDigit0:
  267. return true
  268. case KeyDigit1:
  269. return true
  270. case KeyDigit2:
  271. return true
  272. case KeyDigit3:
  273. return true
  274. case KeyDigit4:
  275. return true
  276. case KeyDigit5:
  277. return true
  278. case KeyDigit6:
  279. return true
  280. case KeyDigit7:
  281. return true
  282. case KeyDigit8:
  283. return true
  284. case KeyDigit9:
  285. return true
  286. case KeyEnd:
  287. return true
  288. case KeyEnter:
  289. return true
  290. case KeyEqual:
  291. return true
  292. case KeyEscape:
  293. return true
  294. case KeyF1:
  295. return true
  296. case KeyF2:
  297. return true
  298. case KeyF3:
  299. return true
  300. case KeyF4:
  301. return true
  302. case KeyF5:
  303. return true
  304. case KeyF6:
  305. return true
  306. case KeyF7:
  307. return true
  308. case KeyF8:
  309. return true
  310. case KeyF9:
  311. return true
  312. case KeyF10:
  313. return true
  314. case KeyF11:
  315. return true
  316. case KeyF12:
  317. return true
  318. case KeyHome:
  319. return true
  320. case KeyInsert:
  321. return true
  322. case KeyMeta:
  323. return true
  324. case KeyMetaLeft:
  325. return true
  326. case KeyMetaRight:
  327. return true
  328. case KeyMinus:
  329. return true
  330. case KeyNumLock:
  331. return true
  332. case KeyNumpad0:
  333. return true
  334. case KeyNumpad1:
  335. return true
  336. case KeyNumpad2:
  337. return true
  338. case KeyNumpad3:
  339. return true
  340. case KeyNumpad4:
  341. return true
  342. case KeyNumpad5:
  343. return true
  344. case KeyNumpad6:
  345. return true
  346. case KeyNumpad7:
  347. return true
  348. case KeyNumpad8:
  349. return true
  350. case KeyNumpad9:
  351. return true
  352. case KeyNumpadAdd:
  353. return true
  354. case KeyNumpadDecimal:
  355. return true
  356. case KeyNumpadDivide:
  357. return true
  358. case KeyNumpadEnter:
  359. return true
  360. case KeyNumpadEqual:
  361. return true
  362. case KeyNumpadMultiply:
  363. return true
  364. case KeyNumpadSubtract:
  365. return true
  366. case KeyPageDown:
  367. return true
  368. case KeyPageUp:
  369. return true
  370. case KeyPause:
  371. return true
  372. case KeyPeriod:
  373. return true
  374. case KeyPrintScreen:
  375. return true
  376. case KeyQuote:
  377. return true
  378. case KeyScrollLock:
  379. return true
  380. case KeySemicolon:
  381. return true
  382. case KeyShift:
  383. return true
  384. case KeyShiftLeft:
  385. return true
  386. case KeyShiftRight:
  387. return true
  388. case KeySlash:
  389. return true
  390. case KeySpace:
  391. return true
  392. case KeyTab:
  393. return true
  394. default:
  395. return false
  396. }
  397. }
  398. // String returns a string representing the key.
  399. //
  400. // If k is an undefined key, String returns an empty string.
  401. func (k Key) String() string {
  402. switch k {
  403. case KeyA:
  404. return "A"
  405. case KeyB:
  406. return "B"
  407. case KeyC:
  408. return "C"
  409. case KeyD:
  410. return "D"
  411. case KeyE:
  412. return "E"
  413. case KeyF:
  414. return "F"
  415. case KeyG:
  416. return "G"
  417. case KeyH:
  418. return "H"
  419. case KeyI:
  420. return "I"
  421. case KeyJ:
  422. return "J"
  423. case KeyK:
  424. return "K"
  425. case KeyL:
  426. return "L"
  427. case KeyM:
  428. return "M"
  429. case KeyN:
  430. return "N"
  431. case KeyO:
  432. return "O"
  433. case KeyP:
  434. return "P"
  435. case KeyQ:
  436. return "Q"
  437. case KeyR:
  438. return "R"
  439. case KeyS:
  440. return "S"
  441. case KeyT:
  442. return "T"
  443. case KeyU:
  444. return "U"
  445. case KeyV:
  446. return "V"
  447. case KeyW:
  448. return "W"
  449. case KeyX:
  450. return "X"
  451. case KeyY:
  452. return "Y"
  453. case KeyZ:
  454. return "Z"
  455. case KeyAlt:
  456. return "Alt"
  457. case KeyAltLeft:
  458. return "AltLeft"
  459. case KeyAltRight:
  460. return "AltRight"
  461. case KeyArrowDown:
  462. return "ArrowDown"
  463. case KeyArrowLeft:
  464. return "ArrowLeft"
  465. case KeyArrowRight:
  466. return "ArrowRight"
  467. case KeyArrowUp:
  468. return "ArrowUp"
  469. case KeyBackquote:
  470. return "Backquote"
  471. case KeyBackslash:
  472. return "Backslash"
  473. case KeyBackspace:
  474. return "Backspace"
  475. case KeyBracketLeft:
  476. return "BracketLeft"
  477. case KeyBracketRight:
  478. return "BracketRight"
  479. case KeyCapsLock:
  480. return "CapsLock"
  481. case KeyComma:
  482. return "Comma"
  483. case KeyContextMenu:
  484. return "ContextMenu"
  485. case KeyControl:
  486. return "Control"
  487. case KeyControlLeft:
  488. return "ControlLeft"
  489. case KeyControlRight:
  490. return "ControlRight"
  491. case KeyDelete:
  492. return "Delete"
  493. case KeyDigit0:
  494. return "Digit0"
  495. case KeyDigit1:
  496. return "Digit1"
  497. case KeyDigit2:
  498. return "Digit2"
  499. case KeyDigit3:
  500. return "Digit3"
  501. case KeyDigit4:
  502. return "Digit4"
  503. case KeyDigit5:
  504. return "Digit5"
  505. case KeyDigit6:
  506. return "Digit6"
  507. case KeyDigit7:
  508. return "Digit7"
  509. case KeyDigit8:
  510. return "Digit8"
  511. case KeyDigit9:
  512. return "Digit9"
  513. case KeyEnd:
  514. return "End"
  515. case KeyEnter:
  516. return "Enter"
  517. case KeyEqual:
  518. return "Equal"
  519. case KeyEscape:
  520. return "Escape"
  521. case KeyF1:
  522. return "F1"
  523. case KeyF2:
  524. return "F2"
  525. case KeyF3:
  526. return "F3"
  527. case KeyF4:
  528. return "F4"
  529. case KeyF5:
  530. return "F5"
  531. case KeyF6:
  532. return "F6"
  533. case KeyF7:
  534. return "F7"
  535. case KeyF8:
  536. return "F8"
  537. case KeyF9:
  538. return "F9"
  539. case KeyF10:
  540. return "F10"
  541. case KeyF11:
  542. return "F11"
  543. case KeyF12:
  544. return "F12"
  545. case KeyHome:
  546. return "Home"
  547. case KeyInsert:
  548. return "Insert"
  549. case KeyMeta:
  550. return "Meta"
  551. case KeyMetaLeft:
  552. return "MetaLeft"
  553. case KeyMetaRight:
  554. return "MetaRight"
  555. case KeyMinus:
  556. return "Minus"
  557. case KeyNumLock:
  558. return "NumLock"
  559. case KeyNumpad0:
  560. return "Numpad0"
  561. case KeyNumpad1:
  562. return "Numpad1"
  563. case KeyNumpad2:
  564. return "Numpad2"
  565. case KeyNumpad3:
  566. return "Numpad3"
  567. case KeyNumpad4:
  568. return "Numpad4"
  569. case KeyNumpad5:
  570. return "Numpad5"
  571. case KeyNumpad6:
  572. return "Numpad6"
  573. case KeyNumpad7:
  574. return "Numpad7"
  575. case KeyNumpad8:
  576. return "Numpad8"
  577. case KeyNumpad9:
  578. return "Numpad9"
  579. case KeyNumpadAdd:
  580. return "NumpadAdd"
  581. case KeyNumpadDecimal:
  582. return "NumpadDecimal"
  583. case KeyNumpadDivide:
  584. return "NumpadDivide"
  585. case KeyNumpadEnter:
  586. return "NumpadEnter"
  587. case KeyNumpadEqual:
  588. return "NumpadEqual"
  589. case KeyNumpadMultiply:
  590. return "NumpadMultiply"
  591. case KeyNumpadSubtract:
  592. return "NumpadSubtract"
  593. case KeyPageDown:
  594. return "PageDown"
  595. case KeyPageUp:
  596. return "PageUp"
  597. case KeyPause:
  598. return "Pause"
  599. case KeyPeriod:
  600. return "Period"
  601. case KeyPrintScreen:
  602. return "PrintScreen"
  603. case KeyQuote:
  604. return "Quote"
  605. case KeyScrollLock:
  606. return "ScrollLock"
  607. case KeySemicolon:
  608. return "Semicolon"
  609. case KeyShift:
  610. return "Shift"
  611. case KeyShiftLeft:
  612. return "ShiftLeft"
  613. case KeyShiftRight:
  614. return "ShiftRight"
  615. case KeySlash:
  616. return "Slash"
  617. case KeySpace:
  618. return "Space"
  619. case KeyTab:
  620. return "Tab"
  621. }
  622. return ""
  623. }
  624. func keyNameToKeyCode(name string) (Key, bool) {
  625. switch strings.ToLower(name) {
  626. case "0":
  627. return Key0, true
  628. case "1":
  629. return Key1, true
  630. case "2":
  631. return Key2, true
  632. case "3":
  633. return Key3, true
  634. case "4":
  635. return Key4, true
  636. case "5":
  637. return Key5, true
  638. case "6":
  639. return Key6, true
  640. case "7":
  641. return Key7, true
  642. case "8":
  643. return Key8, true
  644. case "9":
  645. return Key9, true
  646. case "a":
  647. return KeyA, true
  648. case "b":
  649. return KeyB, true
  650. case "c":
  651. return KeyC, true
  652. case "d":
  653. return KeyD, true
  654. case "e":
  655. return KeyE, true
  656. case "f":
  657. return KeyF, true
  658. case "g":
  659. return KeyG, true
  660. case "h":
  661. return KeyH, true
  662. case "i":
  663. return KeyI, true
  664. case "j":
  665. return KeyJ, true
  666. case "k":
  667. return KeyK, true
  668. case "l":
  669. return KeyL, true
  670. case "m":
  671. return KeyM, true
  672. case "n":
  673. return KeyN, true
  674. case "o":
  675. return KeyO, true
  676. case "p":
  677. return KeyP, true
  678. case "q":
  679. return KeyQ, true
  680. case "r":
  681. return KeyR, true
  682. case "s":
  683. return KeyS, true
  684. case "t":
  685. return KeyT, true
  686. case "u":
  687. return KeyU, true
  688. case "v":
  689. return KeyV, true
  690. case "w":
  691. return KeyW, true
  692. case "x":
  693. return KeyX, true
  694. case "y":
  695. return KeyY, true
  696. case "z":
  697. return KeyZ, true
  698. case "alt":
  699. return KeyAlt, true
  700. case "altleft":
  701. return KeyAltLeft, true
  702. case "altright":
  703. return KeyAltRight, true
  704. case "apostrophe":
  705. return KeyApostrophe, true
  706. case "arrowdown":
  707. return KeyArrowDown, true
  708. case "arrowleft":
  709. return KeyArrowLeft, true
  710. case "arrowright":
  711. return KeyArrowRight, true
  712. case "arrowup":
  713. return KeyArrowUp, true
  714. case "backquote":
  715. return KeyBackquote, true
  716. case "backslash":
  717. return KeyBackslash, true
  718. case "backspace":
  719. return KeyBackspace, true
  720. case "bracketleft":
  721. return KeyBracketLeft, true
  722. case "bracketright":
  723. return KeyBracketRight, true
  724. case "capslock":
  725. return KeyCapsLock, true
  726. case "comma":
  727. return KeyComma, true
  728. case "contextmenu":
  729. return KeyContextMenu, true
  730. case "control":
  731. return KeyControl, true
  732. case "controlleft":
  733. return KeyControlLeft, true
  734. case "controlright":
  735. return KeyControlRight, true
  736. case "delete":
  737. return KeyDelete, true
  738. case "digit0":
  739. return KeyDigit0, true
  740. case "digit1":
  741. return KeyDigit1, true
  742. case "digit2":
  743. return KeyDigit2, true
  744. case "digit3":
  745. return KeyDigit3, true
  746. case "digit4":
  747. return KeyDigit4, true
  748. case "digit5":
  749. return KeyDigit5, true
  750. case "digit6":
  751. return KeyDigit6, true
  752. case "digit7":
  753. return KeyDigit7, true
  754. case "digit8":
  755. return KeyDigit8, true
  756. case "digit9":
  757. return KeyDigit9, true
  758. case "down":
  759. return KeyDown, true
  760. case "end":
  761. return KeyEnd, true
  762. case "enter":
  763. return KeyEnter, true
  764. case "equal":
  765. return KeyEqual, true
  766. case "escape":
  767. return KeyEscape, true
  768. case "f1":
  769. return KeyF1, true
  770. case "f2":
  771. return KeyF2, true
  772. case "f3":
  773. return KeyF3, true
  774. case "f4":
  775. return KeyF4, true
  776. case "f5":
  777. return KeyF5, true
  778. case "f6":
  779. return KeyF6, true
  780. case "f7":
  781. return KeyF7, true
  782. case "f8":
  783. return KeyF8, true
  784. case "f9":
  785. return KeyF9, true
  786. case "f10":
  787. return KeyF10, true
  788. case "f11":
  789. return KeyF11, true
  790. case "f12":
  791. return KeyF12, true
  792. case "graveaccent":
  793. return KeyGraveAccent, true
  794. case "home":
  795. return KeyHome, true
  796. case "insert":
  797. return KeyInsert, true
  798. case "kp0":
  799. return KeyKP0, true
  800. case "kp1":
  801. return KeyKP1, true
  802. case "kp2":
  803. return KeyKP2, true
  804. case "kp3":
  805. return KeyKP3, true
  806. case "kp4":
  807. return KeyKP4, true
  808. case "kp5":
  809. return KeyKP5, true
  810. case "kp6":
  811. return KeyKP6, true
  812. case "kp7":
  813. return KeyKP7, true
  814. case "kp8":
  815. return KeyKP8, true
  816. case "kp9":
  817. return KeyKP9, true
  818. case "kpdecimal":
  819. return KeyKPDecimal, true
  820. case "kpdivide":
  821. return KeyKPDivide, true
  822. case "kpenter":
  823. return KeyKPEnter, true
  824. case "kpequal":
  825. return KeyKPEqual, true
  826. case "kpmultiply":
  827. return KeyKPMultiply, true
  828. case "kpsubtract":
  829. return KeyKPSubtract, true
  830. case "left":
  831. return KeyLeft, true
  832. case "leftbracket":
  833. return KeyLeftBracket, true
  834. case "menu":
  835. return KeyMenu, true
  836. case "meta":
  837. return KeyMeta, true
  838. case "metaleft":
  839. return KeyMetaLeft, true
  840. case "metaright":
  841. return KeyMetaRight, true
  842. case "minus":
  843. return KeyMinus, true
  844. case "numlock":
  845. return KeyNumLock, true
  846. case "numpad0":
  847. return KeyNumpad0, true
  848. case "numpad1":
  849. return KeyNumpad1, true
  850. case "numpad2":
  851. return KeyNumpad2, true
  852. case "numpad3":
  853. return KeyNumpad3, true
  854. case "numpad4":
  855. return KeyNumpad4, true
  856. case "numpad5":
  857. return KeyNumpad5, true
  858. case "numpad6":
  859. return KeyNumpad6, true
  860. case "numpad7":
  861. return KeyNumpad7, true
  862. case "numpad8":
  863. return KeyNumpad8, true
  864. case "numpad9":
  865. return KeyNumpad9, true
  866. case "numpadadd":
  867. return KeyNumpadAdd, true
  868. case "numpaddecimal":
  869. return KeyNumpadDecimal, true
  870. case "numpaddivide":
  871. return KeyNumpadDivide, true
  872. case "numpadenter":
  873. return KeyNumpadEnter, true
  874. case "numpadequal":
  875. return KeyNumpadEqual, true
  876. case "numpadmultiply":
  877. return KeyNumpadMultiply, true
  878. case "numpadsubtract":
  879. return KeyNumpadSubtract, true
  880. case "pagedown":
  881. return KeyPageDown, true
  882. case "pageup":
  883. return KeyPageUp, true
  884. case "pause":
  885. return KeyPause, true
  886. case "period":
  887. return KeyPeriod, true
  888. case "printscreen":
  889. return KeyPrintScreen, true
  890. case "quote":
  891. return KeyQuote, true
  892. case "right":
  893. return KeyRight, true
  894. case "rightbracket":
  895. return KeyRightBracket, true
  896. case "scrolllock":
  897. return KeyScrollLock, true
  898. case "semicolon":
  899. return KeySemicolon, true
  900. case "shift":
  901. return KeyShift, true
  902. case "shiftleft":
  903. return KeyShiftLeft, true
  904. case "shiftright":
  905. return KeyShiftRight, true
  906. case "slash":
  907. return KeySlash, true
  908. case "space":
  909. return KeySpace, true
  910. case "tab":
  911. return KeyTab, true
  912. case "up":
  913. return KeyUp, true
  914. }
  915. return 0, false
  916. }