用hexdump获取event的输出信息

本文介绍如何通过hexdump解析键盘和触摸屏的输入事件。对于键盘,详细解释了上报事件、键值及按键状态;对于触摸屏,则介绍了触摸坐标、触摸状态等信息。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

当我们在调试输入设备时,如:键盘,触摸屏

会使用到hexdump工具。其内容如下:

1. 键盘:

# cat /dev/input/event0 | hexdump

0000000 f6a6 4e15 154b 0006 0001 0004 0001 0000
0000010 f6a6 4e15 1557 0006 0000 0000 0000 0000
0000020 f6a6 4e15 8510 0008 0001 0004 0000 0000
0000030 f6a6 4e15 8517 0008 0000 0000 0000 0000

共九列:

第六列表示上报事件: 0001 --> EV_KEY; 0000 ---> EV_SYN

第七列表示键值: 0004 --> KEY_3

第八列表示按键事件: 0001 --> PRESS, 0000 --> RELEASE


2. 触摸屏(电容屏)

# cat /dev/input/event1 | hexdump

0000250 f832 4e15 c502 0006 0003 0039 0020 0000
0000260 f832 4e15 c50f 0006 0003 0030 0004 0000
0000270 f832 4e15 c514 0006 0003 0035 0263 0000
0000280 f832 4e15 c519 0006 0003 0036 01fd 0000
0000290 f832 4e15 c520 0006 0001 014a 0001 0000
00002a0 f832 4e15 c525 0006 0003 0000 0263 0000
00002b0 f832 4e15 c52b 0006 0003 0001 01fd 0000
00002c0 f832 4e15 c530 0006 0000 0000 0000 0000
00002d0 f832 4e15 be99 0007 0003 0039 ffff ffff
00002e0 f832 4e15 bea5 0007 0001 014a 0000 0000
00002f0 f832 4e15 bea8 0007 0000 0000 0000 0000


第七列表示上报事件和: 0039 --> ABS_MT_TRACKING_ID; 0030 --> ABS_MT_TOUCH_MAJOR; 0035 --> ABS_MT_POSITION_X; 0036 --> ABS_MT_POSITION_Y

014a --> BTN_TOUCH

第八列表示上报值


# wpa_supplicant -d -i wlan0 -c /tmp/wifi.conf wpa_supplicant v2.10 random: Trying to read entropy from /dev/random Successfully initialized wpa_supplicant Initializing interface 'wlan0' conf '/tmp/wifi.conf' driver 'default' ctrl_interface 'N/A' bridge 'N/A' Configuration file '/tmp/wifi.conf' -> '/tmp/wifi.conf' Reading configuration file '/tmp/wifi.conf' nl80211: Supported cipher 00-0f-ac:1 nl80211: Supported cipher 00-0f-ac:5 nl80211: Supported cipher 00-0f-ac:2 nl80211: Supported cipher 00-0f-ac:4 nl80211: Supported cipher 00-0f-ac:6 nl80211: Using driver-based off-channel TX nl80211: key_mgmt=0xd0f enc=0x10f auth=0x7 flags=0x800d0c0 rrm_flags=0x0 probe_resp_offloads=0x0 max_stations=0 max_remain_on_chan=5000 max_scan_ssids=9 nl80211: interface wlan0 in phy phy0 nl80211: Set mode ifindex 2 iftype 2 (STATION) nl80211: Subscribe to mgmt frames with non-AP handle 0x56ce68 nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x56ce68 match=0801 multicast=0 nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress) nl80211: Register frame match - hexdump(len=2): 08 01 nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x56ce68 match=06 multicast=0 nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress) nl80211: Register frame match - hexdump(len=1): 06 nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x56ce68 match=0a07 multicast=0 nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress) nl80211: Register frame match - hexdump(len=2): 0a 07 nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x56ce68 match=0a11 multicast=0 nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress) nl80211: Register frame match - hexdump(len=2): 0a 11 nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x56ce68 match=1101 multicast=0 nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress) nl80211: Register frame match - hexdump(len=2): 11 01 nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x56ce68 match=1102 multicast=0 nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress) nl80211: Register frame match - hexdump(len=2): 11 02 nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x56ce68 match=0505 multicast=0 nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress) nl80211: Register frame match - hexdump(len=2): 05 05 nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x56ce68 match=0500 multicast=0 nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress) nl80211: Register frame match - hexdump(len=2): 05 00 nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x56ce68 match=1301 multicast=0 nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress) nl80211: Register frame match - hexdump(len=2): 13 01 nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x56ce68 match=1305 multicast=0 nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress) nl80211: Register frame match - hexdump(len=2): 13 05 nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x56ce68 match=7e506f9a1a multicast=0 nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress) nl80211: Register frame match - hexdump(len=5): 7e 50 6f 9a 1a nl80211: Failed to register Action frame processing - ignore for now rfkill: initial event: idx=0 type=1 op=0 soft=0 hard=0 netlink: Operstate: ifindex=2 linkmode=1 (userspace-control), operstate=5 (IF_OPER_DORMANT) Add interface wlan0 to a new radio phy0 nl80211: Regulatory information - country=00 nl80211: 2402-2472 @ 40 MHz 20 mBm nl80211: 2457-2482 @ 20 MHz 20 mBm (no IR) nl80211: 2474-2494 @ 20 MHz 20 mBm (no OFDM) (no IR) nl80211: 5170-5250 @ 80 MHz 20 mBm (no IR) nl80211: 5250-5330 @ 80 MHz 20 mBm (DFS) (no IR) nl80211: 5490-5730 @ 160 MHz 20 mBm (DFS) (no IR) nl80211: 5735-5835 @ 80 MHz 20 mBm (no IR) nl80211: 57240-63720 @ 2160 MHz 0 mBm nl80211: Added 802.11b mode based on 802.11g information nl80211: Mode IEEE 802.11g: 2412 2417 2422 2427 2432 2437 2442 2447 2452 2457 2462 2467[NO_IR] 2472[NO_IR] 2484[DISABLED] nl80211: Mode IEEE 802.11b: 2412 2417 2422 2427 2432 2437 2442 2447 2452 2457 2462 2467[NO_IR] 2472[NO_IR] 2484[DISABLED] wlan0: Own MAC address: cc:b8:5e:f5:a6:86 wpa_driver_nl80211_set_key: ifindex=2 (wlan0) alg=0 addr=(nil) key_idx=0 set_tx=0 seq_len=0 key_len=0 key_flag=0x10 nl80211: DEL_KEY broadcast key wpa_driver_nl80211_set_key: ifindex=2 (wlan0) alg=0 addr=(nil) key_idx=1 set_tx=0 seq_len=0 key_len=0 key_flag=0x10 nl80211: DEL_KEY broadcast key wpa_driver_nl80211_set_key: ifindex=2 (wlan0) alg=0 addr=(nil) key_idx=2 set_tx=0 seq_len=0 key_len=0 key_flag=0x10 nl80211: DEL_KEY broadcast key wpa_driver_nl80211_set_key: ifindex=2 (wlan0) alg=0 addr=(nil) key_idx=3 set_tx=0 seq_len=0 key_len=0 key_flag=0x10 nl80211: DEL_KEY broadcast key
最新发布
06-06
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值