Making complex keyboard shorcuts.

Bobt

Creator of BobFX for VT
I am still trying to figure out toasterscript. On one hand its
looks like C. On the other hand it seems to have all kinds of
function calls. What is the order of execution? Which gets
called first. The doc isnt giving me what I need in the order
I need it in to get it.

What do I want to do?
I want to create a keyboard short cut.
A keystroke (doesnt matter which one Alt Shift etc.)
that will razor a clip I click on and depending the left or
right mouse button delete the item to the left or right.
I figured if I could do that I would be OK doing more.
But alas, I am a bit lost.

Bob
 

Blake

New member
Well, since razoring a clip selects the right by default, all we need to do is select the previous clip and delete it for the left click, while deleting what is automatically selected for the right click.

Code:
//This shortcut razors and deletes the piece to the left
//if you decide to switch it to keyboard control, uncomment
//the following line and comment out the other
//CreateShortCut("Shift Y", code(

CreateShortCut("Shift Alt LeftMouse", code(
   if (GetActivePaneType()==1) {	//only do this if on the timeline
      RazorEditLine()			//Razor at edit line
      SelectPrevChild(true)		//select the left piece
      UpdateInOutPanelSel()		//update the selection
      Delete()				//delete the left piece
   }
  ),
OrderedFocus,
1000,
"Timeline_Layout .*"			//not on the window, but the layout
)

//This shortcut razors and deletes the piece to the right
//if you decide to switch it to keyboard control, uncomment
//the following line and comment out the other
//CreateShortCut("Shift P", code(

CreateShortCut("Shift Alt RightMouse", code(
   if (GetActivePaneType()==1) {	//only do this if on the timeline
      RazorEditLine()			//Razor at edit line
      Delete()				//delete the right piece
   }
  ),
OrderedFocus,
1000,
"Timeline_Layout .*"			//not on the window, but the layout
)

If it doesn't work, let me know, but that should do the trick. Just stick that in your UserScripts folder for VideoEditor. If you have any questions, feel free to ask and I'll try my best to answer them.

Hope that helps,

Blake
--
PIZAZZ Productions
www.pizazzme.com
 

Bobt

Creator of BobFX for VT
I am sorta getting it.
I see where you got the calls from . They are listed in the Toasterscript doc.
This is cool, now let me try and finish my schooling.
I noticed you mentioned you can call toaster script
from another application. OK..
How would I call the Shift Alt Left mouse from another App?
Basically how would I call my own made up code.
I understand the sendmessage. Thats COOL I got that
no sweat. What name would be passed for my own toasterscript?
I guess I am asking what sort of code declaration would I need?
You have a mini snipet to illustrate? That would be great.

Thanks,
Bob
 

Blake

New member
Well, I haven't gotten the chance to fool around with the SDK much yet. My suggestion, though, would be to set up the two shortcuts as functions instead.

To do that, just take the contents of the code statements, and put them in two separate functions like this:
edit: In your ToasterScript file, by the way, not your program.


Code:
RazorKillLeft() = {
//code here
}

RazorKillRight() = {
//code here
}

Then call them with sendmessage, with "RazorKillLeft" or "RazorKillRight" as Temp.

Hope that helps.

Blake
--
PIZAZZ Productions
www.pizazzme.com
 

Bobt

Creator of BobFX for VT
If that works COOL!!
And real powerful to. Can you imagine the macro you can
make?
WOW

Bob
 
Top Bottom