12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- package linux
- import "fmt"
- func EvToString(e uint) string {
- switch e {
- case EV_SYN: return "EV_SYN"
- case EV_KEY: return "EV_KEY"
- case EV_REL: return "EV_REL"
- case EV_ABS: return "EV_ABS"
- case EV_MSC: return "EV_MSC"
- case EV_SW : return "EV_SW"
- case EV_LED: return "EV_LED"
- case EV_SND: return "EV_SND"
- case EV_REP: return "EV_REP"
- case EV_FF : return "EV_FF"
- case EV_PWR: return "EV_PWR"
- case EV_FF_STATUS: return "EV_FF_STATUS"
- case EV_MAX: return "EV_MAX"
- case EV_CNT: return "EV_CNT"
- default: return fmt.Sprintf("Unknown event %d", e)
- }
- }
- func AbsToString(e uint) string {
- switch e {
- case ABS_X: return "ABS_X"
- case ABS_Y: return "ABS_Y"
- case ABS_Z: return "ABS_Z"
- case ABS_RX: return "ABS_RX"
- case ABS_RY: return "ABS_RY"
- case ABS_RZ: return "ABS_RZ"
- case ABS_THROTTLE: return "ABS_THROTTLE"
- case ABS_RUDDER: return "ABS_RUDDER"
- case ABS_WHEEL: return "ABS_WHEEL"
- case ABS_GAS: return "ABS_GAS"
- case ABS_BRAKE: return "ABS_BRAKE"
- case ABS_HAT0X: return "ABS_HAT0X"
- case ABS_HAT0Y: return "ABS_HAT0Y"
- case ABS_HAT1X: return "ABS_HAT1X"
- case ABS_HAT1Y: return "ABS_HAT1Y"
- case ABS_HAT2X: return "ABS_HAT2X"
- case ABS_HAT2Y: return "ABS_HAT2Y"
- case ABS_HAT3X: return "ABS_HAT3X"
- case ABS_HAT3Y: return "ABS_HAT3Y"
- case ABS_PRESSURE: return "ABS_PRESSURE"
- case ABS_DISTANCE: return "ABS_DISTANCE"
- case ABS_TILT_X: return "ABS_TILT_X"
- case ABS_TILT_Y: return "ABS_TILT_Y"
- case ABS_TOOL_WIDTH: return "ABS_TOOL_WIDTH"
- case ABS_VOLUME: return "ABS_VOLUME"
- case ABS_MISC: return "ABS_MISC"
- case ABS_MT_SLOT: return "ABS_MT_SLOT"
- case ABS_MT_TOUCH_MAJOR: return "ABS_MT_TOUCH_MAJOR"
- case ABS_MT_TOUCH_MINOR: return "ABS_MT_TOUCH_MINOR"
- case ABS_MT_WIDTH_MAJOR: return "ABS_MT_WIDTH_MAJOR"
- case ABS_MT_WIDTH_MINOR: return "ABS_MT_WIDTH_MINOR"
- case ABS_MT_ORIENTATION: return "ABS_MT_ORIENTATION"
- case ABS_MT_POSITION_X: return "ABS_MT_POSITION_X"
- case ABS_MT_POSITION_Y: return "ABS_MT_POSITION_Y"
- case ABS_MT_TOOL_TYPE: return "ABS_MT_TOOL_TYPE"
- case ABS_MT_BLOB_ID: return "ABS_MT_BLOB_ID"
- case ABS_MT_TRACKING_ID: return "ABS_MT_TRACKING_ID"
- case ABS_MT_PRESSURE: return "ABS_MT_PRESSURE"
- case ABS_MT_DISTANCE: return "ABS_MT_DISTANCE"
- case ABS_MT_TOOL_X: return "ABS_MT_TOOL_X"
- case ABS_MT_TOOL_Y: return "ABS_MT_TOOL_Y"
- case ABS_MAX: return "ABS_MAX"
- case ABS_CNT: return "ABS_CNT"
- default: return fmt.Sprintf("Unknown absolute axis %d", e)
-
- }
- }
-
|