Digital Workshop http://forum.digitalworkshop.co.uk/ |
|
Using RegisterEventHandler http://forum.digitalworkshop.co.uk/viewtopic.php?f=13&t=4093 |
Page 1 of 1 |
Author: | Lar_123 [ May 23rd, 2010, 5:17 am ] | ||
Post subject: | Using RegisterEventHandler | ||
Okay... not so much of a tutorial as an example to get you started. This is built using OpusPro v7 -- may 2010 (not sure if it is backward compatible with prior versions) The sample pub uses OpusScript, so more of an advance topic. The basic idea here is this: use standard Opus Triggers to get things going, and then 'invoke' other CONTROLLING INTERFACE DEVICES (MouseWheel for example)... to perform other actions. Have fun.
|
Author: | mackavi [ May 23rd, 2010, 9:06 am ] |
Post subject: | Re: Using RegisterEventHandler |
Morning Lar, Interesting idea. Couple of points to look at: 1. You keep adding a new trigger on event mouse over. This isn't necessary - the EventID variable will tell you if the event already exists. 2. The passing of the this object from the mouse over event to a global variable for use in the new event (such as wheel up) is not necessary. The wheel up event will call the necessary function with the this object as defined in the RegisterEventHandler statement. 3. The pre registering of the events and forking of functions is not necessary. 4. UnRegisterEventHandler is a spelling mistake. 5. I'd suggest using OOP and assigning EventID to an Object's custom properties. Hope this help. Mack |
Author: | Lar_123 [ May 23rd, 2010, 5:19 pm ] |
Post subject: | Re: Using RegisterEventHandler |
Mack, Thanks for the tips. Yeah, I admit I have some funny stuff going on there. This thing was more of a play and experiment some time ago, and after getting the basic RegisterEventHandler() going... I wanted to spawn more actions as well as learn how to have the Handler apply across multiple objects. At one point I threw in some Drag & Drop std actions too (I think that was why I used the Global Variable... and just left it in). re: 'UnRegisterEventHandler' -- seems to me to only work when it is: UnregisterEventHandler -- but I'm not sure that's it either. Can you say more on points 3 & 5? For those interested in this exercise, stay tuned and I'll get a cleaned-up example posted in due time. |
Author: | mackavi [ May 27th, 2010, 11:37 am ] |
Post subject: | Re: Using RegisterEventHandler |
Hi Lar, From memory as I don't have the script on screen; 3 - You had some code at the start of the script that pre registered the events mouse up / down. This is not necessary as the events should be registered on the mouse over event. 3b - You use fork to execute to the functions that should be triggered by the event handler. 5. You are adding the event handler to a variable, which is fine, but you can add it to the object that the event handler is attached to - this means that whenever you deal with the object (button / vector) you'll have access to its handler rather than some abstract variable. Mack |
Author: | Lar_123 [ May 28th, 2010, 6:30 am ] |
Post subject: | Re: Using RegisterEventHandler |
Hi Mack, Thanks for expanding on that. My scripting mind is a bit of confused lot right now (from other work I'm doing), so I'll likely get into this in the next few days and see what I can do with it. Cheers |
Page 1 of 1 | All times are UTC [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |