Check-in [5af8100ac6]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:improve touch calibration package
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 5af8100ac6a17b1db6d3c974a2da5ec30d10d74b
User & Date: chw 2020-01-15 19:34:05
Context
2020-01-15
19:35
improve vncviewer demo check-in: 3368bc1809 user: chw tags: trunk
19:34
improve touch calibration package check-in: 5af8100ac6 user: chw tags: trunk
19:33
more gamecontroller mappings and fix in linux evdev support check-in: a8cd20c93d user: chw tags: trunk
Changes

Changes to assets/touchcal0.1/touchcal.tcl.

150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
...
327
328
329
330
331
332
333

334
335
336
337
338
339
340
341
342

343
344
345
346
347
348
		    [namespace current]::calib_seq $top 3 %x %y
		}
	    }]
	} elseif {$which == 3} {
	    $top.bottomleft.m configure -background "#505075"
	    bind $top <<FingerUp>> {}

	    set thresh [expr {round($xrange * 0.1)}]
	    set swapxy 0
	    if {$cdata(xdev,0) < $cdata(xdev,3) - $thresh ||
		$cdata(xdev,0) > $cdata(xdev,3) + $thresh ||
		$cdata(xdev,1) < $cdata(xdev,2) - $thresh ||
		$cdata(xdev,1) > $cdata(xdev,2) + $thresh} {
		set swapxy 1
		swap cdata(xdev,0) cdata(ydev,0)
		swap cdata(xdev,1) cdata(ydev,1)
		swap cdata(xdev,2) cdata(ydev,2)
		swap cdata(xdev,3) cdata(ydev,3)
	    }

................................................................................
	bind $top <x> [list $top.cal.quit invoke]
	bind $top <X> [list $top.cal.quit invoke]
	bind $top <c> [list $top.cal.doit invoke]
	bind $top <C> [list $top.cal.doit invoke]

	set running 1
	update idletasks

	raise $top
	grab $top
	update idletasks
	focus -force $top
	set RESULT {}
	while {[winfo exists $top]} {
	    tkwait window $top
	}
	set running 0

	return $RESULT
    }

}

package provide touchcal 0.1







|

|
|
<
<







 







>









>






150
151
152
153
154
155
156
157
158
159
160


161
162
163
164
165
166
167
...
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
		    [namespace current]::calib_seq $top 3 %x %y
		}
	    }]
	} elseif {$which == 3} {
	    $top.bottomleft.m configure -background "#505075"
	    bind $top <<FingerUp>> {}

	    set thresh [expr {abs(round($xrange * 0.1))}]
	    set swapxy 0
	    if {abs($cdata(xdev,0) - $cdata(xdev,3)) > $thresh ||
		abs($cdata(xdev,1) - $cdata(xdev,2)) > $thresh} {


		set swapxy 1
		swap cdata(xdev,0) cdata(ydev,0)
		swap cdata(xdev,1) cdata(ydev,1)
		swap cdata(xdev,2) cdata(ydev,2)
		swap cdata(xdev,3) cdata(ydev,3)
	    }

................................................................................
	bind $top <x> [list $top.cal.quit invoke]
	bind $top <X> [list $top.cal.quit invoke]
	bind $top <c> [list $top.cal.doit invoke]
	bind $top <C> [list $top.cal.doit invoke]

	set running 1
	update idletasks
	set oldfocus [focus]
	raise $top
	grab $top
	update idletasks
	focus -force $top
	set RESULT {}
	while {[winfo exists $top]} {
	    tkwait window $top
	}
	set running 0
	catch {focus $oldfocus}
	return $RESULT
    }

}

package provide touchcal 0.1