code_string.go (2988B)
1 // Code generated by "stringer -type=Code"; DO NOT EDIT 2 3 package key 4 5 import "fmt" 6 7 const ( 8 _Code_name_0 = "CodeUnknown" 9 _Code_name_1 = "CodeACodeBCodeCCodeDCodeECodeFCodeGCodeHCodeICodeJCodeKCodeLCodeMCodeNCodeOCodePCodeQCodeRCodeSCodeTCodeUCodeVCodeWCodeXCodeYCodeZCode1Code2Code3Code4Code5Code6Code7Code8Code9Code0CodeReturnEnterCodeEscapeCodeDeleteBackspaceCodeTabCodeSpacebarCodeHyphenMinusCodeEqualSignCodeLeftSquareBracketCodeRightSquareBracketCodeBackslash" 10 _Code_name_2 = "CodeSemicolonCodeApostropheCodeGraveAccentCodeCommaCodeFullStopCodeSlashCodeCapsLockCodeF1CodeF2CodeF3CodeF4CodeF5CodeF6CodeF7CodeF8CodeF9CodeF10CodeF11CodeF12" 11 _Code_name_3 = "CodePauseCodeInsertCodeHomeCodePageUpCodeDeleteForwardCodeEndCodePageDownCodeRightArrowCodeLeftArrowCodeDownArrowCodeUpArrowCodeKeypadNumLockCodeKeypadSlashCodeKeypadAsteriskCodeKeypadHyphenMinusCodeKeypadPlusSignCodeKeypadEnterCodeKeypad1CodeKeypad2CodeKeypad3CodeKeypad4CodeKeypad5CodeKeypad6CodeKeypad7CodeKeypad8CodeKeypad9CodeKeypad0CodeKeypadFullStop" 12 _Code_name_4 = "CodeKeypadEqualSignCodeF13CodeF14CodeF15CodeF16CodeF17CodeF18CodeF19CodeF20CodeF21CodeF22CodeF23CodeF24" 13 _Code_name_5 = "CodeHelp" 14 _Code_name_6 = "CodeMuteCodeVolumeUpCodeVolumeDown" 15 _Code_name_7 = "CodeLeftControlCodeLeftShiftCodeLeftAltCodeLeftGUICodeRightControlCodeRightShiftCodeRightAltCodeRightGUI" 16 _Code_name_8 = "CodeCompose" 17 ) 18 19 var ( 20 _Code_index_0 = [...]uint8{0, 11} 21 _Code_index_1 = [...]uint16{0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 105, 110, 115, 120, 125, 130, 135, 140, 145, 150, 155, 160, 165, 170, 175, 180, 195, 205, 224, 231, 243, 258, 271, 292, 314, 327} 22 _Code_index_2 = [...]uint8{0, 13, 27, 42, 51, 63, 72, 84, 90, 96, 102, 108, 114, 120, 126, 132, 138, 145, 152, 159} 23 _Code_index_3 = [...]uint16{0, 9, 19, 27, 37, 54, 61, 73, 87, 100, 113, 124, 141, 156, 174, 195, 213, 228, 239, 250, 261, 272, 283, 294, 305, 316, 327, 338, 356} 24 _Code_index_4 = [...]uint8{0, 19, 26, 33, 40, 47, 54, 61, 68, 75, 82, 89, 96, 103} 25 _Code_index_5 = [...]uint8{0, 8} 26 _Code_index_6 = [...]uint8{0, 8, 20, 34} 27 _Code_index_7 = [...]uint8{0, 15, 28, 39, 50, 66, 80, 92, 104} 28 _Code_index_8 = [...]uint8{0, 11} 29 ) 30 31 func (i Code) String() string { 32 switch { 33 case i == 0: 34 return _Code_name_0 35 case 4 <= i && i <= 49: 36 i -= 4 37 return _Code_name_1[_Code_index_1[i]:_Code_index_1[i+1]] 38 case 51 <= i && i <= 69: 39 i -= 51 40 return _Code_name_2[_Code_index_2[i]:_Code_index_2[i+1]] 41 case 72 <= i && i <= 99: 42 i -= 72 43 return _Code_name_3[_Code_index_3[i]:_Code_index_3[i+1]] 44 case 103 <= i && i <= 115: 45 i -= 103 46 return _Code_name_4[_Code_index_4[i]:_Code_index_4[i+1]] 47 case i == 117: 48 return _Code_name_5 49 case 127 <= i && i <= 129: 50 i -= 127 51 return _Code_name_6[_Code_index_6[i]:_Code_index_6[i+1]] 52 case 224 <= i && i <= 231: 53 i -= 224 54 return _Code_name_7[_Code_index_7[i]:_Code_index_7[i+1]] 55 case i == 65536: 56 return _Code_name_8 57 default: 58 return fmt.Sprintf("Code(%d)", i) 59 } 60 }