summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpingc <pingc>2007-12-14 00:56:11 +0000
committerpingc <pingc>2007-12-14 00:56:11 +0000
commit50cb6085d0fbeb2f9e8d9796c0adb5d5631ea6d9 (patch)
tree612543aef24a73601ed3ec3782b9be56bf42f429
parent6e4606b1b969e4366c33e4319bb6e3cfd4c5c29e (diff)
downloadxf86-input-wacom-50cb6085d0fbeb2f9e8d9796c0adb5d5631ea6d9.tar.gz
Clean support of outbound tracking for Bamboorelease-0.7.9-4
-rw-r--r--ChangeLog5
-rwxr-xr-xsrc/wacomxi/wacomcpl-exec276
-rwxr-xr-xsrc/xdrv/wcmCommon.c9
-rwxr-xr-xsrc/xdrv/wcmConfig.c5
-rw-r--r--src/xdrv/wcmXCommand.c18
-rwxr-xr-xsrc/xdrv/xf86Wacom.c47
-rwxr-xr-xsrc/xdrv/xf86Wacom.h20
7 files changed, 218 insertions, 162 deletions
diff --git a/ChangeLog b/ChangeLog
index 9ff2a57..b1f4268 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-12-13 Ping Cheng <pingc@wacom.com>
+ * Updated wacomcpl
+ * Incorporated Xorg 7.3 workaround from Magnus Vigerlöf
+ * Label 0.7.9-4
+
2007-11-28 Ping Cheng <pingc@wacom.com>
* Clean support of outbound tracking for Bamboo, etc
* Updated kernel 2.4.x code
diff --git a/src/wacomxi/wacomcpl-exec b/src/wacomxi/wacomcpl-exec
index b7c9805..48eef15 100755
--- a/src/wacomxi/wacomcpl-exec
+++ b/src/wacomxi/wacomcpl-exec
@@ -308,10 +308,10 @@ proc updateScreenList {} {
}
proc disableButtons {} {
- global bName numButton currentW currentb
+ global bName numButton numStrips currentW currentb
if { $currentb } {
- for { set i 1 } { $i <= $numButton } { incr i 1 } {
+ for { set i 1 } { $i <= [ expr ($numButton+$numStrips) ] } { incr i 1 } {
.allothers.f.$i configure -state disabled
}
.allothers.f.ok configure -state disable
@@ -338,7 +338,7 @@ proc disableButtons {} {
proc getDeviceOptionProc { dev i } {
global getOption getOptionDefault Option oldKeys spName numButton
- global modeToggleB ignoreButton doubleClickB keystrokeB
+ global modeToggleB ignoreButton doubleClickB keystrokeB numStrips
for { set j 1 } { $j < [ expr $i+1 ] } { incr j 1 } {
set value [ exec xsetwacom get $dev $Option($j) ]
@@ -369,35 +369,30 @@ proc getDeviceOptionProc { dev i } {
}
} else {
set match 0
- # are they wheel/ring/strips?
- for { set k 1 } { $k <= 8 } { incr k 1 } {
+ # are they button/wheel/ring/strip?
+ for { set k 1 } { $k <= [ expr ($numButton+$numStrips) ] } { incr k 1 } {
if { ![string compare -nocase $Option($j) $spName($k)] } {
- set k 9
set match 1
+ break
}
}
+ set getOption($dev,$Option($j)) $value
if { $match } {
if { ($value > $doubleClickB) || ($value == 0) } {
- set output [ exec xsetwacom get $dev $Option($j) ]
- set outputd [ lindex $output 0 ]
- if { ![string compare -nocase -length 8 DBLCLICK $outputd ] } {
+ if { ![string compare -nocase -length 8 DBLCLICK $value ] } {
set getOption($dev,$Option($j)) $doubleClickB
}
- if { ![string compare -nocase -length 4 "Core" $outputd ] } {
+ if { ![string compare -nocase -length 4 CORE $value ] } {
set getOption($dev,$Option($j)) $keystrokeB
- set oldKeys($Option($j)) $output
+ set oldKeys($Option($j)) $value
}
- if { ![string compare -nocase -length 10 MODETOGGLE $outputd ] } {
- set getOption($dev,$Option($j)) $modetoggleB
+ if { ![string compare -nocase -length 10 MODETOGGLE $value ] } {
+ set getOption($dev,$Option($j)) $modeToggleB
}
- if { ($value == 0) } {
+ if { $value == 0 } {
set getOption($dev,$Option($j)) $ignoreButton
}
- } else {
- set getOption($dev,$Option($j)) $value
}
- } else {
- set getOption($dev,$Option($j)) $value
}
set getOptionDefault($dev,$Option($j)) $value1
}
@@ -405,8 +400,8 @@ proc getDeviceOptionProc { dev i } {
}
proc updateDevice {} {
- global device deviceIndex getOption hasPad isLCD
- global numScreens getDeviceModel Option
+ global device deviceIndex hasPad isLCD
+ global numScreens getDeviceModel
set olddev $device
set device [ .workingDev.list get anchor ]
@@ -426,9 +421,6 @@ proc updateDevice {} {
.workingDev.label configure -text $device
set model $getDeviceModel($device,model)
set type $getDeviceModel($device,type)
- set Option(1) "Mode"
- getDeviceOptionProc $device 1
- set mode $getOption($device,Mode)
destroy .panel
if { ![ string compare $type "pad" ] } {
if { $hasPad($model) } {
@@ -563,13 +555,17 @@ proc displayScreenList { dev } {
proc updateButton {} {
global device getDeviceModel sm getOption spName isLCD
- global dm currentW oldKeys numButton cKeys numStrips
+ global dm currentW oldKeys numButton cKeys numStrips startS
global modeToggleB ignoreButton doubleClickB keystrokeB
set type $getDeviceModel($device,type)
set model $getDeviceModel($device,model)
for { set i 1 } { $i <= [ expr ($numButton + $numStrips)] } { incr i 1 } {
+ set k $i
+ if { $i > $numButton } {
+ set k [ expr ($startS-1+$i) ]
+ }
switch [ $currentW.f.$i cget -text ] {
"Left"
{ set j 1
@@ -594,23 +590,23 @@ proc updateButton {} {
set v "ModeToggle 1" }
"KeyStroke"
{ set j $keystrokeB
- set v $cKeys($spName($i))
- set oldKeys($spName($i)) $cKeys($spName($i)) }
+ set v $cKeys($spName($k))
+ set oldKeys($spName($k)) $cKeys($spName($k)) }
"Ignore"
{ set j $ignoreButton
set v "Button 0" }
}
- set getOption($device,$spName($i)) $j
- updateXinitrc $device $spName($i) $v
+ set getOption($device,$spName($k)) $j
+ updateXinitrc $device $spName($k) $v
# reset key strokes
if { $j != $keystrokeB } {
- set $oldKeys($spName($i)) ""
- set cKeys($spName($i)) ""
+ set $oldKeys($spName($k)) ""
+ set cKeys($spName($k)) ""
}
}
- if { !isLCD($model) && [string compare $type "pad"] } {
+ if { !$isLCD($model) && [string compare $type "pad"] } {
set mode [ $currentW.f.mode cget -text ]
updateXinitrc $device mode $mode
if { $mode == $dm(1) } {
@@ -635,18 +631,24 @@ proc updateButton {} {
proc defaultButton {} {
global db db1 db2 db3 db4 db5 db6 db7 db8 db9 db10
- global db11 db12 db13 db14 isLCD
- global dm sm dmv smv numButton
+ global db11 db12 db13 db14 isLCD spName
+ global dm sm dmv smv numButton startS numStrips
global device getOptionDefault getDeviceModel
for { set i 1 } { $i <= $numButton } { incr i 1 } {
- set db$i $db($i)
+ set db$i $db($getOptionDefault($device,$spName($i)))
+ }
+
+ if { $startS } {
+ for { set i $startS } { $i <= [ expr ($startS+$numStrips-1) ] } { incr i 1 } {
+ set db$i $db($getOptionDefault($device,$spName([ expr ($numButton+$i) ])))
+ }
}
set model $getDeviceModel($device,model)
set type $getDeviceModel($device,type)
- if { !$isLCD($model) } {
+ if { !$isLCD($model) && [ string compare $type "pad" ] } {
set dmv $dm([ expr $getOptionDefault($device,Mode)+1 ])
}
@@ -681,11 +683,13 @@ proc getNumButton { type } {
}
proc setspName {} {
- global numButton spName
+ global numButton spName numStrips startS device Option cKeys oldKeys
+ global numPadRelW numPadStrips numPadRings getDeviceModel
for { set i 1 } { $i <= $numButton } { incr i 1 } {
set spName($i) Button$i
}
+ getDeviceOptionProc $device $numButton
set spName([expr ($numButton + 1) ]) "RelWUp"
set spName([expr ($numButton + 2) ]) "RelWDn"
@@ -695,18 +699,42 @@ proc setspName {} {
set spName([expr ($numButton + 6) ]) "StripLDn"
set spName([expr ($numButton + 7) ]) "StripRUp"
set spName([expr ($numButton + 8) ]) "StripRDn"
+
+ for { set i 1 } { $i <= 8 } { incr i 1 } {
+ set Option($i) $spName([expr ($numButton + $i)])
+ }
+ getDeviceOptionProc $device 8
+
+ set s1 5
+ set s2 8
+ set model $getDeviceModel($device,model)
+ if { $numPadRelW($model) } { # G4
+ set s1 1
+ set s2 2
+ } elseif { $numPadStrips($model) == 1 } { # I3 4x5
+ set s1 5
+ set s2 6
+ } elseif { $numPadRings($model) } { # Bamboo
+ set s1 3
+ set s2 4
+ }
+ set startS $s1
+ set numStrips [expr ($s2 - $s1) + 1]
+
+ # initial keys
+ for { set i 1 } { $i <= [ expr ($numButton + 8) ] } { incr i 1 } {
+ set oldKeys($spName($i)) ""
+ set cKeys($spName($i)) ""
+ }
}
proc initialButton {} {
- global device Option numButton getDeviceModel spName numStrips
+ global device Option numButton getDeviceModel
+ global spName numStrips
set type $getDeviceModel($device,type)
- # buttons
- getNumButton $type
set t $numButton
- setspName
-
if { [ string compare $type "pad" ] } {
set t [expr ($t+1)]
set Option($t) "Mode"
@@ -714,7 +742,9 @@ proc initialButton {} {
set Option($t) "TPCButton"
}
getDeviceOptionProc $device $t
- displayMode
+ if { [ string compare $type "pad" ] } {
+ displayMode
+ }
for { set i 1 } { $i <= $numButton } { incr i 1 } {
addMenu $i
@@ -757,11 +787,11 @@ proc displayMode {} {
}
}
-proc displaySubWindow { okF deF initial winID cbutton } {
- global currentb currentW wName
+proc displaySubWindow { okF deF initial winID cbutton kcurrent} {
+ global currentb currentW wName currentk
set currentb $cbutton
-
+ set currentk $kcurrent
if { $cbutton } {
set currentW .keystrokes
} else {
@@ -808,13 +838,12 @@ proc closeTabWindow {} {
if { $bName(keystroke) } {
set bName(keystroke) 0
set currentW .allothers
- for { set i 1 } { $i <= $numButton } { incr i 1 } {
+ for { set i 1 } { $i <= [ expr ($numButton+$numStrips) ] } { incr i 1 } {
$currentW.f.$i configure -state normal
}
$currentW.f.default configure -state normal
$currentW.f.ok configure -state normal
$currentW.f.cancel configure -state normal
- set cKeys($spName($currentb)) ""
set currentb 0
} else {
if { $bName(pressure) } {
@@ -832,7 +861,7 @@ proc closeTabWindow {} {
if { $bName(advanced) } {
.panel.advanced configure -state normal
}
- for { set i 1 } { $i <= [expr ($numButton + $numStrips)] } { incr i 1 } {
+ for { set i 1 } { $i <= [ expr ($numButton+$numStrips) ] } { incr i 1 } {
set cKeys($spName($i)) ""
}
bindtags .workingDev.list $workingTags
@@ -841,16 +870,12 @@ proc closeTabWindow {} {
proc expressKeys { } {
global db db1 db2 db3 db4 db5 db6 db7 db8 db9 db10
- global db11 db12 db13 db14
+ global db11 db12 db13 db14 startS
global currentW device numButton spName numStrips
global Option getOption getDeviceModel cKeys oldKeys
global doubleClickB ignoreButton modeToggleB keystrokeB
global numPadRings numPadStrips numPadAbsW numPadRelW
- for { set i 1 } { $i <= 8 } { incr i 1 } {
- set Option($i) $spName([expr ($numButton + $i)])
- }
-
set name(1) "Wheel Up"
set name(2) "Wheel Down"
set name(3) "Ring Clockwise"
@@ -860,55 +885,38 @@ proc expressKeys { } {
set name(7) "Right Strip Up"
set name(8) "Right Strip Down"
- getDeviceOptionProc $device 8
-
- set s1 5
- set s2 8
- set model $getDeviceModel($device,model)
- if { $numPadRelW($model) } { # G4
- set s1 1
- set s2 2
- } elseif { $numPadStrips($model) == 1 } { # I3 4x5
- set s1 5
- set s2 6
- } elseif { $numPadRings($model) } { # Bamboo
- set s1 3
- set s2 4
- }
- set numStrips [expr ($s2 - $s1) + 1]
- for { set i $s1 } { $i <= $s2 } { incr i 1 } {
- set cur [ expr ($numButton + $i - $s1 + 1) ]
+ set s2 [expr ($startS + $numStrips) - 1]
+ for { set i $startS } { $i <= $s2 } { incr i 1 } {
+ set cur [ expr ($numButton + $i - $startS + 1) ]
set opt $getOption($device,$Option($i))
if { $opt == "" } { set opt $ignoreButton }
- set cur [ expr ($numButton + $i - $s1 + 1) ]
+ set curOption [ expr ($numButton + $i) ]
set db$cur $db($opt)
-
#reset keys
if { $opt != $keystrokeB } {
set cKeys($Option($i)) ""
set oldKeys($Option($i)) ""
}
set bmenu [ tk_optionMenu $currentW.f.$cur db$cur \
- $db(1) $db(2) $db(3) $db(4) $db(5) ]
+ $db(1) $db(2) $db(3) $db(4) $db(5) $db($ignoreButton) ]
$bmenu insert 6 radiobutton -label "$db($keystrokeB)" \
-variable menvar -command "displaySubWindow \
- updateKeys 0 initialKeys 5 $cur"
- $bmenu insert 7 radiobutton -label "$db($ignoreButton)"
+ updateKeys 0 initialKeys 5 $cur $curOption"
label $currentW.f.name$cur -text "$name($i): "
set t2 [expr ($numButton+1)/2+1]
set t1 0
- if { [expr ($s2 - $s1) > 1] } {
- if { $i == [expr ($s1+1)] || \
- $i == [expr ($s1+3)] } {
+ if { [expr ($s2 - $startS) > 1] } {
+ if { $i == [expr ($startS+1)] || \
+ $i == [expr ($startS+3)] } {
set t2 [expr ($numButton+1)/2+2]
}
if { [expr ($i - $s1) > 1] } {
set t1 2
}
} else {
- if { [expr ($i - $s1) > 0] } {
+ if { [expr ($i - $startS) > 0] } {
set t1 2
}
}
@@ -929,10 +937,9 @@ proc addMenu { curb } {
set opt $getOption($device,$spName($curb))
if { $opt == "" } { set opt $curb }
if { ![string compare $type "pad"] } {
+ # values 30 or larger are special functions
if { ($opt > 8 && $opt < 14) } {
set opt [ expr ($opt-8) ]
- } else {
- set opt $ignoreButton
}
}
set db$curb $db($opt)
@@ -942,24 +949,20 @@ proc addMenu { curb } {
set oldKeys($spName($curb)) ""
}
-
- set bmenu [ tk_optionMenu $currentW.f.$curb db$curb $db(1) $db(2) \
- $db(3) $db(4) $db(5) ]
- set i 5
if { [string compare $type "pad"] } {
- set i [expr ($i+1)]
- $bmenu insert $i radiobutton -label "$db($doubleClickB)"
- if { $model != 144 } {
- set i [expr ($i+1)]
- $bmenu insert $i radiobutton -label "$db($modeToggleB)"
- }
- }
+ set bmenu [ tk_optionMenu $currentW.f.$curb db$curb $db(1) $db(2) \
+ $db(3) $db(4) $db(5) $db($doubleClickB) $db($modeToggleB) $db($ignoreButton) ]
+ set i 8
+ } else {
+ set bmenu [ tk_optionMenu $currentW.f.$curb db$curb $db(1) $db(2) \
+ $db(3) $db(4) $db(5) $db($ignoreButton) ]
+ set i 6
+ }
+
set i [expr ($i+1)]
$bmenu insert $i radiobutton -label "$db($keystrokeB)" \
-variable menvar -command "displaySubWindow \
- updateKeys 0 initialKeys 5 $curb"
- set i [expr ($i+1)]
- $bmenu insert $i radiobutton -label "$db($ignoreButton)"
+ updateKeys 0 initialKeys 5 $curb $curb"
label $currentW.f.name$curb -text "Button $curb: "
set t2 [expr ($curb-1)/2]
@@ -1251,18 +1254,17 @@ proc defaultSet {} {
proc initialKeys {} {
global device getDeviceModel getOption cKeys spName
- global Option oldKeys currentW bName currentb
+ global Option oldKeys currentW bName currentb currentk
frame $currentW.f.panelt
set bName(keystroke) 1
text $currentW.f.panelt.input -width 40 -height 10 \
-yscrollcommand "$currentW.f.panelt.srl_y set"
-
- if { $cKeys($spName($currentb)) != "" } {
- $currentW.f.panelt.input insert end $cKeys($spName($currentb))
+ if { $cKeys($spName($currentk)) != "" } {
+ $currentW.f.panelt.input insert end $cKeys($spName($currentk))
} else {
- if { $oldKeys($spName($currentb)) != "" } {
- $currentW.f.panelt.input insert end $oldKeys($spName($currentb))
+ if { $oldKeys($spName($currentk)) != "" } {
+ $currentW.f.panelt.input insert end $oldKeys($spName($currentk))
}
}
scrollbar $currentW.f.panelt.srl_y -width 10 -command \
@@ -1375,7 +1377,7 @@ proc initialKeys {} {
proc updateKeys {} {
global device oldKeys currentb cKeys spName currentW
global db db1 db2 db3 db4 db5 db6 db7 db8 db9 db10
- global db11 db12 db13 db14
+ global db11 db12 db13 db14 currentk
global doubleClickB ignoreButton modeToggleB keystrokeB
set keys [ $currentW.f.panelt.input get 1.0 end ]
@@ -1388,20 +1390,20 @@ proc updateKeys {} {
}
if { $keys != "" } {
- if { $oldKeys($spName($currentb)) != $keys } {
+ if { $oldKeys($spName($currentk)) != $keys } {
if { [string compare -nocase -length 8 $keys "core key"] } {
- set cKeys($spName($currentb)) "core key $keys"
+ set cKeys($spName($currentk)) "core key $keys"
} else {
- set cKeys($spName($currentb)) $keys
+ set cKeys($spName($currentk)) $keys
}
- set getOption($device,$spName($currentb)) $keystrokeB
- set db$currentb $db($keystroke)
+ set getOption($device,$spName($currentk)) $keystrokeB
+ set db$currentb $db($keystrokeB)
}
} else { # ignore the button
- set getOption($device,$spName($currentb)) $ignoreButton
+ set getOption($device,$spName($currentk)) $ignoreButton
set db$currentb $db($ignoreButton)
}
- if { [ string length $cKeys($spName($currentb)) ] > 240 } {
+ if { [ string length $cKeys($spName($currentk)) ] > 240 } {
helpWindow "Help Window " \
"\n\nYou have entered more 240 keys. \n\
wacomcpl only accepts 240 keys. \n\
@@ -1412,7 +1414,8 @@ proc updateKeys {} {
}
proc createPanel { pressure button mapping calibrate } {
- global bName device getOption getDeviceModel currentb wName
+ global bName device getOption getDeviceModel currentb
+ global wName startS Option
frame .panel
set bName(pressure) $pressure
@@ -1420,9 +1423,14 @@ proc createPanel { pressure button mapping calibrate } {
set bName(mapping) $mapping
set bName(calibrate) $calibrate
set currentb 0
+ set type $getDeviceModel($device,type)
+
+ # buttons and expresskeys
+ getNumButton $type
+ setspName
set SN [ exec xsetwacom get $device ToolSerial ]
- if { $SN && [string compare $getDeviceModel($device,type) "pad"] } {
+ if { $SN && [string compare type "pad"] } {
set hexSN [format %X $SN]
label .panel.sn -text "Serial Number: $hexSN"
grid .panel.sn -row 0 -column 0 -columnspan 2 -padx 3 -pady 3
@@ -1431,25 +1439,25 @@ proc createPanel { pressure button mapping calibrate } {
if { $pressure } {
button .panel.pressure -text $wName(1) \
-state normal -command "displaySubWindow \
- updateTip defaultTip initialTip 1 0"
+ updateTip defaultTip initialTip 1 0 0"
grid .panel.pressure -row 5 -column 0 -columnspan 2 -sticky news -padx 10
}
if { $button } {
if { ![string compare $getDeviceModel($device,type) "pad"] } {
button .panel.button -text $wName(6) \
-state normal -command "displaySubWindow \
- updateButton defaultButton initialButton 6 0"
+ updateButton defaultButton initialButton 6 0 $startS"
} else {
button .panel.button -text $wName(2) \
-state normal -command "displaySubWindow \
- updateButton defaultButton initialButton 2 0"
+ updateButton defaultButton initialButton 2 0 0"
}
grid .panel.button -row 6 -column 0 -columnspan 2 -sticky news -padx 10
}
if { $mapping } {
button .panel.mapping -text $wName(3) \
-state normal -command "displaySubWindow \
- updateT defaultT initialT 3 0"
+ updateT defaultT initialT 3 0 0"
grid .panel.mapping -row 6 -column 3 -columnspan 2 -sticky news -padx 10
}
if { $calibrate } {
@@ -1458,15 +1466,18 @@ proc createPanel { pressure button mapping calibrate } {
grid .panel.calibrate -row 5 -column 3 -columnspan 2 -sticky news -padx 10
}
- set mode [ exec xsetwacom get $device mode ]
- set getOption($device,Mode) $mode
set bName(advanced) 0
- if { ($pressure || $mapping) && $mode } { #not a pad and in absolute mode
- set bName(advanced) 1
- button .panel.advanced -text $wName(4) \
- -state normal -command "displaySubWindow \
- updateSet defaultSet initialSet 4 0"
- grid .panel.advanced -row 9 -column 2 -columnspan 2 -sticky news -padx 10
+ if { [string compare $getDeviceModel($device,type) "pad"] } { #not a pad
+ set Option(1) "Mode"
+ getDeviceOptionProc $device 1
+ set mode $getOption($device,Mode)
+ if { ($pressure || $mapping) && $mode } { #and in absolute mode
+ set bName(advanced) 1
+ button .panel.advanced -text $wName(4) \
+ -state normal -command "displaySubWindow \
+ updateSet defaultSet initialSet 4 0 0"
+ grid .panel.advanced -row 9 -column 2 -columnspan 2 -sticky news -padx 10
+ }
}
grid .panel -row 0 -column 1 -columnspan 8 -sticky news -padx 10 -pady 40
@@ -1518,10 +1529,13 @@ proc updateModelInfo { } {
# I3
set numPadButtons(176) 4
set numPadStrips(176) 1
- for { set i 177 } { $i <= 183 } { incr i 1 } {
+ for { set i 177 } { $i <= 182 } { incr i 1 } {
set numPadButtons($i) 8
set numPadStrips($i) 2
}
+ set numPadButtons(183) 4
+ set numPadStrips(183) 1
+
# Hummingbird
set numPadButtons(198) 10
set numPadStrips(198) 2
@@ -1551,6 +1565,11 @@ proc createControls { } {
set db(3) "Right"
set db(4) "Fourth"
set db(5) "Fifth"
+ set db(6) "Ignore"
+ set db(7) "Ignore"
+ set db(8) "Ignore"
+ set db(9) "Ignore"
+ set db(10) "Ignore"
set db($doubleClickB) "Left Double"
set db($modeToggleB) "Mode Toggle"
set db($ignoreButton) "Ignore"
@@ -1572,12 +1591,7 @@ proc createControls { } {
# up to the max number of buttons
set numButton 10
set numStrips 4
- setspName
-
- for { set i 1 } { $i <= [ expr ($numButton + 8) ] } { incr i 1 } {
- set oldKeys($spName($i)) ""
- set cKeys($spName($i)) ""
- }
+# setspName
checkbutton .showHelp -text "Turn Help on" -anchor w \
-variable showHelp -state normal
diff --git a/src/xdrv/wcmCommon.c b/src/xdrv/wcmCommon.c
index 059a3dc..05a41bf 100755
--- a/src/xdrv/wcmCommon.c
+++ b/src/xdrv/wcmCommon.c
@@ -518,7 +518,7 @@ static void sendAButton(LocalDevicePtr local, int button, int mask,
* Only left double is supported.
*/
#if defined WCM_XORG && GET_ABI_MAJOR(ABI_XINPUT_VERSION) > 0
- /Match the button sent to the actual pos due to a bug in Xorg
+ /* Match the button sent to the actual pos due to a bug in Xorg
* xserver 1.4. I.e. button1 is button1.
*/
button_idx = 1;
@@ -900,8 +900,11 @@ void xf86WcmSendEvents(LocalDevicePtr local, const WacomDeviceState* ds)
#if defined WCM_XORG && GET_ABI_MAJOR(ABI_XINPUT_VERSION) > 0
/* Ugly hack for Xorg 7.3, which doesn't call xf86WcmDevConvert
* for coordinate conversion at the moment */
- x = (int)((double)(x - priv->topX) * priv->factorX + 0.5);
- y = (int)((double)(y - priv->topY) * priv->factorY + 0.5);
+ /* The +-0.4 is to increase the sensitivity in relative mode.
+ * Must be sensitive to which way the tool is moved or one way
+ * will get a severe penalty for small movements. */
+ x = (int)((double)(x - priv->topX) * priv->factorX + (x>=0?0.4:-0.4));
+ y = (int)((double)(y - priv->topY) * priv->factorY + (y>=0?0.4:-0.4));
#endif
if (type != PAD_ID)
diff --git a/src/xdrv/wcmConfig.c b/src/xdrv/wcmConfig.c
index a2dbbcb..a40884b 100755
--- a/src/xdrv/wcmConfig.c
+++ b/src/xdrv/wcmConfig.c
@@ -149,8 +149,9 @@ LocalDevicePtr xf86WcmAllocate(char* name, int flag)
priv->nbuttons = MAX_BUTTONS; /* Default number of buttons */
priv->relup = 5; /* Default relative wheel up event */
priv->reldn = 4; /* Default relative wheel down event */
- priv->wheelup = 0; /* Default absolute wheel up event */
- priv->wheeldn = 0; /* Default absolute wheel down event */
+
+ priv->wheelup = IsPad (priv) ? 5 : 0; /* Default absolute wheel up event */
+ priv->wheeldn = IsPad (priv) ? 4 : 0; /* Default absolute wheel down event */
priv->striplup = 4; /* Default left strip up event */
priv->stripldn = 5; /* Default left strip down event */
priv->striprup = 4; /* Default right strip up event */
diff --git a/src/xdrv/wcmXCommand.c b/src/xdrv/wcmXCommand.c
index cb8727d..effd6e1 100644
--- a/src/xdrv/wcmXCommand.c
+++ b/src/xdrv/wcmXCommand.c
@@ -522,14 +522,18 @@ static int xf86WcmSetButtonParam(LocalDevicePtr local, int param, int value)
return BadValue;
else
{
- if ((!(value & AC_TYPE)) && (value != priv->button[bn]))
+ if (((value & AC_TYPE) == AC_BUTTON) && (value != priv->button[bn]) && !number_keys )
{
+ /* assign button */
snprintf (st, sizeof (st), "Button%d", bn);
xf86ReplaceIntOption (local->options, st, value);
priv->button[bn] = xf86SetIntOption (local->options, st, bn);
+ }
+ else
+ {
+ setVal = &(priv->button [bn]);
+ keyP = priv->keys[bn];
}
- setVal = &(priv->button [bn]);
- keyP = priv->keys[bn];
}
}
@@ -568,6 +572,7 @@ static int xf86WcmSetButtonParam(LocalDevicePtr local, int param, int value)
keyP = priv->srdnk;
break;
}
+ /* assign keys */
if (keyP)
{
if (!number_keys)
@@ -575,8 +580,8 @@ static int xf86WcmSetButtonParam(LocalDevicePtr local, int param, int value)
*setVal = value;
number_keys = (value & AC_NUM_KEYS) >> 20;
DBG(10, priv->debugLevel, ErrorF(
- "xf86WcmSetButtonParam value = %x number"
- " of keys = %d\n", *setVal, number_keys));
+ "xf86WcmSetButtonParam value = %x number"
+ " of keys = %d\n", *setVal, number_keys));
if (number_keys)
keyP[button_keys++] = value & 0xffff;
}
@@ -586,6 +591,9 @@ static int xf86WcmSetButtonParam(LocalDevicePtr local, int param, int value)
{
keyP[button_keys++] = value & 0xffff;
keyP[button_keys++] = (value & 0xffff0000) >> 16;
+ DBG(10, priv->debugLevel, ErrorF(
+ "xf86WcmSetButtonParam got %d values = %x \n",
+ button_keys, value));
}
}
if (button_keys >= number_keys)
diff --git a/src/xdrv/xf86Wacom.c b/src/xdrv/xf86Wacom.c
index 9786a56..c1554af 100755
--- a/src/xdrv/xf86Wacom.c
+++ b/src/xdrv/xf86Wacom.c
@@ -58,9 +58,10 @@
* 2007-06-25 47-pc0.7.8 - new release
* 2007-10-25 47-pc0.7.9-1 - Support multimonitors in both horizonal and vertical settings
* 2007-11-21 47-pc0.7.9-3 - Updated TwinView screen switch offset
+ * 2007-12-07 47-pc0.7.9-4 - Support Cintiq 12WX and Bamboo
*/
-static const char identification[] = "$Identification: 47-0.7.9-3 $";
+static const char identification[] = "$Identification: 47-0.7.9-4 $";
/****************************************************************************/
@@ -170,21 +171,11 @@ static int xf86WcmInitArea(LocalDevicePtr local)
}
}
- if (priv->numScreen == 1)
- {
- priv->factorX = totalWidth
- / (double)(priv->bottomX - priv->topX - 2*priv->tvoffsetX);
- priv->factorY = maxHeight
- / (double)(priv->bottomY - priv->topY - 2*priv->tvoffsetY);
- DBG(2, priv->debugLevel, ErrorF("X factor = %.3g, Y factor = %.3g\n",
- priv->factorX, priv->factorY));
- }
-
/* Maintain aspect ratio */
if (priv->flags & KEEP_SHAPE_FLAG)
{
screenRatio = totalWidth / (double)maxHeight;
- tabletRatio = ((double)(common->wcmMaxX - priv->topX)) /
+ tabletRatio = ((double)(common->wcmMaxX - priv->topX)) /
(common->wcmMaxY - priv->topY);
DBG(2, priv->debugLevel, ErrorF("screenRatio = %.3g, "
@@ -205,6 +196,13 @@ static int xf86WcmInitArea(LocalDevicePtr local)
}
/* end keep shape */
+ priv->factorX = totalWidth
+ / (double)(priv->bottomX - priv->topX - 2*priv->tvoffsetX);
+ priv->factorY = maxHeight
+ / (double)(priv->bottomY - priv->topY - 2*priv->tvoffsetY);
+ DBG(2, priv->debugLevel, ErrorF("X factor = %.3g, Y factor = %.3g\n",
+ priv->factorX, priv->factorY));
+
inlist = priv->tool->arealist;
/* The first one in the list is always valid */
@@ -258,6 +256,7 @@ void xf86WcmInitialCoordinates(LocalDevicePtr local, int axes)
WacomDevicePtr priv = (WacomDevicePtr)local->private;
WacomCommonPtr common = priv->common;
int tabletSize = 0, topx = 0, topy = 0;
+ int resolution;
/* x ax */
if ( !axes )
@@ -274,16 +273,18 @@ void xf86WcmInitialCoordinates(LocalDevicePtr local, int axes)
if (priv->flags & ABSOLUTE_FLAG)
topx = priv->topX;
+ resolution = common->wcmResolX;
#if defined WCM_XORG && GET_ABI_MAJOR(ABI_XINPUT_VERSION) > 0
/* Ugly hack for Xorg 7.3, which doesn't call xf86WcmDevConvert
* for coordinate conversion at the moment */
if (priv->flags & ABSOLUTE_FLAG) tabletSize -= topx;
topx = 0;
tabletSize = (int)((double)tabletSize * priv->factorX + 0.5);
+ resolution = (int)((double)resolution * priv->factorX + 0.5);
#endif
InitValuatorAxisStruct(local->dev, 0, topx, tabletSize,
- common->wcmResolX, 0, common->wcmResolX);
+ resolution, 0, resolution);
}
else /* y ax */
{
@@ -299,16 +300,18 @@ void xf86WcmInitialCoordinates(LocalDevicePtr local, int axes)
if (priv->flags & ABSOLUTE_FLAG)
topy = priv->topY;
+ resolution = common->wcmResolY;
#if defined WCM_XORG && GET_ABI_MAJOR(ABI_XINPUT_VERSION) > 0
/* Ugly hack for Xorg 7.3, which doesn't call xf86WcmDevConvert
* for coordinate conversion at the moment */
if (priv->flags & ABSOLUTE_FLAG) tabletSize -= topy;
topy = 0;
tabletSize = (int)((double)tabletSize * priv->factorY + 0.5);
+ resolution = (int)((double)resolution * priv->factorY + 0.5);
#endif
InitValuatorAxisStruct(local->dev, 1, topy, tabletSize,
- common->wcmResolY, 0, common->wcmResolY);
+ resolution, 0, resolution);
}
}
@@ -401,19 +404,25 @@ void xf86WcmInitialScreens(LocalDevicePtr local)
priv->screenBottomY[0] = 0;
for (i=0; i<screenInfo.numScreens; i++)
{
-#if !(defined WCM_XFREE86 || GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0)
+#ifdef _XSERV_GLOBAL_H_
priv->screenTopX[i] = dixScreenOrigins[i].x;
priv->screenTopY[i] = dixScreenOrigins[i].y;
priv->screenBottomX[i] = dixScreenOrigins[i].x;
priv->screenBottomY[i] = dixScreenOrigins[i].y;
+
+ DBG(10, priv->debugLevel, ErrorF("xf86WcmInitialScreens from dix for \"%s\" "
+ "ScreenOrigins[%d].x=%d ScreenOrigins[%d].y=%d \n",
+ local->name, i, priv->screenTopX[i], i, priv->screenTopY[i]));
+#else
+ if (i > 0)
+ {
+ priv->screenTopX[i] = priv->screenBottomX[i-1];
+ priv->screenTopY[i] = priv->screenBottomY[i-1];
+ }
#endif
priv->screenBottomX[i] += screenInfo.screens[i]->width;
priv->screenBottomY[i] += screenInfo.screens[i]->height;
-#if defined WCM_XFREE86 || GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0
- priv->screenTopX[i] = priv->screenBottomX[i];
- priv->screenTopY[i] = priv->screenBottomY[i];
-#endif
DBG(10, priv->debugLevel, ErrorF("xf86WcmInitialScreens for \"%s\" "
"topX[%d]=%d topY[%d]=%d bottomX[%d]=%d bottomY[%d]=%d \n",
local->name, i, priv->screenTopX[i], i, priv->screenTopY[i],
diff --git a/src/xdrv/xf86Wacom.h b/src/xdrv/xf86Wacom.h
index 8ab8128..805cf60 100755
--- a/src/xdrv/xf86Wacom.h
+++ b/src/xdrv/xf86Wacom.h
@@ -61,8 +61,24 @@
#include <xf86.h>
#define NEED_XF86_TYPES
#if !defined(DGUX)
-#include <xisb.h>
-#include <xf86_ansic.h>
+# include <xisb.h>
+/* X.org recently kicked out the libc-wrapper */
+# if defined WCM_XORG
+# undef NEED_XF86_TYPES /* defined (or not) in xorg-server.h*/
+# include <xorg-server.h>
+/* Xorg 6.x, 7.0, 7.1, and 7.2 uses version 6.xx or 7.xx,
+ * Xorg 7.3 have dropped down to 1.4... */
+# if XORG_VERSION_CURRENT < ((1) * 10000000) + ((4) * 100000) + ((99) * 1000)
+# include <xf86_ansic.h>
+# elif XORG_VERSION_CURRENT >= ((6) * 10000000)
+# include <xf86_ansic.h>
+# else
+# include <string.h>
+# include <errno.h>
+# endif
+# else
+# include <xf86_ansic.h>
+# endif
#endif
#include <xf86_OSproc.h>
#include <xf86Xinput.h>