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.

eg.triggerEvent()

If you have a question or need help, this is the place to be.
Post Reply
Neywiny
Posts: 6
Joined: Thu Apr 30, 2015 4:33 pm

eg.triggerEvent()

Post by Neywiny »

is there a way to trigger an event not under main? like under keyboard?
Sem;colon
Plugin Developer
Posts: 625
Joined: Sat Feb 18, 2012 10:51 am
Location: Germany

Re: eg.triggerEvent()

Post by Sem;colon »

yes.

Code: Select all

eg.TriggerEvent(prefix="keyboard", suffix="myEvent")
If you like my work, Image me a drink :wink:
Neywiny
Posts: 6
Joined: Thu Apr 30, 2015 4:33 pm

Re: eg.triggerEvent()

Post by Neywiny »

okay so that works as far as the log goes, but how do I get it to actually do the event? (I know how to emulate keystrokes, I want it to actually preform another event to the system)
Last edited by Neywiny on Sun May 03, 2015 2:27 am, edited 1 time in total.
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: eg.triggerEvent()

Post by krambriw »

Ehhh...put the code above into a python command or script, save, then execute
Neywiny
Posts: 6
Joined: Thu Apr 30, 2015 4:33 pm

Re: eg.triggerEvent()

Post by Neywiny »

haha no, that's not what I mean. I execute the code, and it prints the event to the log, but when I tell it to execute Keyboard.E, for testing purposes, t just prints to the log and doesn't do Keyboard.E. That's what I meant.
Sem;colon
Plugin Developer
Posts: 625
Joined: Sat Feb 18, 2012 10:51 am
Location: Germany

Re: eg.triggerEvent()

Post by Sem;colon »

Of corse not, events and commands are two totally differend things.
If you what eventghost to emulate the keypress you can't use TriggerEvent.
Btw. There is an action in eventghost that can emulate keypresses.
If you like my work, Image me a drink :wink:
Neywiny
Posts: 6
Joined: Thu Apr 30, 2015 4:33 pm

Re: eg.triggerEvent()

Post by Neywiny »

well finally the no I dreaded, as I said before I know that I can emulate keystrokes, I wanted to emulate something other than a keystroke, an event that showed up in the log, but I appreciate the help anyway,
Sem;colon
Plugin Developer
Posts: 625
Joined: Sat Feb 18, 2012 10:51 am
Location: Germany

Re: eg.triggerEvent()

Post by Sem;colon »

Ok, I'm confused, you don't what to emulate a key press but you also don't want an event that looks like a key was pressed without the key being pressed?
If you like my work, Image me a drink :wink:
Neywiny
Posts: 6
Joined: Thu Apr 30, 2015 4:33 pm

Re: eg.triggerEvent()

Post by Neywiny »

this may sound a *bit* rude, but if you actually read the thread, I say that I need to be able to trigger an event from code, and that I know how to emulate keystrokes. I want to do things that aren't keyboard controlled.
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: eg.triggerEvent()

Post by krambriw »

Your explanations are confusing me too so better improve the details in what you wanna achieve. Otherwise, not much we can help
- put in screenshots, code samples etc etc
Neywiny
Posts: 6
Joined: Thu Apr 30, 2015 4:33 pm

Re: eg.triggerEvent()

Post by Neywiny »

I want to do one things and one thing only: from code, trigger an event that would happen normally in the computer. That's it. that includes, emulated keypresses, shutting off screens, activating windows, locking the computer, etc. I am not having an issue with the code, so there is no need to post it. I just want to know if there is a way to trigger a windows event.
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: eg.triggerEvent()

Post by krambriw »

if there is a way to trigger a windows event
Now we are talking, your question was not formulated like that from the beginning

Have you looked at the Window/Send Message action?
Skärmklipp.PNG
Post Reply