[Xcircuit-dev] Scroll Wheel
R. Timothy Edwards
tim.edwards at multigig.com
Mon May 1 14:48:00 PDT 2006
Dear Darrell,
> I am interested in binding the scroll wheel to zoom in and out (rather
> than up and down)
> of a schematic. I have used this feature in Autocad and it works nicely.
I just noticed today that it's also in the Cadence schematic capture
too.
> It seems that "keybind" is appropriate and I have tried Button4 and
> Button5 as
> a guess.
>
> How does one make it so?
You're pretty close. The binding is done in Tk, so it uses Tk syntax
for the buttons. The original binding can be found in the "wrapper.tcl"
file. To replace the pan function with a zoom function, do:
xcircuit::keybind <Button-4> { zoom 1.5 ; refresh} \
.xcircuit.mainframe.mainarea.drawing
xcircuit::keybind <Button-5> { zoom [expr 1 / 1.5] ; refresh} \
.xcircuit.mainframe.mainarea.drawing
Probably you'll want a zoom factor a bit smaller than 1.5 (which is
the default for "z" and "Z" zooming) since the scroll wheel is very
fast.
---Tim
+--------------------------------+-------------------------------------+
| Dr. R. Timothy Edwards (Tim) | email: tim.edwards at multigig.com |
| MultiGiG, Inc. | web: http://www.multigig.com |
| 100 Enterprise Way, Suite A-3 | phone: (831) 621-3283 |
| Scotts Valley, CA 95066 | cell: (240) 401-0616 |
+--------------------------------+-------------------------------------+
More information about the Xcircuit-dev
mailing list