gdl
gdl copied to clipboard
any chance to implement DEFINE_KEY in GDL?
I had some wonderful key definitions in IDL that helped me a lot to speed up things:
GDL> DEFINE_KEY, 'F10','window,/free',/terminate
% Procedure not found: DEFINE_KEY
% Execution halted at: $MAIN$
GDL>
Any chance to implement this in GDL?
Why not ! Any suggestion how to do that ?
Just to remember we already have some tricks around :
GDL> help,/key
GDL is using Readline to manage keys shortcuts, few useful listed below.
A summary can be read here : http://www.bigsmoke.us/readline/shortcuts
Moving in the command line :
Ctrl-a : going to the beginning of the line
Ctrl-e : going to the end of the line
Ctrl-u : removing from here to the beginning of the line
Ctrl-k : removing from here to the end of the line
Ctrl-RightArrow : jumping one word on the right
Ctrl-LeftArrow : jumping one word on the left
Moving in the history :
HELP, /recall : listing the whole history
Ctrl-p or UpArrow : previous entry in history
Ctrl-n or DownArrow : next entry in history
GDL uses gnu readline, so the equivalent of define_key can (I think) be done externally at this level. Meaning that a define_key.pro doing nothing would suffice to avoid a stop on an undefined procedure. It would be useful to hear if this simple solution is workable. Surely this can be done internally as well using readline functions, a good exercise for a new contributor :smiling_face_with_tear: