Making a gesture do something else while a key or button is held
What a condition does
A gesture normally does one thing. With a condition, it can do something else at certain times:
- Keys are held: while you hold Ctrl, Alt or Shift on a keyboard, alone or together.
- A toolbar cell is held: while you hold one of your toolbar's buttons with one finger, and make the gesture with your other fingers.
- A setting has a value: while a setting of your own has a particular value. A toolbar button can change the setting, so one button can switch a whole set of gestures over, for example into a "presenting" mode.
The rest of the time, the gesture does its usual action.
Example: maximise a window with a swipe while Ctrl is held
Three fingers swiped up normally opens Task View. Here is how to make the same swipe maximise the window instead, while you hold the Ctrl key.
- On the Gestures page, choose Default gestures on the left, then tap 3 fingers to find the Three finger swipe up card.
- Tap the + on the card. The Add a condition panel opens: "Three Finger Swipe Up does something else while…".
- Tap Keys are held, tap Ctrl, then tap Add: while Ctrl is held.
- A new row appears at the bottom of the card, headed Keyboard modifiers: control, with its own Action:. Choose Window in it, and under Do: choose Maximise.
Now hold Ctrl and swipe three fingers up over a window: it fills the screen. Without Ctrl, the same swipe still opens Task View.
[Screenshot to come: Adding a condition]
[Screenshot to come: A gesture with a condition]
Holding a toolbar button
- Tap the + on the gesture's card and tap A toolbar cell is held.
- Your toolbars are listed, each with a small drawing of its shape. Tap the toolbar.
- Its buttons are drawn as they are on the screen, each with what it does. Tap the button you will hold.
The new row is headed with the toolbar's name and the button's place, for example Toolbar: Presenter, row: 1 column: 2. Give it the action to use while that button is held.
The toolbar must be turned on for this to work: a toolbar that is off is marked Off in the list. You make toolbars on the Toolbars page: see Toolbars.
Using a setting
- Tap the + on the gesture's card and tap A setting has a value.
- Type a Name for the setting, for example
presenter_mode, and the Value it must have, for example1. Tap Add. - Give the new row, headed Setting: presenter_mode = 1, the action to use.
Then give a toolbar button, or another gesture, the action Set a setting with the same
Setting name: and Value: to switch the gesture over, and a second one with another value, such as
0, to switch it back. The name can be anything you like, as long as it is spelt the same in both
places.
Changing or removing a condition
Each condition is a row on the card, with its own Action:. Change the action as for any gesture. To remove a condition, tap the small − at the right of its heading.
A card can have several conditions, each with its own action.
For review
the Add a condition panel was being built while this was written (touchbase-apps 00eb63301, 4 December). This topic describes it as designed: check the wording, the toolbar drawings and the row headings against the finished panel, and take the screenshots from it.
For review
the panel says Ctrl but the row it adds says Keyboard modifiers: control (Commander's text). Consider making the row say "While Ctrl is held" to match.
For review
under A setting has a value the panel says "Set from a toolbar cell, a script or the MCP". "The MCP" and "a script" mean nothing to most customers; suggest "Set by a toolbar button or a gesture".
For review
check what happens when two conditions are true at once (for example Ctrl held and a setting matching): which row's action wins.