Progress Continues
We've already had 21453 updates since Dolphin 5.0. Keep up with Dolphin's continuing progress through the Dolphin Blog: August, September, and October 2023 Progress Report. |
The Dolphin Emulator Wiki needs your help! Dolphin can play thousands of games, and changes are happening all the time. Help us keep up! Join in and help us make this the best resource for Dolphin. |
Pipe Input: Difference between revisions
Techydude3 (talk | contribs) (Added MacOS instructions) |
|||
(One intermediate revision by one other user not shown) | |||
Line 4: | Line 4: | ||
==== Creating the FIFO ==== | ==== Creating the FIFO ==== | ||
First, locate your dolphin-emu user folder (usually in <code>~/.dolphin-emu</code>, <code>~/.config/dolphin-emu</code>, <code> | First, locate your dolphin-emu user folder (usually in <code>~/.dolphin-emu</code>, <code>~/.config/dolphin-emu</code>, <code>~/.local/share/dolphin-emu/Pipes</code>, or <code>~/Library/Application Support/Dolphin/Pipes</code> for macOS), then run: | ||
mkfifo pipe1 | mkfifo pipe1 | ||
Line 49: | Line 49: | ||
Moving a stick (where stick_name is C or MAIN and X and Y values between 0 and 1): | Moving a stick (where stick_name is C or MAIN and X and Y values between 0 and 1): | ||
echo 'SET stick_name X Y' > ~/my-dolphin-directory/pipe1 | echo 'SET stick_name X Y' > ~/my-dolphin-directory/pipe1 | ||
==== Deleting the FIFO ==== | |||
When finished, return to your dolphin-emu user folder, then run: | |||
rm pipe1 | |||
[[Category:Tutorials]] | [[Category:Tutorials]] |
Latest revision as of 20:10, 20 November 2020
Since 4.0-8065, Dolphin supports automated input using unix named pipes. This can be used to write bots, for example, or to automate tedious in-game tasks.
This features only works on UNIX systems for now, and needs some setup to work:
Creating the FIFO
First, locate your dolphin-emu user folder (usually in ~/.dolphin-emu
, ~/.config/dolphin-emu
, ~/.local/share/dolphin-emu/Pipes
, or ~/Library/Application Support/Dolphin/Pipes
for macOS), then run:
mkfifo pipe1
Controller Config
Then you can either perform the task of selecting the pipe input into the controller config dropdown and then sending the button push/release events manually into the configuration dialog (very tedious), or copy the following config section into the Config/GCPadNew.ini file in the user folder.
[GCPad1] Device = Pipe/0/pipe1 Buttons/A = `Button A` Buttons/B = `Button B` Buttons/X = `Button X` Buttons/Y = `Button Y` Buttons/Z = `Button Z` Buttons/Start = `Button START` D-Pad/Up = `Button D_UP` D-Pad/Down = `Button D_DOWN` D-Pad/Left = `Button D_LEFT` D-Pad/Right = `Button D_RIGHT` Triggers/L = `Button L` Triggers/R = `Button R` Main Stick/Up = `Axis MAIN Y -` Main Stick/Down = `Axis MAIN Y +` Main Stick/Left = `Axis MAIN X -` Main Stick/Right = `Axis MAIN X +` C-Stick/Up = `Axis C Y -` C-Stick/Down = `Axis C Y +` C-Stick/Left = `Axis C X -` C-Stick/Right = `Axis C X +`
Interacting
You can interact with the fifo using standard command-line tools such as echo.
Doing a button push:
echo 'PRESS A' > ~/my-dolphin-directory/pipe1
Doing a button release:
echo 'RELEASE A' > ~/my-dolphin-directory/pipe1
Moving a stick (where stick_name is C or MAIN and X and Y values between 0 and 1):
echo 'SET stick_name X Y' > ~/my-dolphin-directory/pipe1
Deleting the FIFO
When finished, return to your dolphin-emu user folder, then run:
rm pipe1