Events

From VoxCommando
Jump to: navigation, search
Wiki events.png

Eventicon.png Introduction to Events

Events, such as a program window opening or a remote device switching on, can be used as triggers in VoxCommando to execute a command. These can be used instead of voice commands.

  • When such events occur, they appear in the history window symbolized by a calendar icon. Eventicon.png.
  • Some events have payloads attached that can be used in your commands, the same way that we use payloads in voice commands (e.g., see the MediaMonkey event image below.)
  • If you don't like the "clutter" of so many events appearing in your history panel, you can choose to only show events that have already been assigned to commands. This Show All Events toggle setting is in the main menu, under Options. Keep in mind, however, that this will prevent you from seeing potentially useful events not currently assigned.

A command can have a combination of phrases, payloads, and one or more events assigned to it. Event triggers are an *alternative* to using a voice command to execute a command. While VoxCommando is primarily intended to give you voice control over your system, you can have commands that are only executed by an event trigger -- with no voice command.

Using event triggers

When building your own commands, you can:

  • Command part menu (in command tree editor)
    drag events from the history panel onto your command in the command tree (a good way to ensure the correct syntax is used), or
  • manually create an event by selecting the event icon from the command part menu. See image at right >>>

Commands that already have events assigned to them as triggers will have a modified command icon that looks like this: Eventcommand.png

Wildcards in event triggers

In your command tree, you can edit the name of an event trigger to use an asterisk as a wildcard. This makes your event trigger more versatile.

EXAMPLE

If your command uses an event trigger:

Eventicon.png focused.VoxCommando

the command will only be triggered when VoxCommando gets focused.

But if the event is renamed as:

Eventicon.png focused.*

the command will be triggered when any new program gets focused.

Using existing events

Events may be generated many different ways. Some events are generated automatically by activity on your system, such as:

  • Wiki MMevent.png
    when a window changes focus
  • events that occur within VoxCommando, such as when VC has first launched and finished loading (VC.Loaded) or changed its listening status (VC.On, VC.Standby, VC.Off)
  • various events generated by Kodi, MediaMonkey, iTunes etc.
    • For example, when a new song starts playing, or when playback is paused
  • events sent from other programs and devices such as EventGhost, Vera home controller, VoxWav (Android app), Amulet Remote tilt monitor etc.
  • events generated by various plugins such as Google Calendar, TCP, Hook, DxInput, Watcher, etc.

The best way to discover these events is to inspect your history panel when the activity you are looking for has taken place. You may have to manually cause that activity to take place in order to see what event is generated (e.g. start playing a track in your media player to see if that generates an event in the history panel).

Be sure to roll over the event when it appears in your history window to find out if it includes any payload values. In the image of the MM.Playing event here on the right, we can see that the event has 4 different payloads we could use in our command.

Trouble-shooting when events don't appear

If you think that a particular activity should be generating an event, but it doesn't seem to appear in the history panel, verify that:

1. You have Show All Events selected under Options in the main menu. (This is generally enabled by default, but you may have unchecked it at some point.)

2. If you are expecting events from another program or networked device, check that it is properly communicating with VC. You may need to:

  • check that the port settings are correct in the relevant VC plugin and/or in the other product;
  • check whether particular settings are enabled in the other product, such as permitting remote control or third-party access;
  • run VC as administrator, if the other program requires higher permission privileges;
  • launch the other program before starting VC in order for VC to recognize that it is there and connect.

(It helps if you develop an understanding of what methods the two ends are using to exchange information.)

Creating your own events

You can also generate custom events based on actions that take place within a command, using actions such as:

Of course, you can also generate custom events within your Python scripts or when sending commands to VC via one of the other methods supported by VoxCommando's API.

Video tutorials

You can watch a YouTube video that explains how to use events here: http://www.youtube.com/watch?v=AA4Lm6ZiEgM
(Note: The above introductory tutorial uses a much earlier version of VoxCommando and so the program looks a bit different, however it is still an excellent introduction to how events function and how they can be used. All concepts still apply.)

An explanation and example of how to use Vera plugin events can be seen in this video: http://www.youtube.com/watch?v=-M7htWfF3tQ.

An explanation and example of how to use Skype plugin events can be seen in this video: https://www.youtube.com/watch?v=jwJAvKWxe_A.

A tutorial explaining how to use Google Calendar and the GgCal plugin to generate events can be seen in this video: https://www.youtube.com/watch?v=oT2GuJe6HJs