Android, decoding click low level event

Android, decoding click low level event

Hello everybody, I have completely decoded today the click event, so we can manipulate with all click parameters.

# X,Y will be set pair: where 0048 – X will be set, 104 – square of finger, touched the screen!

sendevent /dev/input/event2 0003 0048 000000104
# X,Y will be set pair: where 50 – Y will be set, 10 is a constant value. This event is optional.

sendevent /dev/input/event2 0003 0050 000000010

# SET X,Y pair: where 53 – set X, 122 is X coordinate

sendevent /dev/input/event2 0003 0053 000000122

# SET X,Y pair: where 54 – set Y, 312 is Y coordinate

sendevent /dev/input/event2 0003 0054 000000312

# X,Y WAS SET MARKER

sendevent /dev/input/event2 0000 0002 00000000

# FINGER TOUCHED THE SCREEN (FINGER DOWN): 0018 optional, 0020 – finger down.

sendevent /dev/input/event2 0003 0018 00000047

sendevent /dev/input/event2 0003 0020 00000001

# Finger touched screen at 122,312 with 104 square of the touch (I think 10.2*10.2 px square)

# All zero values event should separate logical parts of events and means that finger down

# event is completed

sendevent /dev/input/event2 0000 0000 00000000

# Duplicated events for finger down. Finger is going up with zero touch square

sendevent /dev/input/event2 0003 0048 00000000

sendevent /dev/input/event2 0003 0050 00000010

# Duplicated events for finger down. Finger is going up at 122,312

sendevent /dev/input/event2 0003 0053 000000122

sendevent /dev/input/event2 0003 0054 000000312

# Duplicated separator

sendevent /dev/input/event2 0000 0002 00000000

# Duplicated events for finger up. 0020 with 0000000 arg means finger is releasing.

# Same with finger down, only 0020 0000000 instead of 0020 00000001

sendevent /dev/input/event2 0003 0018 00000032

sendevent /dev/input/event2 0003 0020 00000000

# Event is over

sendevent /dev/input/event2 0000 0000 00000000

Main information here is that 000000104 – square of the touched area. I think all other stuff is well known.

I have debugged this value, and normal thin fast click should be near <50. Also I think this value is used somehow to compute difference for x,y when swipe or slide occurs. Because 122,312 point – it is just 1px. But finger touched 104 pixels!

I have used sendevent /dev/input/event2 in example, to allow you immediately check the click on the screen using shell script.

Basic tutorial how to reproduce motion events using low level shell commands

Happy decoding (:

Best regards,

Yahor

Want to stay updated on the latest tech news?

Sign up for our monthly blog newsletter in the form below.

Softteco Logo Footer