how to set new multikey binding for pP

26 views
Skip to first unread message

Stephane Gagne

unread,
Nov 29, 2017, 12:33:11 PM11/29/17
to NMRViewJ
Hi,

I would like to add a new key binding that would do the same thing as the current "pP" multikey binding, that is :
pP : Pick peak at cursor position. The peak center will located at the maximum of the parabolic fit to the closest and adjacent data points, but no search for a maxima will be done.

I use the "pp" and "pP" a lot. However I find the "pP" more difficult for one-hand use (I have yet to master my Vulcan grips), since usually my right-hand is on the mouse during manual peak-picking. I probably would set it to "p0".

Would it be possible to know the complete syntax used for the current "pP".

Also, are personal multikey bindings automatically added globally when using cbind? If not, how should I proceed to set it globally.

Stephane

brucej

unread,
Nov 29, 2017, 4:26:22 PM11/29/17
to NMRViewJ
Hi Stephane,

Yeah, I'm not happy with my choice of pP, but it fit into the other p commands.  I've been thinking of adding peak add commands starting with "a"
like "aa" and "as" because you often do them in combination with the left hand on keyboard and right hand on mouse.

In any case you can do:

cbind p0 {::nv::spectrum::peak::addPeak $win $x $y 1}


Using cbind should apply them to any existing, and any new canvas spectra.


Bruce

Stephane Gagne

unread,
Nov 29, 2017, 11:17:29 PM11/29/17
to NMRViewJ
Thanks a lot Bruce!

Works perfectly.

And now that you mention it, practically, since it is a combination that I use so much during peak-picking (along with the cs/cc switches), being on the left side of the keyboard is much more practical for picking. I think I will use your suggestion and use the aa/as !

Now... since my low-level NMRViewJ commands is pretty rusty... would it be too much to ask for the "pp" syntax?

Actually, personally, if a list of the commands associated with all the multikey bindings would be available somewhere, I would find it extremely useful... both to brush up on my NMRViewJ commands, and to customize my key-bindings.

Cheers,

Stephane

Stephane Gagne

unread,
Nov 30, 2017, 2:00:29 AM11/30/17
to NMRViewJ
After looking into the addPeak script, I guessed that the "1" was for "fixMode".

so I guess the "pp" binding is simply for :  ::nv::spectrum::peak::addPeak $win $x $y 0

Seems to work fine, but please correct me if I am wrong. I am not sure what the other two optional parameters {xyMode pix} for addPeak are for...

Stephane
Reply all
Reply to author
Forward
0 new messages