Chazin Home Chazin Home | Ca-binding Protein DB | Vanderbilt Home Vanderbilt Home
Research Description | Publications | Wisdom | Search
How to contribute | About this page

Programming hotkeys in Felix


How many times have you wished to avoid clicking through all those Felix menues just to accomplish some simple repetitive task? Well, I got tired of it and decided to program hotkeys for some functions. Here is how:

.felixrc

My .felixrc has the following lines:

def umacpfx ./ 
... 
def macpfx /home/weber/felix/macs/ 
def macpf1 &umacpfx 
def macpf2 &biosym/macros/felix/menus/mac/ 
def macpf3 &biosym/macros/felix/&menus/assign/mac/ 
def macpf4 &biosym/macros/felix/&menus/model/mac/ 
def nmacpfx 4 
def mnupfx /home/weber/felix/mnu/ 
def mnupf1 &biosym/macros/felix/menus/mnu/ 
def mnupf2 &biosym/macros/felix/&menus/assign/mnu/ 
def mnupf3 &biosym/macros/felix/&menus/model/mnu/ 
def msgpfx &biosym/data/felix/msgs/ 
def schpfx &biosym/database/felix/schema/ 
def schpf2 /home/weber/felix/ppflx/ppsch/ 
def filpfx &biosym/exe/filters/ 
def asglib &biosym/data/felix/asglib/ 

Felix looks for a given macro in macpfx first, then in macpf1 and so on. Thus if it finds a macro in my general macro collection (~/felix/macs) or in the present directory, it will use it rather than the one in the system-wide dirs. I.e. now you can modify any Felix macro, save it to your own directory and enjoy a program tailored to your needs. Restart Felix after editing the .felicrc.

Editing system macros

Find the macro that gets executed during the function you want to put on a hotkey by setting the symbol verify to 1 (def verify 1 from the command line). This echoes the macro names on the command line as Felix executes them. Once you know which system macro contains the functionality you want to put on a hotkey, add to the macro driving the mode you need (tools1d.mac for 1D, tools2d.mac for 2D, toolsnd.mac for ND, maproot.mac for ASSIGN and 5rrot.mac for MODEL) near the bottom:

key_<n>: 
  ex <some macro>
  go start

where <n> stands for the key you want to assign that function to and <some macro> contains the name of the macro which performs that function. Save this extended macro to your own personal macro directory and if you have modified your .felixrc as detailed above, Felix will now find and execute your extended copy of the root macro

Hint: the F keys (function keys along the top of the keyboard) are recognized in Felix as f1 through f12 (or however many you have). These make prime candidates for assigning repetitive tasks to.

Example: Speeding up interaction with ASSIGN

I have an edited copy of maproot.mac in ~/felix/macs which specifies the hotkeys. The relevant lines toward the end are:

key_f: 
  ex mapglobaldisp 12 
  go start 
key_s:
 ex mapglobaldisp 10
 go start 
key_e:
 reedit:
 eva dbopen db$open()
 if &dbopen eq 0 nodba
 xpk edit &pksent -1 whoitm
 if &whoitm eq 0 start
 go reedit 
 go start 
key_z: 
 ex mapfindregion 2 
 go start

I.e. the s key will let you zoom interactively, the f key will give you the full plane, the e key will let you edit a cross peak box and the z key will let you zoom on a proto. You could program the x key to zoom on a pattern. The command would be 'ex mapfindregion 1'
The edit crossspeak example shows how to deal with more complicated cases. I had isolated the macro with the editing functionality, but it contained much more than that. So I culled just those lines doing the edit loop and pasted it straight into the maproot.mac. I did not even bother to also paste the nodba: part to which the macro would branch if no dba would be open as there is always a dba open in ASSIGN and anyway it worked just fine for me as is.


last edited Sept. 10, 1996 by Christoph Weber