zorldo

Goofing around with Ebiten
git clone git://bsandro.tech/zorldo
Log | Files | Refs | README

keys.go (20809B)


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