Interesting method, Andy. Thanks for the suggestion.
I realise it's a little obstrusive, but the hotkey I was thinking of
isn't taken by default. It's a very simple script and I wanted to know
if I could save users a step in assigning a hotkey to it.
Cheers,
-- Alan
On Tue, Mar 4, 2008 at 11:11 AM, Andy B. <abuecker(at)gmail.com> wrote:
> 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
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi