reinderien / xcalibrate

X.org touchscreen calibrator
MIT License
51 stars 18 forks source link

feat: allows to set screen geometry #14

Open ArielGMachado opened 9 months ago

ArielGMachado commented 9 months ago

When we have multiple monitors, and only one of them is a touchscreen, we have to be able to define the width, height, xoffset yoffset of the area that will actually be used by the touch screen to create the calibration window. Example if we have two 800x600 monitors X-Window will be considered as a screen size of width x height: 1600x600, creating a cambas with "1600x600" geometry However, the touchscreen monitor is X-offset 800, so the correct geometry should be "800x600+800+0" This PR allows you to override and introduce the detected screen width and height and indicate the XOFF and YOFF offset values that will be used by Canvas for calibration.

Example based on two 800x600 monitors, where the touchsreen is at xoffset 800:

root@ws1t1:~# ./xcalibrate
Pointer devices:
  ID                                Name
   4          Virtual core XTEST pointer
  11      HID 0566:3107 Consumer Control
  13 EloTouchSystems,Inc Elo TouchSystems 2216 AccuTouch® USB Touchmonitor Interface
  15  PixArt Microsoft USB Optical Mouse

Device to calibrate [13]: 

Old calibration:
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

Calibrate? [y]: 
Point count (min 3) [4]: 
Disable rotation? [y]: 

Screen width [1600]: 800
Screen height [600]: 
Screen X-offset [0]: 800
Screen Y-offset [0]: 
Geometry: 800x600+800+0