Detailed explanation of Android getevent usage examples

Detailed explanation of Android getevent usage examples

Recently, there are common commands for testing equipment buttons. I feel that these commands are available, but I just don't know how to find them.

After reading several blogs, I found a getevent, which refers to such a command

First of all, the getevent command can be followed by specific input devices, such as getevent / dev / Iput / event0, so that some input devices that do not need to be displayed can be filtered out

In my previous use, I still couldn't find some ideas, and I used them step by step.

First, look at the - P option, which is used to output some information related to the input device. For example, getevent - P / dev / input / event0:

The - I option is similar to the - P option, but displays more information. Getevent - I / dev / input / event0:

The - P or - I option can help us determine whether the input device has been successfully registered

Let's look at the - L option again. First, let's take a look without the - L option. Enter the getevent / dev / input / event7 command. Note that event7 is the input device of the touch screen:

You see, what you get is a set of information. If you only look at the numbers, you don't know the specific meaning. What if you add the - L option, getevent - L / dev / input / event7:

We can see that it is much easier to understand. The formats are event type, event code and event value. For the meanings represented by these, please refer to the relevant things of the input device.

Look at the - R option, which can output the rate of input reports, for example, getevent - R / dev / input / event7:

Using this option can help us check whether the rate of the input report meets our requirements, such as TP reporting rate.

The getevent command options are briefly introduced. For other usage, please refer to the above getevent command usage. In addition, these command options can be used in combination, such as getevent -lr / dev / input / event7.

I found these commands when I felt that the physical key instructions could not be found when I detected the device keys.

The corresponding command to getevent is the sendent command, but the sendent command input is a little complex, so you can use another command input instead. For example, enter input keyevent keycode_ Power means to press the power button once.

Thank you for reading, hope to help you, thank you for your support to this site!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>