event_to_string_linux.go 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806
  1. package linux
  2. import "fmt"
  3. func EvToString(e uint) string {
  4. switch e {
  5. case EV_SYN: return "EV_SYN"
  6. case EV_KEY: return "EV_KEY"
  7. case EV_REL: return "EV_REL"
  8. case EV_ABS: return "EV_ABS"
  9. case EV_MSC: return "EV_MSC"
  10. case EV_SW : return "EV_SW"
  11. case EV_LED: return "EV_LED"
  12. case EV_SND: return "EV_SND"
  13. case EV_REP: return "EV_REP"
  14. case EV_FF : return "EV_FF"
  15. case EV_PWR: return "EV_PWR"
  16. case EV_FF_STATUS: return "EV_FF_STATUS"
  17. case EV_MAX: return "EV_MAX"
  18. case EV_CNT: return "EV_CNT"
  19. default: return fmt.Sprintf("Unknown event %d", e)
  20. }
  21. }
  22. func AbsToString(e uint) string {
  23. switch e {
  24. case ABS_X: return "ABS_X"
  25. case ABS_Y: return "ABS_Y"
  26. case ABS_Z: return "ABS_Z"
  27. case ABS_RX: return "ABS_RX"
  28. case ABS_RY: return "ABS_RY"
  29. case ABS_RZ: return "ABS_RZ"
  30. case ABS_THROTTLE: return "ABS_THROTTLE"
  31. case ABS_RUDDER: return "ABS_RUDDER"
  32. case ABS_WHEEL: return "ABS_WHEEL"
  33. case ABS_GAS: return "ABS_GAS"
  34. case ABS_BRAKE: return "ABS_BRAKE"
  35. case ABS_HAT0X: return "ABS_HAT0X"
  36. case ABS_HAT0Y: return "ABS_HAT0Y"
  37. case ABS_HAT1X: return "ABS_HAT1X"
  38. case ABS_HAT1Y: return "ABS_HAT1Y"
  39. case ABS_HAT2X: return "ABS_HAT2X"
  40. case ABS_HAT2Y: return "ABS_HAT2Y"
  41. case ABS_HAT3X: return "ABS_HAT3X"
  42. case ABS_HAT3Y: return "ABS_HAT3Y"
  43. case ABS_PRESSURE: return "ABS_PRESSURE"
  44. case ABS_DISTANCE: return "ABS_DISTANCE"
  45. case ABS_TILT_X: return "ABS_TILT_X"
  46. case ABS_TILT_Y: return "ABS_TILT_Y"
  47. case ABS_TOOL_WIDTH: return "ABS_TOOL_WIDTH"
  48. case ABS_VOLUME: return "ABS_VOLUME"
  49. case ABS_MISC: return "ABS_MISC"
  50. case ABS_MT_SLOT: return "ABS_MT_SLOT"
  51. case ABS_MT_TOUCH_MAJOR: return "ABS_MT_TOUCH_MAJOR"
  52. case ABS_MT_TOUCH_MINOR: return "ABS_MT_TOUCH_MINOR"
  53. case ABS_MT_WIDTH_MAJOR: return "ABS_MT_WIDTH_MAJOR"
  54. case ABS_MT_WIDTH_MINOR: return "ABS_MT_WIDTH_MINOR"
  55. case ABS_MT_ORIENTATION: return "ABS_MT_ORIENTATION"
  56. case ABS_MT_POSITION_X: return "ABS_MT_POSITION_X"
  57. case ABS_MT_POSITION_Y: return "ABS_MT_POSITION_Y"
  58. case ABS_MT_TOOL_TYPE: return "ABS_MT_TOOL_TYPE"
  59. case ABS_MT_BLOB_ID: return "ABS_MT_BLOB_ID"
  60. case ABS_MT_TRACKING_ID: return "ABS_MT_TRACKING_ID"
  61. case ABS_MT_PRESSURE: return "ABS_MT_PRESSURE"
  62. case ABS_MT_DISTANCE: return "ABS_MT_DISTANCE"
  63. case ABS_MT_TOOL_X: return "ABS_MT_TOOL_X"
  64. case ABS_MT_TOOL_Y: return "ABS_MT_TOOL_Y"
  65. case ABS_MAX: return "ABS_MAX"
  66. case ABS_CNT: return "ABS_CNT"
  67. default: return fmt.Sprintf("Unknown absolute axis %d", e)
  68. }
  69. }
  70. /*
  71. * Input event codes to string
  72. */
  73. /*
  74. * Device properties and quirks
  75. */
  76. func InputPropString(e uint) string {
  77. switch e {
  78. case INPUT_PROP_POINTER: return "INPUT_PROP_POINTER"
  79. case INPUT_PROP_DIRECT: return "INPUT_PROP_DIRECT"
  80. case INPUT_PROP_BUTTONPAD: return "INPUT_PROP_BUTTONPAD"
  81. case INPUT_PROP_SEMI_MT: return "INPUT_PROP_SEMI_MT"
  82. case INPUT_PROP_TOPBUTTONPAD: return "INPUT_PROP_TOPBUTTONPAD"
  83. case INPUT_PROP_POINTING_STICK: return "INPUT_PROP_POINTING_STICK"
  84. case INPUT_PROP_ACCELEROMETER: return "INPUT_PROP_ACCELEROMETER"
  85. case INPUT_PROP_MAX: return "INPUT_PROP_MAX"
  86. case INPUT_PROP_CNT: return "INPUT_PROP_CNT"
  87. default: return fmt.Sprintf("Unknown INPUT_PROP %d", e)
  88. }
  89. }
  90. /*
  91. * Synchronization events.
  92. */
  93. func SynString(e uint) string {
  94. switch e {
  95. case SYN_REPORT: return "SYN_REPORT"
  96. case SYN_CONFIG: return "SYN_CONFIG"
  97. case SYN_MT_REPORT: return "SYN_MT_REPORT"
  98. case SYN_DROPPED: return "SYN_DROPPED"
  99. case SYN_MAX: return "SYN_MAX"
  100. case SYN_CNT: return "SYN_CNT"
  101. default: return fmt.Sprintf("Unknown SYN %d", e)
  102. }
  103. }
  104. /*
  105. * Keys and buttons
  106. *
  107. */
  108. func KeyString(e uint) string {
  109. switch e {
  110. case KEY_RESERVED: return "KEY_RESERVED"
  111. case KEY_ESC: return "KEY_ESC"
  112. case KEY_1: return "KEY_1"
  113. case KEY_2: return "KEY_2"
  114. case KEY_3: return "KEY_3"
  115. case KEY_4: return "KEY_4"
  116. case KEY_5: return "KEY_5"
  117. case KEY_6: return "KEY_6"
  118. case KEY_7: return "KEY_7"
  119. case KEY_8: return "KEY_8"
  120. case KEY_9: return "KEY_9"
  121. case KEY_0: return "KEY_0"
  122. case KEY_MINUS: return "KEY_MINUS"
  123. case KEY_EQUAL: return "KEY_EQUAL"
  124. case KEY_BACKSPACE: return "KEY_BACKSPACE"
  125. case KEY_TAB: return "KEY_TAB"
  126. case KEY_Q: return "KEY_Q"
  127. case KEY_W: return "KEY_W"
  128. case KEY_E: return "KEY_E"
  129. case KEY_R: return "KEY_R"
  130. case KEY_T: return "KEY_T"
  131. case KEY_Y: return "KEY_Y"
  132. case KEY_U: return "KEY_U"
  133. case KEY_I: return "KEY_I"
  134. case KEY_O: return "KEY_O"
  135. case KEY_P: return "KEY_P"
  136. case KEY_LEFTBRACE: return "KEY_LEFTBRACE"
  137. case KEY_RIGHTBRACE: return "KEY_RIGHTBRACE"
  138. case KEY_ENTER: return "KEY_ENTER"
  139. case KEY_LEFTCTRL: return "KEY_LEFTCTRL"
  140. case KEY_A: return "KEY_A"
  141. case KEY_S: return "KEY_S"
  142. case KEY_D: return "KEY_D"
  143. case KEY_F: return "KEY_F"
  144. case KEY_G: return "KEY_G"
  145. case KEY_H: return "KEY_H"
  146. case KEY_J: return "KEY_J"
  147. case KEY_K: return "KEY_K"
  148. case KEY_L: return "KEY_L"
  149. case KEY_SEMICOLON: return "KEY_SEMICOLON"
  150. case KEY_APOSTROPHE: return "KEY_APOSTROPHE"
  151. case KEY_GRAVE: return "KEY_GRAVE"
  152. case KEY_LEFTSHIFT: return "KEY_LEFTSHIFT"
  153. case KEY_BACKSLASH: return "KEY_BACKSLASH"
  154. case KEY_Z: return "KEY_Z"
  155. case KEY_X: return "KEY_X"
  156. case KEY_C: return "KEY_C"
  157. case KEY_V: return "KEY_V"
  158. case KEY_B: return "KEY_B"
  159. case KEY_N: return "KEY_N"
  160. case KEY_M: return "KEY_M"
  161. case KEY_COMMA: return "KEY_COMMA"
  162. case KEY_DOT: return "KEY_DOT"
  163. case KEY_SLASH: return "KEY_SLASH"
  164. case KEY_RIGHTSHIFT: return "KEY_RIGHTSHIFT"
  165. case KEY_KPASTERISK: return "KEY_KPASTERISK"
  166. case KEY_LEFTALT: return "KEY_LEFTALT"
  167. case KEY_SPACE: return "KEY_SPACE"
  168. case KEY_CAPSLOCK: return "KEY_CAPSLOCK"
  169. case KEY_F1: return "KEY_F1"
  170. case KEY_F2: return "KEY_F2"
  171. case KEY_F3: return "KEY_F3"
  172. case KEY_F4: return "KEY_F4"
  173. case KEY_F5: return "KEY_F5"
  174. case KEY_F6: return "KEY_F6"
  175. case KEY_F7: return "KEY_F7"
  176. case KEY_F8: return "KEY_F8"
  177. case KEY_F9: return "KEY_F9"
  178. case KEY_F10: return "KEY_F10"
  179. case KEY_NUMLOCK: return "KEY_NUMLOCK"
  180. case KEY_SCROLLLOCK: return "KEY_SCROLLLOCK"
  181. case KEY_KP7: return "KEY_KP7"
  182. case KEY_KP8: return "KEY_KP8"
  183. case KEY_KP9: return "KEY_KP9"
  184. case KEY_KPMINUS: return "KEY_KPMINUS"
  185. case KEY_KP4: return "KEY_KP4"
  186. case KEY_KP5: return "KEY_KP5"
  187. case KEY_KP6: return "KEY_KP6"
  188. case KEY_KPPLUS: return "KEY_KPPLUS"
  189. case KEY_KP1: return "KEY_KP1"
  190. case KEY_KP2: return "KEY_KP2"
  191. case KEY_KP3: return "KEY_KP3"
  192. case KEY_KP0: return "KEY_KP0"
  193. case KEY_KPDOT: return "KEY_KPDOT"
  194. case KEY_ZENKAKUHANKAKU: return "KEY_ZENKAKUHANKAKU"
  195. case KEY_102ND: return "KEY_102ND"
  196. case KEY_F11: return "KEY_F11"
  197. case KEY_F12: return "KEY_F12"
  198. case KEY_RO: return "KEY_RO"
  199. case KEY_KATAKANA: return "KEY_KATAKANA"
  200. case KEY_HIRAGANA: return "KEY_HIRAGANA"
  201. case KEY_HENKAN: return "KEY_HENKAN"
  202. case KEY_KATAKANAHIRAGANA: return "KEY_KATAKANAHIRAGANA"
  203. case KEY_MUHENKAN: return "KEY_MUHENKAN"
  204. case KEY_KPJPCOMMA: return "KEY_KPJPCOMMA"
  205. case KEY_KPENTER: return "KEY_KPENTER"
  206. case KEY_RIGHTCTRL: return "KEY_RIGHTCTRL"
  207. case KEY_KPSLASH: return "KEY_KPSLASH"
  208. case KEY_SYSRQ: return "KEY_SYSRQ"
  209. case KEY_RIGHTALT: return "KEY_RIGHTALT"
  210. case KEY_LINEFEED: return "KEY_LINEFEED"
  211. case KEY_HOME: return "KEY_HOME"
  212. case KEY_UP: return "KEY_UP"
  213. case KEY_PAGEUP: return "KEY_PAGEUP"
  214. case KEY_LEFT: return "KEY_LEFT"
  215. case KEY_RIGHT: return "KEY_RIGHT"
  216. case KEY_END: return "KEY_END"
  217. case KEY_DOWN: return "KEY_DOWN"
  218. case KEY_PAGEDOWN: return "KEY_PAGEDOWN"
  219. case KEY_INSERT: return "KEY_INSERT"
  220. case KEY_DELETE: return "KEY_DELETE"
  221. case KEY_MACRO: return "KEY_MACRO"
  222. case KEY_MUTE: return "KEY_MUTE"
  223. case KEY_VOLUMEDOWN: return "KEY_VOLUMEDOWN"
  224. case KEY_VOLUMEUP: return "KEY_VOLUMEUP"
  225. case KEY_POWER: return "KEY_POWER"
  226. case KEY_KPEQUAL: return "KEY_KPEQUAL"
  227. case KEY_KPPLUSMINUS: return "KEY_KPPLUSMINUS"
  228. case KEY_PAUSE: return "KEY_PAUSE"
  229. case KEY_SCALE: return "KEY_SCALE"
  230. case KEY_KPCOMMA: return "KEY_KPCOMMA"
  231. case KEY_HANGEUL: return "KEY_HANGEUL"
  232. case KEY_HANJA: return "KEY_HANJA"
  233. case KEY_YEN: return "KEY_YEN"
  234. case KEY_LEFTMETA: return "KEY_LEFTMETA"
  235. case KEY_RIGHTMETA: return "KEY_RIGHTMETA"
  236. case KEY_COMPOSE: return "KEY_COMPOSE"
  237. case KEY_STOP: return "KEY_STOP"
  238. case KEY_AGAIN: return "KEY_AGAIN"
  239. case KEY_PROPS: return "KEY_PROPS"
  240. case KEY_UNDO: return "KEY_UNDO"
  241. case KEY_FRONT: return "KEY_FRONT"
  242. case KEY_COPY: return "KEY_COPY"
  243. case KEY_OPEN: return "KEY_OPEN"
  244. case KEY_PASTE: return "KEY_PASTE"
  245. case KEY_FIND: return "KEY_FIND"
  246. case KEY_CUT: return "KEY_CUT"
  247. case KEY_HELP: return "KEY_HELP"
  248. case KEY_MENU: return "KEY_MENU"
  249. case KEY_CALC: return "KEY_CALC"
  250. case KEY_SETUP: return "KEY_SETUP"
  251. case KEY_SLEEP: return "KEY_SLEEP"
  252. case KEY_WAKEUP: return "KEY_WAKEUP"
  253. case KEY_FILE: return "KEY_FILE"
  254. case KEY_SENDFILE: return "KEY_SENDFILE"
  255. case KEY_DELETEFILE: return "KEY_DELETEFILE"
  256. case KEY_XFER: return "KEY_XFER"
  257. case KEY_PROG1: return "KEY_PROG1"
  258. case KEY_PROG2: return "KEY_PROG2"
  259. case KEY_WWW: return "KEY_WWW"
  260. case KEY_MSDOS: return "KEY_MSDOS"
  261. case KEY_SCREENLOCK: return "KEY_SCREENLOCK"
  262. case KEY_ROTATE_DISPLAY: return "KEY_ROTATE_DISPLAY"
  263. case KEY_CYCLEWINDOWS: return "KEY_CYCLEWINDOWS"
  264. case KEY_MAIL: return "KEY_MAIL"
  265. case KEY_BOOKMARKS: return "KEY_BOOKMARKS"
  266. case KEY_COMPUTER: return "KEY_COMPUTER"
  267. case KEY_BACK: return "KEY_BACK"
  268. case KEY_FORWARD: return "KEY_FORWARD"
  269. case KEY_CLOSECD: return "KEY_CLOSECD"
  270. case KEY_EJECTCD: return "KEY_EJECTCD"
  271. case KEY_EJECTCLOSECD: return "KEY_EJECTCLOSECD"
  272. case KEY_NEXTSONG: return "KEY_NEXTSONG"
  273. case KEY_PLAYPAUSE: return "KEY_PLAYPAUSE"
  274. case KEY_PREVIOUSSONG: return "KEY_PREVIOUSSONG"
  275. case KEY_STOPCD: return "KEY_STOPCD"
  276. case KEY_RECORD: return "KEY_RECORD"
  277. case KEY_REWIND: return "KEY_REWIND"
  278. case KEY_PHONE: return "KEY_PHONE"
  279. case KEY_ISO: return "KEY_ISO"
  280. case KEY_CONFIG: return "KEY_CONFIG"
  281. case KEY_HOMEPAGE: return "KEY_HOMEPAGE"
  282. case KEY_REFRESH: return "KEY_REFRESH"
  283. case KEY_EXIT: return "KEY_EXIT"
  284. case KEY_MOVE: return "KEY_MOVE"
  285. case KEY_EDIT: return "KEY_EDIT"
  286. case KEY_SCROLLUP: return "KEY_SCROLLUP"
  287. case KEY_SCROLLDOWN: return "KEY_SCROLLDOWN"
  288. case KEY_KPLEFTPAREN: return "KEY_KPLEFTPAREN"
  289. case KEY_KPRIGHTPAREN: return "KEY_KPRIGHTPAREN"
  290. case KEY_NEW: return "KEY_NEW"
  291. case KEY_REDO: return "KEY_REDO"
  292. case KEY_F13: return "KEY_F13"
  293. case KEY_F14: return "KEY_F14"
  294. case KEY_F15: return "KEY_F15"
  295. case KEY_F16: return "KEY_F16"
  296. case KEY_F17: return "KEY_F17"
  297. case KEY_F18: return "KEY_F18"
  298. case KEY_F19: return "KEY_F19"
  299. case KEY_F20: return "KEY_F20"
  300. case KEY_F21: return "KEY_F21"
  301. case KEY_F22: return "KEY_F22"
  302. case KEY_F23: return "KEY_F23"
  303. case KEY_F24: return "KEY_F24"
  304. case KEY_PLAYCD: return "KEY_PLAYCD"
  305. case KEY_PAUSECD: return "KEY_PAUSECD"
  306. case KEY_PROG3: return "KEY_PROG3"
  307. case KEY_PROG4: return "KEY_PROG4"
  308. case KEY_DASHBOARD: return "KEY_DASHBOARD"
  309. case KEY_SUSPEND: return "KEY_SUSPEND"
  310. case KEY_CLOSE: return "KEY_CLOSE"
  311. case KEY_PLAY: return "KEY_PLAY"
  312. case KEY_FASTFORWARD: return "KEY_FASTFORWARD"
  313. case KEY_BASSBOOST: return "KEY_BASSBOOST"
  314. case KEY_PRINT: return "KEY_PRINT"
  315. case KEY_HP: return "KEY_HP"
  316. case KEY_CAMERA: return "KEY_CAMERA"
  317. case KEY_SOUND: return "KEY_SOUND"
  318. case KEY_QUESTION: return "KEY_QUESTION"
  319. case KEY_EMAIL: return "KEY_EMAIL"
  320. case KEY_CHAT: return "KEY_CHAT"
  321. case KEY_SEARCH: return "KEY_SEARCH"
  322. case KEY_CONNECT: return "KEY_CONNECT"
  323. case KEY_FINANCE: return "KEY_FINANCE"
  324. case KEY_SPORT: return "KEY_SPORT"
  325. case KEY_SHOP: return "KEY_SHOP"
  326. case KEY_ALTERASE: return "KEY_ALTERASE"
  327. case KEY_CANCEL: return "KEY_CANCEL"
  328. case KEY_BRIGHTNESSDOWN: return "KEY_BRIGHTNESSDOWN"
  329. case KEY_BRIGHTNESSUP: return "KEY_BRIGHTNESSUP"
  330. case KEY_MEDIA: return "KEY_MEDIA"
  331. case KEY_SWITCHVIDEOMODE: return "KEY_SWITCHVIDEOMODE"
  332. case KEY_KBDILLUMTOGGLE: return "KEY_KBDILLUMTOGGLE"
  333. case KEY_KBDILLUMDOWN: return "KEY_KBDILLUMDOWN"
  334. case KEY_KBDILLUMUP: return "KEY_KBDILLUMUP"
  335. case KEY_SEND: return "KEY_SEND"
  336. case KEY_REPLY: return "KEY_REPLY"
  337. case KEY_FORWARDMAIL: return "KEY_FORWARDMAIL"
  338. case KEY_SAVE: return "KEY_SAVE"
  339. case KEY_DOCUMENTS: return "KEY_DOCUMENTS"
  340. case KEY_BATTERY: return "KEY_BATTERY"
  341. case KEY_BLUETOOTH: return "KEY_BLUETOOTH"
  342. case KEY_WLAN: return "KEY_WLAN"
  343. case KEY_UWB: return "KEY_UWB"
  344. case KEY_UNKNOWN: return "KEY_UNKNOWN"
  345. case KEY_VIDEO_NEXT: return "KEY_VIDEO_NEXT"
  346. case KEY_VIDEO_PREV: return "KEY_VIDEO_PREV"
  347. case KEY_BRIGHTNESS_CYCLE: return "KEY_BRIGHTNESS_CYCLE"
  348. case KEY_BRIGHTNESS_AUTO: return "KEY_BRIGHTNESS_AUTO"
  349. case KEY_DISPLAY_OFF: return "KEY_DISPLAY_OFF"
  350. case KEY_WWAN: return "KEY_WWAN"
  351. case KEY_RFKILL: return "KEY_RFKILL"
  352. case KEY_MICMUTE: return "KEY_MICMUTE"
  353. /* Code 255 is reserved for special needs of AT keyboard driver */
  354. case BTN_0: return "BTN_0"
  355. case BTN_1: return "BTN_1"
  356. case BTN_2: return "BTN_2"
  357. case BTN_3: return "BTN_3"
  358. case BTN_4: return "BTN_4"
  359. case BTN_5: return "BTN_5"
  360. case BTN_6: return "BTN_6"
  361. case BTN_7: return "BTN_7"
  362. case BTN_8: return "BTN_8"
  363. case BTN_9: return "BTN_9"
  364. case BTN_LEFT: return "BTN_LEFT"
  365. case BTN_RIGHT: return "BTN_RIGHT"
  366. case BTN_MIDDLE: return "BTN_MIDDLE"
  367. case BTN_SIDE: return "BTN_SIDE"
  368. case BTN_EXTRA: return "BTN_EXTRA"
  369. case BTN_FORWARD: return "BTN_FORWARD"
  370. case BTN_BACK: return "BTN_BACK"
  371. case BTN_TASK: return "BTN_TASK"
  372. case BTN_JOYSTICK: return "BTN_JOYSTICK"
  373. case BTN_THUMB: return "BTN_THUMB"
  374. case BTN_THUMB2: return "BTN_THUMB2"
  375. case BTN_TOP: return "BTN_TOP"
  376. case BTN_TOP2: return "BTN_TOP2"
  377. case BTN_PINKIE: return "BTN_PINKIE"
  378. case BTN_BASE: return "BTN_BASE"
  379. case BTN_BASE2: return "BTN_BASE2"
  380. case BTN_BASE3: return "BTN_BASE3"
  381. case BTN_BASE4: return "BTN_BASE4"
  382. case BTN_BASE5: return "BTN_BASE5"
  383. case BTN_BASE6: return "BTN_BASE6"
  384. case BTN_DEAD: return "BTN_DEAD"
  385. case BTN_A: return "BTN_A"
  386. case BTN_B: return "BTN_B"
  387. case BTN_C: return "BTN_C"
  388. case BTN_X: return "BTN_X"
  389. case BTN_Y: return "BTN_Y"
  390. case BTN_Z: return "BTN_Z"
  391. case BTN_TL: return "BTN_TL"
  392. case BTN_TR: return "BTN_TR"
  393. case BTN_TL2: return "BTN_TL2"
  394. case BTN_TR2: return "BTN_TR2"
  395. case BTN_SELECT: return "BTN_SELECT"
  396. case BTN_START: return "BTN_START"
  397. case BTN_MODE: return "BTN_MODE"
  398. case BTN_THUMBL: return "BTN_THUMBL"
  399. case BTN_THUMBR: return "BTN_THUMBR"
  400. case BTN_TOOL_PEN: return "BTN_TOOL_PEN"
  401. case BTN_TOOL_RUBBER: return "BTN_TOOL_RUBBER"
  402. case BTN_TOOL_BRUSH: return "BTN_TOOL_BRUSH"
  403. case BTN_TOOL_PENCIL: return "BTN_TOOL_PENCIL"
  404. case BTN_TOOL_AIRBRUSH: return "BTN_TOOL_AIRBRUSH"
  405. case BTN_TOOL_FINGER: return "BTN_TOOL_FINGER"
  406. case BTN_TOOL_MOUSE: return "BTN_TOOL_MOUSE"
  407. case BTN_TOOL_LENS: return "BTN_TOOL_LENS"
  408. case BTN_TOOL_QUINTTAP: return "BTN_TOOL_QUINTTAP"
  409. case BTN_TOUCH: return "BTN_TOUCH"
  410. case BTN_STYLUS: return "BTN_STYLUS"
  411. case BTN_STYLUS2: return "BTN_STYLUS2"
  412. case BTN_TOOL_DOUBLETAP: return "BTN_TOOL_DOUBLETAP"
  413. case BTN_TOOL_TRIPLETAP: return "BTN_TOOL_TRIPLETAP"
  414. case BTN_TOOL_QUADTAP: return "BTN_TOOL_QUADTAP"
  415. case BTN_GEAR_DOWN: return "BTN_GEAR_DOWN"
  416. case BTN_GEAR_UP: return "BTN_GEAR_UP"
  417. case KEY_OK: return "KEY_OK"
  418. case KEY_SELECT: return "KEY_SELECT"
  419. case KEY_GOTO: return "KEY_GOTO"
  420. case KEY_CLEAR: return "KEY_CLEAR"
  421. case KEY_POWER2: return "KEY_POWER2"
  422. case KEY_OPTION: return "KEY_OPTION"
  423. case KEY_INFO: return "KEY_INFO"
  424. case KEY_TIME: return "KEY_TIME"
  425. case KEY_VENDOR: return "KEY_VENDOR"
  426. case KEY_ARCHIVE: return "KEY_ARCHIVE"
  427. case KEY_PROGRAM: return "KEY_PROGRAM"
  428. case KEY_CHANNEL: return "KEY_CHANNEL"
  429. case KEY_FAVORITES: return "KEY_FAVORITES"
  430. case KEY_EPG: return "KEY_EPG"
  431. case KEY_PVR: return "KEY_PVR"
  432. case KEY_MHP: return "KEY_MHP"
  433. case KEY_LANGUAGE: return "KEY_LANGUAGE"
  434. case KEY_TITLE: return "KEY_TITLE"
  435. case KEY_SUBTITLE: return "KEY_SUBTITLE"
  436. case KEY_ANGLE: return "KEY_ANGLE"
  437. case KEY_ZOOM: return "KEY_ZOOM"
  438. case KEY_MODE: return "KEY_MODE"
  439. case KEY_KEYBOARD: return "KEY_KEYBOARD"
  440. case KEY_SCREEN: return "KEY_SCREEN"
  441. case KEY_PC: return "KEY_PC"
  442. case KEY_TV: return "KEY_TV"
  443. case KEY_TV2: return "KEY_TV2"
  444. case KEY_VCR: return "KEY_VCR"
  445. case KEY_VCR2: return "KEY_VCR2"
  446. case KEY_SAT: return "KEY_SAT"
  447. case KEY_SAT2: return "KEY_SAT2"
  448. case KEY_CD: return "KEY_CD"
  449. case KEY_TAPE: return "KEY_TAPE"
  450. case KEY_RADIO: return "KEY_RADIO"
  451. case KEY_TUNER: return "KEY_TUNER"
  452. case KEY_PLAYER: return "KEY_PLAYER"
  453. case KEY_TEXT: return "KEY_TEXT"
  454. case KEY_DVD: return "KEY_DVD"
  455. case KEY_AUX: return "KEY_AUX"
  456. case KEY_MP3: return "KEY_MP3"
  457. case KEY_AUDIO: return "KEY_AUDIO"
  458. case KEY_VIDEO: return "KEY_VIDEO"
  459. case KEY_DIRECTORY: return "KEY_DIRECTORY"
  460. case KEY_LIST: return "KEY_LIST"
  461. case KEY_MEMO: return "KEY_MEMO"
  462. case KEY_CALENDAR: return "KEY_CALENDAR"
  463. case KEY_RED: return "KEY_RED"
  464. case KEY_GREEN: return "KEY_GREEN"
  465. case KEY_YELLOW: return "KEY_YELLOW"
  466. case KEY_BLUE: return "KEY_BLUE"
  467. case KEY_CHANNELUP: return "KEY_CHANNELUP"
  468. case KEY_CHANNELDOWN: return "KEY_CHANNELDOWN"
  469. case KEY_FIRST: return "KEY_FIRST"
  470. case KEY_LAST: return "KEY_LAST"
  471. case KEY_AB: return "KEY_AB"
  472. case KEY_NEXT: return "KEY_NEXT"
  473. case KEY_RESTART: return "KEY_RESTART"
  474. case KEY_SLOW: return "KEY_SLOW"
  475. case KEY_SHUFFLE: return "KEY_SHUFFLE"
  476. case KEY_BREAK: return "KEY_BREAK"
  477. case KEY_PREVIOUS: return "KEY_PREVIOUS"
  478. case KEY_DIGITS: return "KEY_DIGITS"
  479. case KEY_TEEN: return "KEY_TEEN"
  480. case KEY_TWEN: return "KEY_TWEN"
  481. case KEY_VIDEOPHONE: return "KEY_VIDEOPHONE"
  482. case KEY_GAMES: return "KEY_GAMES"
  483. case KEY_ZOOMIN: return "KEY_ZOOMIN"
  484. case KEY_ZOOMOUT: return "KEY_ZOOMOUT"
  485. case KEY_ZOOMRESET: return "KEY_ZOOMRESET"
  486. case KEY_WORDPROCESSOR: return "KEY_WORDPROCESSOR"
  487. case KEY_EDITOR: return "KEY_EDITOR"
  488. case KEY_SPREADSHEET: return "KEY_SPREADSHEET"
  489. case KEY_GRAPHICSEDITOR: return "KEY_GRAPHICSEDITOR"
  490. case KEY_PRESENTATION: return "KEY_PRESENTATION"
  491. case KEY_DATABASE: return "KEY_DATABASE"
  492. case KEY_NEWS: return "KEY_NEWS"
  493. case KEY_VOICEMAIL: return "KEY_VOICEMAIL"
  494. case KEY_ADDRESSBOOK: return "KEY_ADDRESSBOOK"
  495. case KEY_MESSENGER: return "KEY_MESSENGER"
  496. case KEY_DISPLAYTOGGLE: return "KEY_DISPLAYTOGGLE"
  497. case KEY_SPELLCHECK: return "KEY_SPELLCHECK"
  498. case KEY_LOGOFF: return "KEY_LOGOFF"
  499. case KEY_DOLLAR: return "KEY_DOLLAR"
  500. case KEY_EURO: return "KEY_EURO"
  501. case KEY_FRAMEBACK: return "KEY_FRAMEBACK"
  502. case KEY_FRAMEFORWARD: return "KEY_FRAMEFORWARD"
  503. case KEY_CONTEXT_MENU: return "KEY_CONTEXT_MENU"
  504. case KEY_MEDIA_REPEAT: return "KEY_MEDIA_REPEAT"
  505. case KEY_10CHANNELSUP: return "KEY_10CHANNELSUP"
  506. case KEY_10CHANNELSDOWN: return "KEY_10CHANNELSDOWN"
  507. case KEY_IMAGES: return "KEY_IMAGES"
  508. case KEY_DEL_EOL: return "KEY_DEL_EOL"
  509. case KEY_DEL_EOS: return "KEY_DEL_EOS"
  510. case KEY_INS_LINE: return "KEY_INS_LINE"
  511. case KEY_DEL_LINE: return "KEY_DEL_LINE"
  512. case KEY_FN: return "KEY_FN"
  513. case KEY_FN_ESC: return "KEY_FN_ESC"
  514. case KEY_FN_F1: return "KEY_FN_F1"
  515. case KEY_FN_F2: return "KEY_FN_F2"
  516. case KEY_FN_F3: return "KEY_FN_F3"
  517. case KEY_FN_F4: return "KEY_FN_F4"
  518. case KEY_FN_F5: return "KEY_FN_F5"
  519. case KEY_FN_F6: return "KEY_FN_F6"
  520. case KEY_FN_F7: return "KEY_FN_F7"
  521. case KEY_FN_F8: return "KEY_FN_F8"
  522. case KEY_FN_F9: return "KEY_FN_F9"
  523. case KEY_FN_F10: return "KEY_FN_F10"
  524. case KEY_FN_F11: return "KEY_FN_F11"
  525. case KEY_FN_F12: return "KEY_FN_F12"
  526. case KEY_FN_1: return "KEY_FN_1"
  527. case KEY_FN_2: return "KEY_FN_2"
  528. case KEY_FN_D: return "KEY_FN_D"
  529. case KEY_FN_E: return "KEY_FN_E"
  530. case KEY_FN_F: return "KEY_FN_F"
  531. case KEY_FN_S: return "KEY_FN_S"
  532. case KEY_FN_B: return "KEY_FN_B"
  533. case KEY_BRL_DOT1: return "KEY_BRL_DOT1"
  534. case KEY_BRL_DOT2: return "KEY_BRL_DOT2"
  535. case KEY_BRL_DOT3: return "KEY_BRL_DOT3"
  536. case KEY_BRL_DOT4: return "KEY_BRL_DOT4"
  537. case KEY_BRL_DOT5: return "KEY_BRL_DOT5"
  538. case KEY_BRL_DOT6: return "KEY_BRL_DOT6"
  539. case KEY_BRL_DOT7: return "KEY_BRL_DOT7"
  540. case KEY_BRL_DOT8: return "KEY_BRL_DOT8"
  541. case KEY_BRL_DOT9: return "KEY_BRL_DOT9"
  542. case KEY_BRL_DOT10: return "KEY_BRL_DOT10"
  543. case KEY_NUMERIC_0: return "KEY_NUMERIC_0"
  544. case KEY_NUMERIC_1: return "KEY_NUMERIC_1"
  545. case KEY_NUMERIC_2: return "KEY_NUMERIC_2"
  546. case KEY_NUMERIC_3: return "KEY_NUMERIC_3"
  547. case KEY_NUMERIC_4: return "KEY_NUMERIC_4"
  548. case KEY_NUMERIC_5: return "KEY_NUMERIC_5"
  549. case KEY_NUMERIC_6: return "KEY_NUMERIC_6"
  550. case KEY_NUMERIC_7: return "KEY_NUMERIC_7"
  551. case KEY_NUMERIC_8: return "KEY_NUMERIC_8"
  552. case KEY_NUMERIC_9: return "KEY_NUMERIC_9"
  553. case KEY_NUMERIC_STAR: return "KEY_NUMERIC_STAR"
  554. case KEY_NUMERIC_POUND: return "KEY_NUMERIC_POUND"
  555. case KEY_NUMERIC_A: return "KEY_NUMERIC_A"
  556. case KEY_NUMERIC_B: return "KEY_NUMERIC_B"
  557. case KEY_NUMERIC_C: return "KEY_NUMERIC_C"
  558. case KEY_NUMERIC_D: return "KEY_NUMERIC_D"
  559. case KEY_CAMERA_FOCUS: return "KEY_CAMERA_FOCUS"
  560. case KEY_WPS_BUTTON: return "KEY_WPS_BUTTON"
  561. case KEY_TOUCHPAD_TOGGLE: return "KEY_TOUCHPAD_TOGGLE"
  562. case KEY_TOUCHPAD_ON: return "KEY_TOUCHPAD_ON"
  563. case KEY_TOUCHPAD_OFF: return "KEY_TOUCHPAD_OFF"
  564. case KEY_CAMERA_ZOOMIN: return "KEY_CAMERA_ZOOMIN"
  565. case KEY_CAMERA_ZOOMOUT: return "KEY_CAMERA_ZOOMOUT"
  566. case KEY_CAMERA_UP: return "KEY_CAMERA_UP"
  567. case KEY_CAMERA_DOWN: return "KEY_CAMERA_DOWN"
  568. case KEY_CAMERA_LEFT: return "KEY_CAMERA_LEFT"
  569. case KEY_CAMERA_RIGHT: return "KEY_CAMERA_RIGHT"
  570. case KEY_ATTENDANT_ON: return "KEY_ATTENDANT_ON"
  571. case KEY_ATTENDANT_OFF: return "KEY_ATTENDANT_OFF"
  572. case KEY_ATTENDANT_TOGGLE: return "KEY_ATTENDANT_TOGGLE"
  573. case KEY_LIGHTS_TOGGLE: return "KEY_LIGHTS_TOGGLE"
  574. case BTN_DPAD_UP: return "BTN_DPAD_UP"
  575. case BTN_DPAD_DOWN: return "BTN_DPAD_DOWN"
  576. case BTN_DPAD_LEFT: return "BTN_DPAD_LEFT"
  577. case BTN_DPAD_RIGHT: return "BTN_DPAD_RIGHT"
  578. case KEY_ALS_TOGGLE: return "KEY_ALS_TOGGLE"
  579. case KEY_BUTTONCONFIG: return "KEY_BUTTONCONFIG"
  580. case KEY_TASKMANAGER: return "KEY_TASKMANAGER"
  581. case KEY_JOURNAL: return "KEY_JOURNAL"
  582. case KEY_CONTROLPANEL: return "KEY_CONTROLPANEL"
  583. case KEY_APPSELECT: return "KEY_APPSELECT"
  584. case KEY_SCREENSAVER: return "KEY_SCREENSAVER"
  585. case KEY_VOICECOMMAND: return "KEY_VOICECOMMAND"
  586. case KEY_BRIGHTNESS_MIN: return "KEY_BRIGHTNESS_MIN"
  587. case KEY_BRIGHTNESS_MAX: return "KEY_BRIGHTNESS_MAX"
  588. case KEY_KBDINPUTASSIST_PREV: return "KEY_KBDINPUTASSIST_PREV"
  589. case KEY_KBDINPUTASSIST_NEXT: return "KEY_KBDINPUTASSIST_NEXT"
  590. case KEY_KBDINPUTASSIST_PREVGROUP: return "KEY_KBDINPUTASSIST_PREVGROUP"
  591. case KEY_KBDINPUTASSIST_NEXTGROUP: return "KEY_KBDINPUTASSIST_NEXTGROUP"
  592. case KEY_KBDINPUTASSIST_ACCEPT: return "KEY_KBDINPUTASSIST_ACCEPT"
  593. case KEY_KBDINPUTASSIST_CANCEL: return "KEY_KBDINPUTASSIST_CANCEL"
  594. case BTN_TRIGGER_HAPPY1: return "BTN_TRIGGER_HAPPY1"
  595. case BTN_TRIGGER_HAPPY2: return "BTN_TRIGGER_HAPPY2"
  596. case BTN_TRIGGER_HAPPY3: return "BTN_TRIGGER_HAPPY3"
  597. case BTN_TRIGGER_HAPPY4: return "BTN_TRIGGER_HAPPY4"
  598. case BTN_TRIGGER_HAPPY5: return "BTN_TRIGGER_HAPPY5"
  599. case BTN_TRIGGER_HAPPY6: return "BTN_TRIGGER_HAPPY6"
  600. case BTN_TRIGGER_HAPPY7: return "BTN_TRIGGER_HAPPY7"
  601. case BTN_TRIGGER_HAPPY8: return "BTN_TRIGGER_HAPPY8"
  602. case BTN_TRIGGER_HAPPY9: return "BTN_TRIGGER_HAPPY9"
  603. case BTN_TRIGGER_HAPPY10: return "BTN_TRIGGER_HAPPY10"
  604. case BTN_TRIGGER_HAPPY11: return "BTN_TRIGGER_HAPPY11"
  605. case BTN_TRIGGER_HAPPY12: return "BTN_TRIGGER_HAPPY12"
  606. case BTN_TRIGGER_HAPPY13: return "BTN_TRIGGER_HAPPY13"
  607. case BTN_TRIGGER_HAPPY14: return "BTN_TRIGGER_HAPPY14"
  608. case BTN_TRIGGER_HAPPY15: return "BTN_TRIGGER_HAPPY15"
  609. case BTN_TRIGGER_HAPPY16: return "BTN_TRIGGER_HAPPY16"
  610. case BTN_TRIGGER_HAPPY17: return "BTN_TRIGGER_HAPPY17"
  611. case BTN_TRIGGER_HAPPY18: return "BTN_TRIGGER_HAPPY18"
  612. case BTN_TRIGGER_HAPPY19: return "BTN_TRIGGER_HAPPY19"
  613. case BTN_TRIGGER_HAPPY20: return "BTN_TRIGGER_HAPPY20"
  614. case BTN_TRIGGER_HAPPY21: return "BTN_TRIGGER_HAPPY21"
  615. case BTN_TRIGGER_HAPPY22: return "BTN_TRIGGER_HAPPY22"
  616. case BTN_TRIGGER_HAPPY23: return "BTN_TRIGGER_HAPPY23"
  617. case BTN_TRIGGER_HAPPY24: return "BTN_TRIGGER_HAPPY24"
  618. case BTN_TRIGGER_HAPPY25: return "BTN_TRIGGER_HAPPY25"
  619. case BTN_TRIGGER_HAPPY26: return "BTN_TRIGGER_HAPPY26"
  620. case BTN_TRIGGER_HAPPY27: return "BTN_TRIGGER_HAPPY27"
  621. case BTN_TRIGGER_HAPPY28: return "BTN_TRIGGER_HAPPY28"
  622. case BTN_TRIGGER_HAPPY29: return "BTN_TRIGGER_HAPPY29"
  623. case BTN_TRIGGER_HAPPY30: return "BTN_TRIGGER_HAPPY30"
  624. case BTN_TRIGGER_HAPPY31: return "BTN_TRIGGER_HAPPY31"
  625. case BTN_TRIGGER_HAPPY32: return "BTN_TRIGGER_HAPPY32"
  626. case BTN_TRIGGER_HAPPY33: return "BTN_TRIGGER_HAPPY33"
  627. case BTN_TRIGGER_HAPPY34: return "BTN_TRIGGER_HAPPY34"
  628. case BTN_TRIGGER_HAPPY35: return "BTN_TRIGGER_HAPPY35"
  629. case BTN_TRIGGER_HAPPY36: return "BTN_TRIGGER_HAPPY36"
  630. case BTN_TRIGGER_HAPPY37: return "BTN_TRIGGER_HAPPY37"
  631. case BTN_TRIGGER_HAPPY38: return "BTN_TRIGGER_HAPPY38"
  632. case BTN_TRIGGER_HAPPY39: return "BTN_TRIGGER_HAPPY39"
  633. case BTN_TRIGGER_HAPPY40: return "BTN_TRIGGER_HAPPY40"
  634. /* We avoid low common keys in module aliases so they don't get huge. */
  635. case KEY_MAX: return "KEY_MAX"
  636. case KEY_CNT: return "KEY_CNT"
  637. default: return fmt.Sprintf("Unknown KEY or BUTTON %d", e)
  638. }
  639. }
  640. /*
  641. * Relative axes
  642. */
  643. func RelString(e uint) string {
  644. switch e {
  645. case REL_X: return "REL_X"
  646. case REL_Y: return "REL_Y"
  647. case REL_Z: return "REL_Z"
  648. case REL_RX: return "REL_RX"
  649. case REL_RY: return "REL_RY"
  650. case REL_RZ: return "REL_RZ"
  651. case REL_HWHEEL: return "REL_HWHEEL"
  652. case REL_DIAL: return "REL_DIAL"
  653. case REL_WHEEL: return "REL_WHEEL"
  654. case REL_MISC: return "REL_MISC"
  655. case REL_MAX: return "REL_MAX"
  656. case REL_CNT: return "REL_CNT"
  657. default: return fmt.Sprintf("Unknown REL %d", e)
  658. }
  659. }
  660. /*
  661. * Switch events
  662. */
  663. func SwitchString(e uint) string {
  664. switch e {
  665. case SW_LID: return "SW_LID"
  666. case SW_TABLET_MODE: return "SW_TABLET_MODE"
  667. case SW_HEADPHONE_INSERT: return "SW_HEADPHONE_INSERT"
  668. case SW_RADIO: return "SW_RADIO"
  669. case SW_MICROPHONE_INSERT: return "SW_MICROPHONE_INSERT"
  670. case SW_DOCK: return "SW_DOCK"
  671. case SW_LINEOUT_INSERT: return "SW_LINEOUT_INSERT"
  672. case SW_JACK_PHYSICAL_INSERT: return "SW_JACK_PHYSICAL_INSERT"
  673. case SW_VIDEOOUT_INSERT: return "SW_VIDEOOUT_INSERT"
  674. case SW_CAMERA_LENS_COVER: return "SW_CAMERA_LENS_COVER"
  675. case SW_KEYPAD_SLIDE: return "SW_KEYPAD_SLIDE"
  676. case SW_FRONT_PROXIMITY: return "SW_FRONT_PROXIMITY"
  677. case SW_ROTATE_LOCK: return "SW_ROTATE_LOCK"
  678. case SW_LINEIN_INSERT: return "SW_LINEIN_INSERT"
  679. case SW_MUTE_DEVICE: return "SW_MUTE_DEVICE"
  680. case SW_MAX: return "SW_MAX"
  681. case SW_CNT: return "SW_CNT"
  682. default: return fmt.Sprintf("Unknown SW %d", e)
  683. }
  684. }
  685. /*
  686. * Misc events
  687. */
  688. func MscString(e uint) string {
  689. switch e {
  690. case MSC_SERIAL: return "MSC_SERIAL"
  691. case MSC_PULSELED: return "MSC_PULSELED"
  692. case MSC_GESTURE: return "MSC_GESTURE"
  693. case MSC_RAW: return "MSC_RAW"
  694. case MSC_SCAN: return "MSC_SCAN"
  695. case MSC_TIMESTAMP: return "MSC_TIMESTAMP"
  696. case MSC_MAX: return "MSC_MAX"
  697. case MSC_CNT: return "MSC_CNT"
  698. default: return fmt.Sprintf("Unknown MSC %d", e)
  699. }
  700. }
  701. /*
  702. * LEDs
  703. */
  704. func LedString(e uint) string {
  705. switch e {
  706. case LED_NUML: return "LED_NUML"
  707. case LED_CAPSL: return "LED_CAPSL"
  708. case LED_SCROLLL: return "LED_SCROLLL"
  709. case LED_COMPOSE: return "LED_COMPOSE"
  710. case LED_KANA: return "LED_KANA"
  711. case LED_SLEEP: return "LED_SLEEP"
  712. case LED_SUSPEND: return "LED_SUSPEND"
  713. case LED_MUTE: return "LED_MUTE"
  714. case LED_MISC: return "LED_MISC"
  715. case LED_MAIL: return "LED_MAIL"
  716. case LED_CHARGING: return "LED_CHARGING"
  717. case LED_MAX: return "LED_MAX"
  718. case LED_CNT: return "LED_CNT"
  719. default: return fmt.Sprintf("Unknown LED %d", e)
  720. }
  721. }
  722. /*
  723. * Autorepeat values
  724. */
  725. func RepString(e uint) string {
  726. switch e {
  727. case REP_DELAY: return "REP_DELAY"
  728. case REP_PERIOD: return "REP_PERIOD"
  729. case REP_CNT: return "REP_CNT"
  730. default: return fmt.Sprintf("Unknown REP %d", e)
  731. }
  732. }
  733. /*
  734. * Sounds
  735. */
  736. func SndString(e uint) string {
  737. switch e {
  738. case SND_CLICK: return "SND_CLICK"
  739. case SND_BELL: return "SND_BELL"
  740. case SND_TONE: return "SND_TONE"
  741. case SND_MAX: return "SND_MAX"
  742. case SND_CNT: return "SND_CNT"
  743. default: return fmt.Sprintf("Unknown SND %d", e)
  744. }
  745. }