Designing new shortcut key functions
Posted: 12 Jul 2008, 16:34
I am trying to find the best way to add new shortcut key functions to TVPaint. Here's one way I've done it and I was wondering if any other users or TVPaint facilitators might have an easier approach.
First thing I discovered with shortcut keys is that once a button is DEFINED AND NAMED, the list of actions assigned to that button can also be assigned to a shortcut key. The new button name will appear in the right column of the configure keyboard shortcuts list like this:
Panel-name:Button-name
Now a shortcut key can be assigned to the button which when pressed will to invoke the commands assigned to the custom button.
Next thing I discovered was that the custom panel need not be visible to show-up on the shortcuts list... so I created a special panel called HIDDEN BUTTONS and there I store all my custom buttons which I want to assign to shortcut keys.
Examples:
My Right Arrow key is assigned to HIDDEN BUTTONS:nextwrap
My Left Arrow key is assigned to HIDDEN BUTTONS:previouswrap
The nextwrap button simply calls the script NextFrame.grg
The previouswrap button simply calls the script PreviousFrame.grg
NextFrame.grg and PreviousFrame.grg are George scripts I posted earlier on the forum.
[ Question: is this the best way to assign scripts to shortcut keys? ]
Another Example:
I wanted to create a shortcut key to automatically add a predefined drop-shadow to the current layer. Here's what I did:
Step 1. In the FX window, I chose FXSTACK Stylize:Drop Shadow and set the parameters I wanted - angle, distance, opacity, smooth... and ADDED it to the FXBin list naming it dropshadow.
Step 2. In my HIDDEN BUTTONS panel I created another hidden custom button named DropShadow with the following list of commands:
0 FXStack:dropshadow
1 Key:FXStack Apply
2 Key:FXStack Delete All
3 Key:Interface:Close FX Panel
4 End
Step 3. Finally, in the Keyboard Shortcuts popup I assigned the A key to HIDDEN BUTTONS:DropShadow and saved it.
Now, anytime I want a dropshadow for a given layer, I just press the A key - which opens the FXStack popup, applies the shadow, then clears and closes the FXStack popup window.
[ Question: I was wondering if there is an easier / simpler way to do this? Any alternate methods for inventing new shortcut keys? ]
Sven
First thing I discovered with shortcut keys is that once a button is DEFINED AND NAMED, the list of actions assigned to that button can also be assigned to a shortcut key. The new button name will appear in the right column of the configure keyboard shortcuts list like this:
Panel-name:Button-name
Now a shortcut key can be assigned to the button which when pressed will to invoke the commands assigned to the custom button.
Next thing I discovered was that the custom panel need not be visible to show-up on the shortcuts list... so I created a special panel called HIDDEN BUTTONS and there I store all my custom buttons which I want to assign to shortcut keys.
Examples:
My Right Arrow key is assigned to HIDDEN BUTTONS:nextwrap
My Left Arrow key is assigned to HIDDEN BUTTONS:previouswrap
The nextwrap button simply calls the script NextFrame.grg
The previouswrap button simply calls the script PreviousFrame.grg
NextFrame.grg and PreviousFrame.grg are George scripts I posted earlier on the forum.
[ Question: is this the best way to assign scripts to shortcut keys? ]
Another Example:
I wanted to create a shortcut key to automatically add a predefined drop-shadow to the current layer. Here's what I did:
Step 1. In the FX window, I chose FXSTACK Stylize:Drop Shadow and set the parameters I wanted - angle, distance, opacity, smooth... and ADDED it to the FXBin list naming it dropshadow.
Step 2. In my HIDDEN BUTTONS panel I created another hidden custom button named DropShadow with the following list of commands:
0 FXStack:dropshadow
1 Key:FXStack Apply
2 Key:FXStack Delete All
3 Key:Interface:Close FX Panel
4 End
Step 3. Finally, in the Keyboard Shortcuts popup I assigned the A key to HIDDEN BUTTONS:DropShadow and saved it.
Now, anytime I want a dropshadow for a given layer, I just press the A key - which opens the FXStack popup, applies the shadow, then clears and closes the FXStack popup window.
[ Question: I was wondering if there is an easier / simpler way to do this? Any alternate methods for inventing new shortcut keys? ]
Sven