Input Syntax: Difference between revisions

Jump to navigation Jump to search
1,187 bytes removed ,  28 July 2016
no edit summary
No edit summary
No edit summary
Line 36: Line 36:
| <code>Button 1</code> results in a syntax error, because the expression is ambiguous.
| <code>Button 1</code> results in a syntax error, because the expression is ambiguous.
Adding backticks around the button name makes it able to be parsed correctly: <code>`Button 1`</code>
Adding backticks around the button name makes it able to be parsed correctly: <code>`Button 1`</code>
|-----------
! ''&#124;''
| The expression is true if the left-hand side (LHS) or the right-hand side (RHS) are true. (This is not an exclusive OR.)
| <code>`Button 1` &#124; `Button 2`</code>
The virtual controller button will be pressed if and only if Button 1 and/or Button 2 are pressed.
|-----------
|-----------
! ''&amp;''
! ''&amp;''
Line 55: Line 50:
| The expression value is equal to the LHS value and the RHS value summed up.
| The expression value is equal to the LHS value and the RHS value summed up.
| <code>`Axis 1+` + `Axis 2+`</code>
| <code>`Axis 1+` + `Axis 2+`</code>
|}
|-----------
 
! ''(''
== Parentheses ==
| The left parenthesis is used to open an expression group.
'''''()''''' parentheses are used to group expressions.
| rowspan="2" | <code>(`Button 1` & `Button 2`) | `Button 3`</code>
 
The virtual controller button will be pressed if both Button 1 and Button 2 are pressed, and/or Button 3 is pressed.
{|
|-----------
|- style="vertical-align: text-top;"
! '')''
| width=50%| The first two parameters don't work.
| The right parenthesis is used to close an expression group.
<pre>`Pad W` & `Button X` | `Pad E` & `Button B`</pre>
|-----------
| width=50%| However using parentheses can solve this.
<pre>(`Pad W` & `Button X`) | (`Pad E` & `Button B`)</pre>
|}
 
== Parameter Examples ==
This is personalized input combination for Fullscreen in hotkey setting. The first parameter is for Guide (Big "X") button on Xbox 360 controller and the final parameters are for Alt + Enter key combination on keyboard. Both devices can trigger Fullscreen.
<pre>Guide | `DInput/0/Keyboard Mouse:RMENU` & `DInput/0/Keyboard Mouse:RETURN`</pre>
 
=== Using ! NOT ===
{|
|- style="vertical-align: text-top;"
| width=50%| Command will always active unless this input is triggered.
<pre>!`Pad W`</pre>
| width=50%| Command will active when Button X is pressed, but it won't be triggered when Pad W is also pressed.
<pre>!`Pad W` & `Button X`</pre>
|-
| width=50%| The first two parameters will not work anymore. [[#Parentheses]] can help.
<pre>!`Pad W` & `Button X` &#124; !`Pad E` & `Button B`</pre>
| width=50%| This will work too.
<pre>`Button X` & !`Pad W` &#124; `Button B` & !`Pad E`</pre>
|}
|}


[[Category:Tutorials]]
[[Category:Tutorials]]

Navigation menu