Input Syntax

From Dolphin Emulator Wiki
Jump to navigation Jump to search

This page explains how to properly assign multiple controls (inputs or outputs) and the control expression syntax in the input configuration dialogs.

Window Buttons

Detect Wait for input from the selected device, and highlight the corresponding input in the list.
Select Copy the selected input name into the control expression field.
Operator Contains a list of mathematical operators.
Functions Contains a list of functions.

Syntax

Token Explanation Example usage
` The backtick is used in cases where the expression is ambiguous. Button 1 results in a syntax error, because the expression is ambiguous.

Adding backticks around the button name makes it able to be parsed correctly: `Button 1`

| The expression is true if the left-hand side (LHS) or the right-hand side (RHS) are true. (This is not an exclusive OR.)

Technically, this is implemented by taking the smaller of the LHS and RHS.

`Button 1` | `Button 2`

The virtual controller button will be pressed if and only if Button 1 and/or Button 2 are pressed.

& The expression is true if both the LHS and the RHS are true.

Technically, this is implemented by taking the greater of the LHS and RHS.

`Button 1` & `Button 2`

The virtual controller button will be pressed if and only if both Button 1 and Button 2 are pressed.

! Negates the following expression's value. !`Button 1`

The virtual controller button will be pressed if and only if Button 1 is not pressed.

+ Sums up the LHS value and the RHS value and clamps the sum to the 0.0-1.0 range. `Axis 1+` + `Axis 2+`
( The left parenthesis is used to open an expression group. (`Button 1` & `Button 2`) | `Button 3`

The virtual controller button will be pressed if both Button 1 and Button 2 are pressed, and/or Button 3 is pressed.

) The right parenthesis is used to close an expression group.
: The LHS is used as the device name, and the RHS is used as the control name. The whole expression may need to be wrapped around backticks so it parses correctly. `evdev/0/Device:Button 0`

The virtual controller button will be pressed if Button 0 (from device "evdev/0/Device") is pressed.