Key bindings for moving the panel view

edited July 2013 in KLayout Support
Hi,

In previous versions (eg. 0.21.29) it was possible to define key bindings for moving the panel view (zoom_menu.pan_XXXX). Now panning is fixed to the arrow keys and the respective entries are gone from the menu. Personally I always preferred a WASD configuration which leaves my right hand free for the mouse/touchpad. It would be great if this functionality could be brought back to the key bindings configuration!

Thanks!

Comments

  • edited July 2013

    Hi,

    that was the effect of a competing request: leave the arrow keys active even if the focus in somewhere else, for example in the layer list. Fulfilling that request was not compatible with Qt's shortcut system (which implements the key binding), so I had to drop that.

    So who's needing what? If you really need to bind other keys to pan functions you can bring them back with the following script (in this sample, "up" will be bound to the "W" key, "left" to "A" and so on):

    mw = RBA::Application::instance.main_window
    mw.menu.insert_separator("zoom_menu.end", "pan_functions")
    
    { "up" => "W", "left" => "A", "right" => "S", "down" => "D" }.each do |k,v|
      a = RBA::Action::new
      a.title = "Pan " + k
      a.shortcut = v
      a.on_triggered do
        mw.instance_eval("cm_pan_" + k) 
      end
      mw.menu.insert_item("zoom_menu.end", "pan_" + k, a)
    end
    

    Save this script as "pan_functions.rbm" and put it into the installation folder or local macro path (see http://www.klayout.de/useful_scripts.html).

    Matthias

  • edited November -1
    Thanks Matthias, this is great!

    Works as advertised, only the "S" and "D" keys were swapped.
  • edited November -1

    It was meant as a sample :-)
    Please use any keys you like.

    Matthias

Sign In or Register to comment.