Scope and fallback rules
This page states exactly how Input.Observer picks the action for a gesture: which window counts, which group owns it, when the Global group takes over, and which action wins when several could run. Hotkeys and text expansion follow the same group rules, with the differences listed at the end.
Terms
- Scope: the app group whose actions are tried for a gesture. A gesture has one scope, plus Global as a possible fallback.
- Owning group: the one app group a window belongs to. See App groups.
- Fall back to Global: trying the Global group's actions when the owning group has nothing. Two
switches control it, and both must be on:
- Fall back to Global on the General page, When a gesture matches card: for every group at once (on by default);
- Fall back to Global on each app group's What happens in these windows card: for that group (on by default).
The window that counts
For a gesture, the window that counts is the top-level window under the pointer at the moment you press the draw button:
- Where the stroke goes afterwards doesn't matter. A stroke that starts over Notepad and ends over a browser is a Notepad gesture.
- A control inside a window (a text box, a browser page) counts as its whole program window.
- The owning group, the profile check and the region cell are all decided once, at the press. A window title that changes while you draw, or a profile switch during the gesture, doesn't change the outcome of that gesture.
The decision, step by step
At the press
-
Find the owning group. Check the groups in this order and stop at the first one whose rules match the window:
- every ignore group, top to bottom on the Ignore groups page;
- every app group, top to bottom on the App groups page.
Skipped as if absent: a group that isn't Enabled, a group with no rules, and an ignore group set to Only while the window is fullscreen whose window isn't fullscreen right now.
-
An ignore group owns it: the press passes straight through. Nothing else is checked: no fallback to Global, no gesture, and no hotkey or text expansion runs for that window either. See Ignore groups.
-
An app group owns it: its scope is that group if Gestures work here is on and it applies in the active profile (see Profiles). If not, the scope is Global, but only if both Fall back to Global switches are on; otherwise the press passes straight through.
-
No group owns it: the scope is Global. The Fall back to Global switches don't matter here: Global is that window's own group.
-
Global as the scope works only if it is Enabled, its Gestures work here is on, and it applies in the active profile. Otherwise the press passes straight through.
-
Exclusion zones are checked, for every window and for the scope group. A press inside one goes back to the window. See Exclusion zones.
-
The capture starts. The region cell is worked out now, for the scope group and, separately, for Global (see Regions).
A press that passes through in steps 2 to 6 is handed on untouched and without delay, and draws no trail.
At the release
-
The shape. The stroke is scored against the shapes the scope group's triggers use, plus Global's when the scope group can fall back. The best score at or above the match threshold wins; otherwise nothing matches. See How a stroke is matched.
-
The scope group's actions. Go through its actions in list order, and each action's triggers in order. A trigger fits when:
- it is a gesture trigger for the winning shape,
- its action is turned on,
- its action applies in the active profile,
- the modifiers you pressed are exactly the ones it asks for (see Modifiers and timing),
- it accepts the draw button you used,
- when the group has regions on, it covers the region cell you pressed in.
With regions off, the first trigger that fits wins. With regions on, the fitting trigger with the fewest cells wins, and among equally few, the first.
-
Fall back to Global when nothing in step 9 fits and all of these hold: the scope group isn't Global itself, both Fall back to Global switches are on, and Global is enabled, has Gestures work here on and applies in the active profile. Global's actions are then checked exactly as in step 9, with Global's own region cell.
-
Run the winning action, inside the matched group's Before and After actions. See Before and after actions.
-
Nothing fits: nothing runs, the press is not given back, and the Nothing matched global event runs if you set one up.
What wins, in order
| Question | Rule |
|---|---|
| Two groups' rules match the window | The ignore group wins over any app group; otherwise the higher one in its list. Only one group ever owns a window. |
| The owning group has no action for the gesture | Global's actions, if fallback is allowed. Never a lower app group. |
| An app group's action and a Global action both fit | The app group's action, always, whatever their modifiers, buttons or regions. |
| Two shapes score above the threshold | The higher score. |
| Two actions in one group fit (regions off) | The one higher in the group's action list. |
| Two actions in one group fit (regions on) | The one whose trigger covers fewer cells; equal counts, the one higher in the list. |
| Two triggers of one action fit | Regions off: the first trigger. Regions on: the one that covers fewer cells; equal counts, the first. The same action runs either way, but the chosen trigger's own settings apply, such as Held modifier keys. |
| A plain trigger and a trigger asking for Shift, same shape | Only one can fit: the plain one needs no modifier at all during the gesture, the other needs Shift. |
Reorder actions on the Actions page (Move up and Move down), and app groups on the App groups page. The App groups page and the action editor warn when one trigger always hides another.
Fallback in short
| Situation | Without fallback | With fallback (both switches on) |
|---|---|---|
| No group owns the window | Global | Global |
| The owning group has Gestures work here off | Press passes through | Global |
| The owning group doesn't apply in the active profile | Press passes through | Global |
| The owning group has no action for the stroke | Nothing matched | Global's actions are tried |
| An ignore group owns the window | Press passes through | Press passes through |
| The owning group is turned off (Enabled off) | The window is matched against the groups below it, as if this group weren't there | Same |
| Global is turned off | Nothing anywhere Global would be used | Same |
The tray menu's Global Actions item is Global's Enabled switch. While the focused window's group doesn't fall back to Global, the tray icon's tooltip says so, naming the group. See The tray icon.
Worked examples
The examples use this setup:
| List | Group | Rules | Actions |
|---|---|---|---|
| Ignore groups | Remote desktop | Program name is exactly mstsc.exe | none |
| App groups, 1st | Browsers | Program name is exactly chrome.exe | "Back" on Swipe left; "Close tab" on Swipe down |
| App groups, 2nd | Text files | Window title ends with .txt - Notepad | "Save" on Swipe down |
| App groups, 3rd | Notepad | Program name is exactly notepad.exe | "Undo" on Swipe left |
| — | Global | none | "Minimize" on Swipe down; "Maximize" on Swipe up |
Both Fall back to Global switches are on unless an example says otherwise.
1. A shape the group has. You draw Swipe down over Chrome. Browsers owns Chrome and has "Close tab" on Swipe down, so "Close tab" runs. Global's "Minimize" on the same shape never gets a chance: the owning group always wins.
2. A shape only Global has. You draw Swipe up over Chrome. Browsers has nothing for Swipe up, so the gesture falls back to Global and "Maximize" runs, wrapped in Global's Before and After actions, not Browsers'.
3. Fallback off. Turn off Fall back to Global on Browsers, and draw Swipe up over Chrome. Global's shapes no longer compete, so the stroke is compared only with Swipe left and Swipe down. If neither reaches the threshold, nothing matches and the Nothing matched event runs. If one of them does (a sloppy stroke can), that one's action runs. The right-click is not given back either way.
4. Two groups match; only the first counts. Notepad has a file named notes.txt open, so its
title is "notes.txt - Notepad". Both Text files and Notepad match it; Text files is higher, so it
owns the window. You draw Swipe left: neither Text files nor Global uses that shape, so it isn't
even among the shapes compared, and nothing matches. "Undo" in the Notepad group never runs for this
window, because a window never falls to a lower app group. To get "Undo" here, add it to Text files,
or move Notepad above Text files.
5. An ignore group. You draw over a Remote Desktop window. The ignore group owns it, so the press goes straight to the remote computer: no trail, no Global. While that window has the focus, no hotkey action or text expansion runs either.
6. A group turned off, and a group with gestures off. Turn off Enabled on Text files and draw Swipe left over "notes.txt - Notepad": Notepad now owns the window and "Undo" runs. Turn Text files back on but turn off its Gestures work here instead: Text files owns the window again, so Notepad is never reached; the gesture goes to Global, which doesn't use Swipe left, and nothing runs.
7. Profiles. Limit Browsers to a "Work" profile and make no profile active. Browsers still owns Chrome, but doesn't apply, so a gesture over Chrome goes to Global: Swipe down runs "Minimize", not "Close tab". With Fall back to Global off on Browsers, the press passes straight through instead, and the page warns Outside its profiles its windows get nothing.
Hotkeys and text expansion
Hotkeys and text expansion use the same ignore groups, group order, Enabled switches, profiles, Fall back to Global switches, Global group and Before and After actions. These differ:
| Gestures | Hotkeys | Text expansion | |
|---|---|---|---|
| The window that counts | The top-level window under the pointer at the press | The focused window when you press the keys | The focused window when you finish typing the text |
| The group's switch | Gestures work here | Hotkeys work here | none (the Text expansion page has one switch for everything) |
| Regions, draw button | Yes | No | No |
| When the group is decided | Once, at the press | At each key press | At each expansion |
See Hotkeys and Text expansion for what else is particular to each.