Skip to content
Discussion options

You must be logged in to vote

I did it like this. After changing monitor focus, the cursor is moves to the calculated touch position, simulates a click, and returns to its original saved position

#!/bin/bash
TOUCH_DEVICE="/dev/input/event10"

# Touchscreen parameters
TOUCH_MAX_X=9600
TOUCH_MAX_Y=9600

# Monitor DP-5 parameters
MONITOR_X=0         # monitor starting position
MONITOR_Y=2560
MONITOR_WIDTH=682
MONITOR_HEIGHT=2560

process_touch_event() {
    if echo "$line" | grep -q "ABS_MT_POSITION_X.*value"; then
        touch_x=$(echo "$line" | grep -o "value [0-9]*" | cut -d' ' -f2)
    fi

    if echo "$line" | grep -q "ABS_MT_POSITION_Y.*value"; then
        touch_y=$(echo "$line" | grep -o "value [0-9]*" | cut -d'…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@ZenyAization
Comment options

Answer selected by ZenyAization
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants