So I took matters into my own hands and did the next best thing I could think of, which was to define some key combinations that would perform certain editor operations while Quick Drop was visible. Once you've pressed Ctrl-Space, you're in my world now. :) So in LabVIEW 2009, there are three key combinations that I've defined:
- Ctrl-[shift]-D - If you select some diagram objects, then press Ctrl-Space-Ctrl-D, controls and indicators will be automatically created and wired for all inputs and outputs of the selected objects. If you press Ctrl-Space-Ctrl-Shift-D, constants will be created and wired for all inputs.
- Ctrl-R - If you select some diagram objects, then press Ctrl-Space-Ctrl-R, those objects will be removed from the diagram, but all wires that had pass-through inputs and outputs on those objects (like refnum or error wires) will be retained.
- Ctrl-T - If you press Ctrl-Space-Ctrl-T while a diagram is open, the labels of all control/indicator terminals on the top-level diagram are moved the left/right of the terminal, respectively.
[LabVIEW 2009]\resource\dialog\QuickDrop\plugins
Inside this folder are d.vi, r.vi, and t.vi. Those are the VIs that define the Ctrl-[shift]-D, Ctrl-R, and Ctrl-T shortcuts in Quick Drop. If you want to write your own shortcut (let's say it's Ctrl-E), start with resource\dialog\QuickDrop\QuickDrop Plugin Template.vi, save it as e.vi in the plugins folder, and now you have a Ctrl-Space-Ctrl-E shortcut!
As I get time in the coming months, I plan on posting new shortcuts to the NI Community that I didn't quite have time to squeeze into the LabVIEW 2009 release.
Awesome! Thanks for this.
ReplyDeleteAgain... Nice work! I can't wait to start using the new tools as soon as zou upgrades the G and Image Toolboxes!
ReplyDeleteI like it. How will this work when we create our own shortcuts, and then with newer releases of LabVIEW, more shortcuts are available with potentially the same keystrokes?
ReplyDeleteCan you recommend some keystrokes that NI will leave as user-defined?
As things are right now, you would need to reassign either your shortcut or the NI shortcut to a different key if future LabVIEW versions include shortcuts that you've already defined. This reassignment would only require renaming the .vi file. I'm investigating ways to address this in future LabVIEW versions, like allowing you to name the shortcut VI whatever you want, then having a text file or something that maps keys to VIs. But even that would have possible conflict issues, so I'm still trying to figure it out...
ReplyDeleteOh, and to answer your first question, The keys that either already have an assignment, or I have an idea of a feature to assign to them, are D, Q, B, T, S, R, I, P, N, A, and E. I would also recommend avoiding X, C, and V, as Ctrl-X, Ctrl-C, and Ctrl-V could potentially be used to cut, copy, or paste text in the Quick Drop text box.
Doesn't work for me. I downloaded your vis and installed to my 2009 directory as directed. With an object selected, Ctrl-Space-Ctrl-D and Ctrl-Space-Ctrl-space-D gives me a "Data Cache Size" object.
ReplyDeleteI replied to the comment thread on the NI Community entry where you posted the same question here.
ReplyDeleteHi Darren,
ReplyDeleteI just saw Stephen Mercer give a demo of scripting at NI Dev Days yesterday.
I've downloaded, installed and activated the API. But the new quick drop shortcuts are not working for me. I also do not see the plugins subfolder in the Quickdrop folder.
I am using LV 8.6.1 So I suspect this is the problem. Although I thought scripting would work with this version of LV as well.
Is this a LV 2009+ only thing?
Hi Patrick,
ReplyDeleteI introduced the Quick Drop feature in LabVIEW 8.6, but Quick Drop Keyboard Shortcuts are only available in LabVIEW 2009 and later. If you're looking for a way to get your feet wet with scripting, I'm pretty sure the JKI Right-Click Framework is available in LabVIEW 8.6. Whereas Quick Drop Keyboard Shortcuts give you a way to write your own editor features tied to keyboard operations, the right-click framework lets you write your own features tied to right-click menu options.