Difference between revisions of "Creating Hotkey"

From CRIPTWiki
Jump to: navigation, search
(Created page with 'So, now you are trying to create a bunch of hotkeys for presentation, very easy.')
 
Line 1: Line 1:
So, now you are trying to create a bunch of hotkeys for presentation, very easy.
+
So, now you are trying to create a bunch of hotkeys for presentation, very easy. Follow these steps:
 +
 
 +
First, you need to finish editing your .hx network for presentation. So make whatever final change necessary and STOP TOUCHING it after you done saving it.
 +
 
 +
Then after that, you NEED to open the .hx file using an editor such as Notepad++ (if not installed, go hunt Tim down about it). When you open it up... it will look like [[File:Demo.pdf.]]
 +
 
 +
Yes, .hx file is essentially a text file telling Amira what to do... SO, by using that to our advantage, add a line at the very bottom: "source ${AMIRA_ROOT}/share/resources/hotkey.txt" without the quotation marks. This tells the amira to LOAD UP the file called "hotkey.txt at the location where Amira is installed within the folder tree /share/resources/.
 +
 
 +
So, add that, save and exist notepad++.
 +
 
 +
Now, you told the .hx network file where to load the hotkey file, you still NEED to make up that txt file to carry out the desired function.
 +
 
 +
Understand the following example code and you will be able to write your own:
 +
 
 +
 
 +
 
 +
#F5 slot
 +
proc onKeyF5 {} {
 +
  echo "F5 pressed"
 +
  Bones.surf setViewerMask 0
 +
}
 +
#Ctrl-F5 slot
 +
proc onKeyCtrlF5 {} {
 +
  echo "Ctrl-F5 pressed"
 +
  Bones.surf setViewerMask 1
 +
}

Revision as of 20:31, 27 August 2009

So, now you are trying to create a bunch of hotkeys for presentation, very easy. Follow these steps:

First, you need to finish editing your .hx network for presentation. So make whatever final change necessary and STOP TOUCHING it after you done saving it.

Then after that, you NEED to open the .hx file using an editor such as Notepad++ (if not installed, go hunt Tim down about it). When you open it up... it will look like File:Demo.pdf.

Yes, .hx file is essentially a text file telling Amira what to do... SO, by using that to our advantage, add a line at the very bottom: "source ${AMIRA_ROOT}/share/resources/hotkey.txt" without the quotation marks. This tells the amira to LOAD UP the file called "hotkey.txt at the location where Amira is installed within the folder tree /share/resources/.

So, add that, save and exist notepad++.

Now, you told the .hx network file where to load the hotkey file, you still NEED to make up that txt file to carry out the desired function.

Understand the following example code and you will be able to write your own:


#F5 slot
proc onKeyF5 {} {
  echo "F5 pressed"
  Bones.surf setViewerMask 0
}
#Ctrl-F5 slot
proc onKeyCtrlF5 {} {
  echo "Ctrl-F5 pressed"
  Bones.surf setViewerMask 1
}