yet another wheelmouse binding : zoom with layout, schematic, waveform.

Discussion in 'Cadence' started by fogh, Oct 18, 2004.

  1. fogh

    fogh Guest

    Hi All,

    For those (if any !) who liked the motif and workbench configs I posted on wheelmouse/doubleclick handling ( btn4down ) , you should also appreciate this snippet, which binds zoom to control+wheel

    ;; set control-wheel to zoom in/out
    let( ((goldy 1.618034) (binding ""))
    foreach(application '("Schematics" "Command Interpreter" "Show File" "Symbol" "Graphics Browser" "Layout")
    binding=strcat("hiZoomRelativeScale(hiGetCurrentWindow() " sprintf(nil "%L" goldy) " )" )
    hiSetBindKey( application "Ctrl<Btn4Down>" binding)
    binding=strcat("hiZoomRelativeScale(hiGetCurrentWindow() " sprintf(nil "%L" 1/goldy) " )" )
    hiSetBindKey( application "Ctrl<Btn5Down>" binding)
    binding=hiGetBindKey("awv" "None<Key>z")
    hiSetBindKey("awv" "<Btn4Down>" binding)
    binding=hiGetBindKey("awv" "Shift<Key>z")
    hiSetBindKey("awv" "<Btn5Down>" binding)

    BTW, I did not get any feedback on the CmDoubleClick() function, the CmMouseWheelLikeArrows(), or the common desktop environment and X11 resources for wheelmouse that I posted this summer. So if you use it, don t be shy, tell me what you think, what you modified, ...
    fogh, Oct 18, 2004
    1. Advertisements

  2. fogh

    svenn.are Guest

    I have just inserted that CmDoubleClick into my environment and I
    think it is very good. I can't comment much on the code but it is
    documented and fairly easy to understand.
    svenn.are, Oct 20, 2004
    1. Advertisements

  3. fogh

    fogh Guest

    Thanks Svenn.

    If there are people interested in the wheel bindings who use citrix ICA / metaframe for unix, you have noticed that it doesn t work...that is because MFU has simply no support for more than 3 mouse buttons.
    So please get in touch with your Metaframe supplier and request that they add support for button4&5 events in their Xserver "ctxXtw".
    With requests from big customers that may happen.
    fogh, Oct 20, 2004
  4. I tested your code and everything worked fine directly, except that I
    had to remove 'DM("is switchable")' from CmDoubleClick().

    Regards David Astrom
    David Åström, Oct 26, 2004
  5. fogh

    Boris Guest

    Hi fogh,

    I am enjoying your mouse wheel configs. Thanks a lot!
    Concerning double click function, it not so useful for me, I prefer
    keyboard :). But all scrolling mappings are really useful.

    BTW, you are asking for improvements, I had made one for the zoom
    function. I prefer zoom at the pointer. Here is an example:

    ;; procedure to zoom in/out at the mouse pointer
    procedure( CmMouseWheelZoom(action "s")
    let(((goldy 1.618034) (wwin hiGetCurrentWindow()) xy )
    goldy = caseq(action
    (zoomin goldy)
    (t 1/goldy)
    xy = hiGetPoint(wwin)
    hiZoomRelativeScale(wwin goldy)
    if( xy hiVectorPan(wwin xy hiGetPoint(wwin)))
    ) ; ** let **
    ) ; ** procedure CmMouseWheelZoom **

    ;; set control-wheel to zoom in/out
    let( ((binding ""))
    foreach(application '("Schematics" "Command Interpreter" "Show File"
    "Symbol" "Graphics Browser" "Layout")
    hiSetBindKey( application "Ctrl<Btn4Down>"
    hiSetBindKey( application "Ctrl<Btn5Down>"
    binding=hiGetBindKey("awv" "None<Key>z")
    hiSetBindKey("awv" "<Btn4Down>" binding)
    binding=hiGetBindKey("awv" "Shift<Key>z")
    hiSetBindKey("awv" "<Btn5Down>" binding)
    ) ; ** let **

    Boris, Oct 27, 2004
  6. fogh

    fogh Guest


    thanks, it makes more sense to zoom on the pointer indeed. You can also bind
    the doubleclick action to a key. It may spare you a descend popup.
    fogh, Oct 28, 2004
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.