set in(speedw) $w
}
+proc ib-evcmd/wheelmouse {devid target} {
+ return [ib-evcmd-construct $devid $target --grab]
+}
+
#---------- input device evdev binding ----------
+proc ib-evcmd-construct {devid target xargs} {
+ upvar #0 input/$devid in
+ manyset $target ev sysfs
+ return [concat \
+ [list ./evdev-manip] $xargs \
+ [list --stdin-monitor \
+ --expect-sysfs /sys$sysfs/$ev/dev \
+ /dev/input/$ev]]
+}
+
proc bind-input {bus vendor product version concrete args} {
global input_bindings
set devid $bus:$vendor:$product:$version
if {$newlast > $now + $inputretrymax} continue
if {$newlast < $now} { set newlast $now }
set in(laststart) $newlast
- if {[catch { info args ib-evcmd/$in(concrete) }]} {
- manyset [lindex $target($devid) 0] ev sysfs
- set cmdl [list 2>@ stderr ./evdev-manip --grab --stdin-monitor \
- --expect-sysfs /sys$sysfs/$ev/dev \
- /dev/input/$ev]
- } else {
- set cmdl [eval [list ib-evcmd/$in(concrete) $devid] \
- $target($devid)]
- }
+ set cmdl [eval [list ib-evcmd/$in(concrete) $devid] $target($devid)]
+ lappend cmdl 2>@ stderr
catch-for-input-binding $devid {
debug "ib $devid running $cmdl"
set in(chan) [open |$cmdl r+]