A generic touchscreen calibration program for X.Org
Revision | 9dbf13316a96768149a6d9c09ce2afa705bec74c (tree) |
---|---|
Time | 2010-08-16 06:52:23 |
Author | Tias Guns <tias@ulys...> |
Commiter | Tias Guns |
clean up explanation of making calibration permanent for evdev
No hal policy file because older evdevs can not be set using a config, and newer ones will be bundled with xorg.conf.d support
@@ -213,27 +213,30 @@ bool CalibratorEvdev::finish_data(const XYinfo new_axys, int swap_xy) | ||
213 | 213 | XSync(display, False); |
214 | 214 | |
215 | 215 | |
216 | - // on stdout: ways to make calibration permanent | |
217 | - printf("\n\n== Saving the calibration ==\n"); | |
218 | - // create startup script | |
219 | - printf("If you have the 'xinput' tool installed, a simple way is to create a script that starts with your X session, containing the following command(s):\n"); | |
220 | - printf(" xinput set-int-prop \"%s\" \"Evdev Axis Calibration\" 32 %d %d %d %d\n", device_name, new_axys.x_min, new_axys.x_max, new_axys.y_min, new_axys.y_max); | |
221 | - if (swap_xy) | |
222 | - printf(" xinput set-int-prop \"%s\" \"Evdev Axes Swap\" 8 %d\n", device_name, new_swap_xy); | |
223 | - printf("See scripts/xinput_calibrator_pointercal.sh for an example used on mobile devices\n"); | |
216 | + // TODO: detect which are applicable at runtime/in the makefile ? | |
217 | + printf("\n\n--> How to make the calibration permanent <--\n"); | |
218 | + printf("On recent systems you can create an xorg.conf.d snippet, on older systems you have to create a script with the xinput commands:\n\n"); | |
224 | 219 | |
225 | 220 | // xorg.conf.d snippet |
226 | - printf("\nxorg.conf.d snippet (RECOMMENDED): copy the snippet below into /etc/X11/xorg.conf.d/99-calibration.conf\n"); | |
221 | + printf("* xorg.conf.d snippet (RECOMMENDED)\n"); | |
222 | + printf(" copy the snippet below into '/etc/X11/xorg.conf.d/99-calibration.conf'\n"); | |
227 | 223 | printf("Section \"InputClass\"\n"); |
228 | 224 | printf(" Identifier \"calibration\"\n"); |
229 | 225 | printf(" MatchProduct \"%s\"\n", device_name); |
230 | 226 | printf(" Option \"Calibration\" \"%d %d %d %d\"\n", |
231 | 227 | new_axys.x_min, new_axys.x_max, new_axys.y_min, new_axys.y_max); |
232 | - if (swap_xy) | |
228 | + if (swap_xy != 0) | |
233 | 229 | printf(" Option \"SwapAxes\" \"%d\"\n", new_swap_xy); |
234 | 230 | printf("EndSection\n"); |
235 | 231 | printf("\n"); |
236 | 232 | |
233 | + // create startup script | |
234 | + printf("* xinput commands (for older systems)\n"); | |
235 | + printf(" Install the 'xinput' tool and copy the command(s) below in a script that starts with your X session\n"); | |
236 | + printf(" xinput set-int-prop \"%s\" \"Evdev Axis Calibration\" 32 %d %d %d %d\n", device_name, new_axys.x_min, new_axys.x_max, new_axys.y_min, new_axys.y_max); | |
237 | + if (swap_xy) | |
238 | + printf(" xinput set-int-prop \"%s\" \"Evdev Axes Swap\" 8 %d\n", device_name, new_swap_xy); | |
239 | + | |
237 | 240 | return success; |
238 | 241 | } |
239 | 242 |