Skip to main content

Global events

A global event runs a script when something happens, whichever program is in front. There are 13 of them, always the same 13: you set each one up, turn it on or off, and never add or remove one. Unlike actions, global events don't belong to an app group.

note

Advanced mode. The Global events page is in the Engine section of the navigation, which the configuration window shows in Advanced mode only.

Set up an event​

Input.ObserverSimpleAdvanced
AUTOMATION
Actions
Text expansion
Snippets
Recorder
Sandbox
App groups
Ignore groups
Gestures
ENGINE
Global events
Exclusion zones
Scripts
Plugins
SETUP
General
Appearance
Profiles
Console
Security
Help
About
Global events
13 events the engine can react to, whichever app is in front
Mouse & wheel
EventScriptWhen it fires
Middle buttonSteps, 1 stepDown & up
Right buttonNothing set upDown only
Wheel — verticalNothing set upPer tick
Enable this event
Edit script →
Swallow the input
Run this as
StepsScript
Done
  1. Find the event's row. Turn on its switch ① to enable it.
  2. Click Set up → (or Edit script → when it already has one) ②. The row opens in place; one row is open at a time.
  3. For a mouse button or wheel, choose whether to Swallow the input ③ (Swallow the input).
  4. Under Run this as ④, choose Steps or Script (or AutoHotkey, when AutoHotkey is turned on in General settings), and write what it does (Actions).
  5. Click Done, then save.

The row's middle column summarizes the script, for example Steps, 3 steps, or Nothing set up. An event that is on with nothing set up shows that summary as a warning: it runs nothing. The navigation badge counts the enabled events.

The 13 events​

EventCardFires
Left button, Middle button, Right button, Side button 1, Side button 2Mouse & wheelWhen the button goes down, and again when it comes up (Down & up). For a draw button, only when it goes down (Down only).
Wheel — verticalMouse & wheelFor each wheel tick (Per tick).
Wheel — horizontalMouse & wheelFor each tick of a tilt wheel or sideways scroll (Per tick).
Draw button releasedGesture outcomesWhen the draw button that started a gesture is released (After each capture).
Nothing matchedGesture outcomesWhen a drawn gesture ran no action (After a gesture ends).
Config loadedSystem & lifecycleWhen the engine starts, and again after every save or Reload Config (Start, save and reload).
Engine shutting downSystem & lifecycleWhen the engine exits (Prompts if it overruns).
Hardware added or removedSystem & lifecycleWhen a device is plugged in or removed (Real arrivals only).
Foreground window changedSystem & lifecycleEach time another window comes to the front (Skipped while disabled).

A script can tell what fired it with the Context builtins: for example whether a mouse button went down or up, and which button and window were involved (Builtins).

Mouse buttons​

A mouse-button event fires for every press of that button, wherever the pointer is: over ignored programs, inside exclusion zones, and during a gesture (a button pressed during a gesture also counts as a gesture modifier). It never fires for clicks that Input.Observer's own scripts send.

For a button that is also a draw button (General, Draw buttons), the event fires only when the button goes down; the row says Down only and notes the button is used to draw gestures. The press still starts a gesture as usual. To react to the release, use Draw button released.

When Windows has the mouse buttons switched, button names follow Windows: Right button is the one that opens context menus.

The wheel​

A wheel event fires for each tick, whatever the program under the pointer, and also during a gesture. It doesn't fire inside an exclusion zone that covers that wheel.

The scripts for one wheel event run one at a time, in order. If ticks arrive faster than the script finishes, up to 8 wait their turn; ticks beyond that are dropped.

Minimum gap between ticks (Advanced mode, inside the open row; default 0) sets the shortest time between two ticks that run the script. 0 runs it for every tick. With a gap, a tick that arrives sooner after the last accepted one is dropped, never queued. The vertical and horizontal wheels each have their own gap. The same two values appear as Wheel throttle on the General page; changing one changes the other.

Swallow the input​

The five mouse buttons and the two wheels can Swallow the input: the click or scroll never reaches any program, and the script becomes responsible for whatever should happen instead. A swallowed press also swallows its release.

  • A draw button can't be swallowed, because its press must always reach gesture capture. The switch is unavailable and says why. If the configuration file turns it on anyway, the engine turns it off when it loads, and the row shows a warning until you turn it off here too.
  • Swallowing with no script is allowed, but the row warns you: the click or scroll simply disappears.
  • Swallowing a wheel that has a minimum gap: a tick inside the gap is swallowed and dropped. It doesn't scroll and doesn't run the script. The row warns about this too.

Gesture outcomes​

Draw button released fires when the draw button whose press started a gesture is released, whatever happened: the gesture ran an action, matched nothing, turned out to be a plain click and was passed on, or was drawn for training. It does not fire when the press never started a gesture (an ignored program, an exclusion zone, an ignored modifier key held), or when the gesture had already ended before the release (the cancel timeout).

Nothing matched fires when you drew a gesture (moved at least the minimum gesture movement) and no action matched it in the window's app group or in Global. It does not fire for a plain click, or while gestures are being trained.

System and lifecycle events​

  • Config loaded runs at engine start. If it is still running after Start and shutdown wait (Scripts page; default 10 seconds), you are asked whether to keep waiting. It runs again after every save from the configuration window and every Reload Config, after scripts still running have been stopped; that run has no time limit and no prompt, and is skipped while the engine is disabled.
  • Engine shutting down runs when the engine exits, never on a reload. If it is still running after Start and shutdown wait, you are asked whether to keep waiting or let the engine exit. It is never cut off without asking.
  • Hardware added or removed fires when a device actually arrives or is removed, not for the routine device notifications Windows sends in between. It is skipped while the engine is disabled.
  • Foreground window changed fires each time a different window comes to the front. It is skipped while the engine is disabled.
warning

A Foreground window changed script that shows a window (a message box, for example) brings that window to the front, which fires the event again, and again. If that happens, press the stop-all actions hotkey (General page): it stops every script and turns off input handling and this event until you choose Reload Config from the tray menu.

When global events don't fire​

  • While the engine is disabled from the tray, or paused because a window with Pause everything while focused has focus (Ignore groups). Config loaded still runs at startup.
  • In Safe Mode, where no configured script runs.
  • For input sent by Input.Observer's own scripts.

Ignore groups, app groups and profiles don't affect global events.