Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Add event at plugin installation

Do you have questions about writing plugins or scripts in Python? Meet the coders here.
Post Reply
Johnson
Posts: 48
Joined: Sun May 24, 2009 9:05 pm

Add event at plugin installation

Post by Johnson »

I can add Action and Group to custom folder for plugin using AddAction and AddGroup.

Is it possible to automatically add Event (that will be generated with the same plugin) for this action?

It will be interested to see come code example.
stottle
Plugin Developer
Posts: 636
Joined: Sun Apr 26, 2009 10:59 pm

Re: Add event at plugin installation

Post by stottle »

Not possible without a change to the core.

Brett
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Add event at plugin installation

Post by Pako »

It would be nice if you wrote a bit more detail what you need.
Maybe it's not as impossible as Brett writes.
Please use short and simple sentences.
Good is also use an example.

Pako
Bartman
Plugin Developer
Posts: 881
Joined: Sun Feb 12, 2006 9:03 am

Re: Add event at plugin installation

Post by Bartman »

Adding and removing plugin should be limited to configuration.
Johnson
Posts: 48
Joined: Sun May 24, 2009 9:05 pm

Re: Add event at plugin installation

Post by Johnson »

Pako wrote:It would be nice if you wrote a bit more detail what you need.
OK. I made plugin for SoundGraph iMON device. Device has both "Event" and "Action" functionality.
For example, the iMON remote control has button for toggle between "mouse" and "keyboard" mode of remote control joystick. When button pressed the plugin receive code X and generate Event. Also to really switch hardware plugin must send code Y to hardware.
I can simple send code Y for code X but more powerful to generate event for code X and then map action with code Y for this event. In this case all process are clear and configurable for users.
User can map Event to Action manually after plugin installed.

But can plugin mapped this event automatically?
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Add event at plugin installation

Post by Pako »

If I understand well, so I have good news for you!
See (for example) plugin USB-UIRT and look in there eg.Bind (and eg.Unbind).
It's what you need?

Pako
stottle
Plugin Developer
Posts: 636
Joined: Sun Apr 26, 2009 10:59 pm

Re: Add event at plugin installation

Post by stottle »

Pako,

Very nice idea. That should work.

@Johnson - Pako's suggestion should enable what you are looking for, but not the way you (and I) had in mind originally. Bind/Unbind work behind the scenes, so no actions/events are added to the tree (to do this would require a change to the core) and I don't think they show up in the log. However, they would allow you to do what you are looking for within your plugin. So I think it is a great suggestion.

Brett
Post Reply