chiark / gitweb /
bessar gui seems ok now with mouse and keyboard
authorian <ian>
Sun, 13 Jul 2008 23:36:15 +0000 (23:36 +0000)
committerian <ian>
Sun, 13 Jul 2008 23:36:15 +0000 (23:36 +0000)
hostside/gui
hostside/gui-bessar.config

index d731723cacaeb66c29b6c95f4ab1cda088f2929c..1cccbab896f815dfdcf79fd62459c08c77ac7e9f 100755 (executable)
@@ -523,7 +523,7 @@ proc ib-create/wheelmouse {devid wunique desc} {
     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
 }
 
@@ -551,7 +551,7 @@ proc ib-evcmd/wheelmouse {devid target} {
 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
 }
 
@@ -600,8 +600,8 @@ proc ib-ev/ebwikeb/EV_KEY/KEY_CAPSLOCK {devid value} {
 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
@@ -613,7 +613,11 @@ proc ib-ev/ebwikeb/EV_KEY/KEY_BOOKMARKS {devid value} {
 
 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 \
@@ -654,7 +658,7 @@ proc widgets-input-bindings {} {
 #  $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]
@@ -690,17 +694,26 @@ proc scan-input-bindings {} {
     }
     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+]
index e6777539985623cacb94658c1364e598b38ac9c9..c84623a6120abb810e4f8106ac0b91976944860b 100644 (file)
@@ -1,2 +1,2 @@
-bind-input 0003 045e 0084 0390 wheelmouse "wheel mouse"
-bind-input-static ./evdev-manip-bessar 
+bind-input 0003 04fc 05d8 0100 ebwikeb
+bind-input 0003 045e 0084 0111 wheelmouse "wheel mouse"