Search the web
Sign In
New User? Sign Up
nmr_sparky
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Show off your group to the world. Share a photo of your group with us.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
changing the 2-key shortcut   Message List  
Reply | Forward Message #587 of 615 |
Re: [nmr_sparky] changing the 2-key shortcut

Hi Larry,

The Sparky keyboard shortcuts are defined in the C++ code
(command.cc). You could edit them and recompile Sparky but that is a
good bit of trouble. Here's a simpler way if you just want to add a new
shortcut that does the same thing as an existing one. Edit your Sparky
distribution file

sparky/python/sparky/sparky_init.py

with a text editor to look like the following

def initialize_session(session):

session.add_command('zz', 'My Shortcuts/Peak List',
lambda: session.command_characters('lt'))


This defines the shortcut zz to behave as if you typed lt (show peak
list) and adds a menu entry "Extensions / My Shortcuts / Peak List
(zz)". You can add additional shortcuts by just having more
session.add_command() lines.

Tom


larryrmasterson wrote:
>
> I would like to reassign the two letter shortcut for some functions in
> sparky. Could someone let me know how this can be done?
>
> Thanks!
>
>



Thu Jun 4, 2009 6:25 pm

yopypu
Offline Offline
Send Email Send Email

Forward
Message #587 of 615 |
Expand Messages Author Sort by Date

I would like to reassign the two letter shortcut for some functions in sparky. Could someone let me know how this can be done? Thanks!...
larryrmasterson
Offline Send Email
Jun 4, 2009
5:01 pm

Hi Larry, The Sparky keyboard shortcuts are defined in the C++ code (command.cc). You could edit them and recompile Sparky but that is a good bit of trouble....
Thomas Goddard
yopypu
Offline Send Email
Jun 4, 2009
6:35 pm

The email handling mangled the code I sent in the previous message. The session.add_command... and lambda... lines have to be indented for it to work....
Thomas Goddard
yopypu
Offline Send Email
Jun 4, 2009
6:41 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help