269-815-4150 sales@enventek.com
How Can We Help?

Search for answers or browse our knowledge base.

Documentation | Demos | Support

< All Topics
Print

TouchScreen Flip / Mirror Issue

If a client calls in and mentions that their touchscreen is inverting the pointer (I.e. they touch at the bottom and the mouse moves to the top) add this line to the startup.sh file after the line for export DISPLAY=:0. This typically happens when a user with an old system replaces a computer with a new one and then the touchscreen has this problem.

Place this line just below export DISPLAY=:0

xinput list to list the devices. we are looking for an ELO device and we need to set it as the ID.

xinput set-prop 11 “Coordinate Transformation Matrix” -1 0 1 0 -1 1 0 0 1

NOTE: “prop 11” will change to the touchscreen’s id number (on the last computer with this issue it was 9).

If you add this script it will get the exact elo screen id

#!/bin/bash

# Export DISPLAY variable
export DISPLAY=:0

# Get the ID of the item that contains "Elo"
elo_id=$(xinput list | grep -i "elo" | awk -F'id=' '{print $2}' | awk '{print $1}')

# Check if ID was found
if [ -z "$elo_id" ]; then
    echo "No device containing 'Elo' found."
else
    echo "Device ID for 'Elo' found: $elo_id"

    # File to modify
    startup_file="/mnt/programs/startup.sh"

    # Check if the file exists
    if [ -f "$startup_file" ]; then
        # Check if the DISPLAY variable is already set in the file
        if grep -q "export DISPLAY=:0" "$startup_file"; then
            # Check if the line for xinput set-prop already exists
            if grep -q "xinput set-prop .* \"Coordinate Transformation Matrix\" -1 0 1 0 -1 1 0 0 1" "$startup_file"; then
                # Modify the existing line
                sed -i "s/xinput set-prop .* \"Coordinate Transformation Matrix\" -1 0 1 0 -1 1 0 0 1/xinput set-prop $elo_id \"Coordinate Transformation Matrix\" -1 0 1 0 -1 1 0 0 1/" "$startup_file"
                echo "Modified existing xinput set-prop line in $startup_file to id $elo_id "
            else
                # Add the new line after export DISPLAY=:0
                sed -i "/export DISPLAY=:0/a xinput set-prop $elo_id \"Coordinate Transformation Matrix\" -1 0 1 0 -1 1 0 0 1" "$startup_file"
                echo "Added xinput set-prop line to $startup_file to id $elo_id"
            fi
        else
            # Add both the export DISPLAY line and the xinput set-prop line
            echo -e "export DISPLAY=:0\nxinput set-prop $elo_id \"Coordinate Transformation Matrix\" -1 0 1 0 -1 1 0 0 1" >> "$startup_file"
            echo "Added export DISPLAY and xinput set-prop lines to $startup_file to id $elo_id"
        fi
    else
        echo "File $startup_file does not exist."
    fi
fi
Table of Contents