Sunday, January 18, 2015

LTspice : Achieving the Noun-Verb Interface (Dragging, Moving, Copying)

This will not work for multiple objects of course, but it works great for single objects.

What : You want to be able to do things like Moving, Dragging and Copying without first entering a command mode.

This is understandable - if you want to move and tweak, you don't want to be doing 'm' each time. Cadence doesn't force you to..

Instructions below tell you how you can Drag using your Middle Mouse Button (i.e., the scrollwheel - you put your pointer of the object (wire or instance) and press the wheel down (not rotate) and move and release to Drag the object; how you can Move using CTRL-Middle Mouse Button; Copy using ALT+Middle Mouse Button
  1. Install Autohotkey
  2. Install the Easy Window Dragging -- KDE style (this is useful anyways : it lets you move and resize your windows as if you were on linux. You're not forced to use it if you don't want to. Just install so you can insert the code I'm providing here) -- in your Startup folder so it launches automatically when you start your PC.
  3. Go to Windows taskbar notification area and find the Autohotkey icon and right-click and do "Edit this Script" (and take 10 seconds to see the other things you can do)
  4. Insert code provided below above the line that says "!LButton::". Note, if you haven't remapped the Keyboard Shortcuts to Cadencify LTspice, then you need to change "Send m" to "Send {F7}" and similarly with "Send c" --> "Send {F6}" and "Send s" --> "Send {F8}" in the below code. Not too much to ask for, is it?:)
  5. Back to the script icon, do "Reload this Script"

#IfWinActive, LTspice
   !d:: send !p{Down}{Down}{Down}{Down}{Down}{Enter}   ; delete plot pane


;   p:: send !pp   ; add plot pane - no need - go to drafting options and add there

   ^2:: Send !is   ; open current sheet's symbol

   ^w:: Send !fc   ; close current window with CTRL-w

   ^MButton up::
   !MButton up::
   MButton Up::
        Click
        Send {Esc}
        return

   MButton::
        Send s
        Click
        return

   !MButton::
        Send c
        Click
        return

   ^MButton::
        Send m
        Click
        return

#IfWinActive

No comments: