upvar #0 input/$devid in
set w .inputs.$wunique
speedw-new $w $desc
- pack $w -side top -padx 10
+ pack $w -side left -padx 10
set in(speedw) $w
}
proc ib-create/ebwikeb {devid wunique} {
upvar #0 input/$devid in
set in(desc) "main keyboard"
- ib-create/wheelmouse $devid $wunique $desc
+ ib-create/wheelmouse $devid $wunique $in(desc)
set in(modifiers) 0
}
proc ib-ev/ebwikeb/EV_KEY/KEY_BOOKMARKS {devid value} {
upvar #0 input/$devid in
if {!$value} return
- if {!($in(mod) & 0xff00)} return
- if {$in(mod) & 0x00ff} {
+ if {!($in(modifiers) & 0xff00)} return
+ if {$in(modifiers) & 0x00ff} {
set how stop
} else {
set how auto
proc ib-evcmd-construct {devid target xargs} {
upvar #0 input/$devid in
- manyset $target ev sysfs
+ if {[llength $target] > 1} {
+ debug "ib $devid - multiple devices, not supported"
+ return {}
+ }
+ manyset [lindex $target 0] ev sysfs
if {[regexp { } $ev]} { error "event device `$ev' contains space" }
return [concat \
[list ./evdev-manip --redact] $xargs \
# $in(speedw) optional, may be set by ib-create
proc scan-input-bindings {} {
- global errorInfo errorCode
+ global errorInfo errorCode unmatched_notified
global input_bindings inputretryadd inputretrymax scaninputinterval
if {[catch {
set f [open /proc/bus/input/devices]
}
close $f
foreach devid [array names target] {
- if {[llength $target($devid)] > 1} { unset target($devid); continue }
upvar #0 input/$devid in
- if {![info exists in(concrete)]} continue
+ if {![info exists in(concrete)]} {
+ if {![info exists unmatched_notified($devid)]} {
+ debug "ib $devid unmatched, ignored"
+ set unmatched_notified($devid) 1
+ }
+ continue
+ }
if {[info exists in(chan)]} continue
set now [clock seconds]
set newlast [expr {$in(laststart) + $inputretryadd}]
if {$newlast > $now + $inputretrymax} continue
if {$newlast < $now} { set newlast $now }
- set in(laststart) $newlast
- set cmdl [eval [list ib-evcmd/$in(concrete) $devid] $target($devid)]
+ set cmdl [ib-evcmd/$in(concrete) $devid $target($devid)]
+ if {![llength $cmdl]} {
+ unset target($devid)
+ continue
+ }
lappend cmdl 2>@ stderr
+ set in(laststart) $newlast
catch-for-input-binding $devid {
debug "ib $devid running $cmdl"
set in(chan) [open |$cmdl r+]