I've got a NVidia GTX260 card with one regular screen above one touchscreen using the eGalax driver.

I've tried to configure the touchscreen using xinput but I can't get it right. With the normal screen disconnected and fiddling with the "Evdev Axis Calibration" option it works fine, but when I hook up the normal screen again the tough mapping is shifted. If I touch the touchscreen the mouse moves to the corresponding position on the other screen.

Neither "Coordinate Transformation Matrix" nor "map-to-output" seems to work...

Any help is greatly appreciated!


  • Not an answer, but a question for Beni. This seems to be going in the right direction to fix my problem as well. However, I don't believe that I am using the correct <touch input device> info for step 2. How can I determine precisely what to put in the <touch input device> brackets? Great post BTW – user164769 Jun 5 '13 at 21:00

I now (on 13.04) had a similar problem but xinput map-to-output did help, if I do things in the right order.

xinput map-to-output tweaks the "Coordinate Transformation Matrix".
xinput_calibrator sets "Evdev Axis Calibration" and is completely unaware of "Coordinate Transformation Matrix". It also always opens stretched to the full available output area.

This means that you must run xinput_calibrator on a single screen.

  1. xrandr --output <non-touch-output> --off

  2. xinput map-to-output <touch input device> <touch-output>
    (to reset "Coordinate Transformation Matrix" in case you've touched it before).

  3. Calibrate with xinput_calibrator.
    You should now have well-calibrated touch on the single screen.
    (My touchscreen was initially way off — X/Y swapped, Y inverted — so I had to run this twice, with --misclick 0. I believe that's a property of my touchscreen, unrelated to the dual monitor situation.)

  4. Re-enable the second screen.
    xrandr --output <non-touch-output> --on

  5. Do map-to-output again.

  • 1
    Thank you, worked for me! For those wondering you can get your list of output devices by running xrandr on it's own, mine have IDs like "eDP1", "VGA1", "HDMI1" etc. You can get the list of input devices by running xinput --list. On my laptop for example it gives the line ↳ ELAN Touchscreen id=12 [slave pointer (2)], from which I get an ID of 12. So for step 2) I would type xinput map-to-output 12 eDP1 – Jason O'Neil Jun 17 '14 at 3:28
  • Unfortunately, this answer did very little to help me with my touchscreen issue, even though I learned about xrandr and how to use it. – ThN Jan 27 '20 at 18:59

While Beni's answer will probably work for some (if not most) people, in my case xinput_calibrator was still getting confused despite the other displays being disabled. I also wasn't partial to installing closed-source drivers from the vendor.

Fortunately, using the information in this very QA and other sources (the EVDEV xorg documentation, and this answer), it turns out it's completely possible to set up everything manually as long as you're using EVDEV and Xorg (default for Kubuntu currently at least).

Single-session setup (via xinput)

  1. Find the device ID via xinput --list. This will be referred to as <DEVICE_ID>.
  2. Run xinput --list-prop <DEVICE-ID> and note down the default values just in case.
  3. Set up the Coordinate Transformation Matrix property. The easiest way would be installing ptxconf from Hrobjartur's answer and using its configure option.
  4. You're now ready to set up axes. The first step is checking whether the X and Y coords are swapped with one another. To do this:
    • press your finger/stylus on the top of your screen,
    • and on the bottom. If the mouse pointer appears on the left and right (or vice versa), run: xinput --set-prop <DEVICE_ID> "Evdev Axes Swap" 1. Otherwise, leave this property unchanged.
  5. Now, check whether the X and/or Y axes need to be inverted. This is controlled by the Evdev Axis Inversion property, with two values - X Y, where 0 is normal and 1 is inverted. So:
    • check whether pressing on the far left of the screen places your cursor on the right. If so, you need to invert X.
    • check whether pressing on the very top of the screen places your cursor at the bottom. If so, you need to invert Y.
    • For example, inverting X and and leaving Y unchanged means running: xinput --set-prop <DEVICE_ID> "Evdev Axis Inversion" 1 0.
  6. Now we get to the fun stuff - calibration. The Evdev Axis Calibration property controls it, and it's theoretically vendor specific, but it's possible to figure it out with a bit of prodding (literally). Here's what you need to do:
    • check whether Evdev Axis Calibration was reset (it happened in my case after running ptxconf). If so, run xinput --set-prop <DEVICE_ID> "Evdev Axis Calibration" <DEFAULT_VALUES_FROM_POINT_1> (take note that while the values are comma-separated in the output, they should be space-seperated in the input).
    • the values could be described, at least in my case, as <FAR_RIGHT_OFFSET> <FAR_LEFT_OFFSET> <VERY_TOP_OFFSET> <VERY_BOTTOM_OFFSET>.
    • take your stylus, and start poking at the far right offset. Adjust the first value until the pointer is under your stylus. Don't worry if the pointer is off-target on the other axis.
    • do the same for the far left offset. Check if the offset on the right is still correct, if not, tweak the two values until you have a match.
    • do the same with the other two offsets.
    • check if the pointer is correctly placed on the far left middle, far right middle, top center, and bottom center of your screen. If so, you're good to go.
  7. Run xinput --list-props <DEVICE_ID> and note down your final values. That's it!

Permament setup (via xorg conf)

As the xinput_calibration output notes, to get the setting to stick you need to add a cofiguration file to your xorg conf's dir (it's /usr/share/X11/xorg.conf.d/ on Ubuntu, named with a sufficiently low priority - like 99-calibration.conf in the example provided).

Prepare the xinput property values, and check the device name in xinput --list. Now, all you have to do is create the file in the following way:

Section "InputClass"
        Identifier                      "calibration"
        MatchProduct                    "<DEVICE_NAME_FROM_XINPUT_LIST>"
        Option  "TransformationMatrix"  "<VALUES_FROM(Coordinate Transformation Matrix)>"
        Option  "Calibration"           "<VALUES_FROM(Evdev Axis Calibration)>"
        Option  "SwapAxes"              "<VALUE_FROM(Evdev Axes Swap)>"
        Option  "InvertX"               "<X_VALUE_FROM(Evdev Axis Inversion)>"
        Option  "InvertY"               "<Y_VALUE_FROM(Evdev Axis Inversion)>"

For example:

Section "InputClass"
        Identifier                      "calibration"
        MatchProduct                    "ACME USB Touch"
        Option  "TransformationMatrix"  "0.5656 0.000000 0.676576 0.000000 0.765756 0.756233 0.000000 0.000000 1.000000"
        Option  "Calibration"           "50 1366 25 2876"
        Option  "SwapAxes"              "1"
        Option  "InvertY"               "1"

Check whether everything works after a reboot. And now you're all set!

  • To elaborate on xinput_calibration - while it offers a --geometry option to deal with the problem, it only accepts width and height. So, if your touchscreen is not on (0,0), then you're outta' luck. – mikołak Jun 7 '17 at 20:30
  • This work with Evdev and X, not with currently default libinput and future Wayland. – Pablo Bianchi Feb 4 '18 at 1:45
  • evdev is default for Kubuntu (but thanks for the hint, I haven't realised it's not for Ubuntu). Also, the future is most definitely not now ;). – mikołak Feb 5 '18 at 9:25
  • awesome!!! I got my mouse pointer to work... yahooooo.... thank you... for some odd reason xinput_calibrator did not work correctly for me. After trying so many different ways to try to calibrate my mouse pointer issue, I started to look for manual calibration of mouse pointer and I am glad I found this answer. Thank you. – ThN Jan 27 '20 at 20:45
  • list-props rather than list-prop – Jacques de Hooge Mar 18 '20 at 14:52

for me with Ubuntu 12.04 LTS (64bit) it didn't wort until i saw in the xinput --help that the right command is

xinput map-to-crtc 'Name of input device' Name of output device

while Name of input device is shown by $xinput --list, name of output device is shown be $xrandr and could be LVDS1 oder VGA1 e.g.

  • This is a great answer, but where do you put this command so that it get's executed on startup. I've tried in /etc/lightdm/lightdm.conf but that locks up the entire computer (had to recover via recovery mode) and I've tried in in /etc/rc.local but the command doesn't execute. – Kat Amsterdam Jan 16 '14 at 13:33

If you want a graphical tool that sits in you system tray, then we just created one and would like to see if it is useful to anyone else: Just select your input pen device and which screen to map it to:


We just started so its may have problem identifying your tablet or screens, so please let us know. We'll fix it straight away. Also we plan to have it retain its previous configuration after startup - maybe even remember which config was used for which screen configuration if some people keep adding and removing monitors.

  • Hi Hrobjartur, please take a look here – bummi Jan 19 '16 at 7:47
  • @Hrobjartur Thorsteinsson, Your app is awesome! Worked great for me even on Ubuntu 20.04. I've got 5 monitors in a crazy configuration, so the graphic display saved me a lot of crazy mathing! We'll see if it saves across sessions but this is awesome. I did have to modify the python-appindicator package to remove strict dependances since python2 was removed but worked out! Super easy to use. See Ubuntu 20.04 process here: github.com/wenhsinjen/ptxconf/issues/8 – Supaiku Jun 19 '20 at 6:07

I couldn't quite get my generic / eGalax USB touch-panel working right, on my Mint 18.2 system, with any answer I found on its own, but thought I should share what worked for me.

I first disabled my my non-touch monitor (as suggested by Beni Cherniavsky-Paskin) and calibrated my touch-panel using xinput_calibrator.

Turned my other monitor back on (via the display section of the System Settings panel). At that point the touch panel is well calibrated, but input still maps through both monitors.

To offset it all the way to the desired monitor/area, I then re-mapped the panel's "Coordinate Transformation Matrix" as advised in this manual using

$ xinput set-prop "Device Name" --type=float "Coordinate Transformation Matrix" c0 0 c1 0 c2 c3 0 0 1

For Device Name I used xinput --list to get the touch-panel's id. From the following ouput I got the id 13 :

⎡ Virtual core pointer                      id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ SIGMACH1P USB Keyboard                    id=10   [slave  pointer  (2)]
⎜   ↳ SOAI Gaming Mouse                         id=12   [slave  pointer  (2)]
⎜   ↳ eGalax Inc. USB TouchController           id=13   [slave  pointer  (2)]

I calc'd the params as explained in the mentioned manual. e.g. For me a 768px wide touch-area offset by my 1900px monitor, got me a c0 = 768/(1900+768) = 0.287856. Ended up with this command:

$ xinput set-prop 13 --type=float "Coordinate Transformation Matrix" 0.287856, 0.000000, 0.712114, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000

That got it all running fine. btw I did have some issues, which seem to disappear when I used only 6 decimal places precision for the params idk if that is actually required or, more likely I just had messed-up sth else.

  • wish you had posted all of your calculation for your command. This answer was very helpful. Thank you. – ThN Jan 27 '20 at 19:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.