Re: Can a self-installing plugin (script) assign itself a hotkey?

Date : Tue, 4 Mar 2008 11:11:05 -0800
To : XSI(at)Softimage.COM
From : "Andy B." <abuecker(at)gmail.com>
Subject : Re: Can a self-installing plugin (script) assign itself a hotkey?
I just did this by registering an event in my plugin.  Here is some python example code:

def XSILoadPlugin( in_reg ):
# ... typical plugin stuff .... #

# register a key up event #
in_reg.RegisterEvent("zMyEvent", c.siOnKeyUp)

def zMyEvent_OnEvent(ctxt):
# key and the mask pressed #
key = ctxt.GetAttribute('KeyCode')
mask = ctxt.GetAttribute('ShiftMask')

# exit if it's not Ctrl+B #
if key != 66 and mask != 2:
return False

# ... do your stuff ... #
Hope this helps.

-A


On Tue, Mar 4, 2008 at 10:03 AM, Raffaele Fragapane <raffsxsilist(at)googlemail.com> wrote:
They introduced cumulative keymaps some time ago didn't they? if they're there you can, if they aren't then you would be pissing off hard anybody using a custom keymap.


On Tue, Mar 4, 2008 at 5:55 PM, Hans Payer <hanspayer(at)gmail.com> wrote:
It would probably be easier for you to create an addon that contains the plugin and the keymap together.

H


On Tue, Mar 4, 2008 at 9:19 AM, Raffaele Fragapane <raffsxsilist(at)googlemail.com> wrote:
I think he wants the plugin to ADD the hotkey to the keymap, not just know if it's supported.

Never had to do it, and it seems pretty obtrusive, but you can modify (add if there's none but the default one) the keymap file to add one, they are just xml like text files I think.


On Tue, Mar 4, 2008 at 2:12 PM, Ajit Menon <xsiajit(at)gmail.com> wrote:
yes.
When you create the self-installing plugin, it actually ask in the second tab whether it supports key assignment. Check that, and find your plugin in the Custom Scripts section of the keyboard mapping PPG.


On 3/4/08, Alan Fregtman <alan.fregtman(at)gmail.com> wrote:
Hi guys,

This may perhaps be a bit of newbie question, but I'm new to scripting
within XSI, so.... is it possible for a self-installing script to
assign itself a hotkey? (I didn't see an option in the wizard for it.)

Cheers,

   -- Alan
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi






Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available.
This site supposedly brought to you by Benjamin Grosser and the Imaging Technology Group.