Skip to content

Commit e4ebdef

Browse files
authored
EmulationStation: add more scripting entry points (#102)
* EmulationStation: add more scripting entry points
1 parent 3d8f3df commit e4ebdef

File tree

1 file changed

+32
-8
lines changed

1 file changed

+32
-8
lines changed

docs/EmulationStation.md

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -272,23 +272,47 @@ Linux (as user `pi`): `mkdir ~/.emulationstation/scripts`
272272

273273
Inside the scripts folder, create a new directory for the kind of event you want to script:
274274

275-
| Name | When | Arguments (max. 2) |
276-
|:-------------------|:-------------------------------------------------------------------------|:---------------------------|
275+
| Name | When | Arguments (max. 4) |
276+
|:--------------------|:--------------------------------------------------------------------------|:----------------------------|
277277
| `quit` | on program quit | `%quit_mode%` |
278278
| `reboot` | on system reboot (also calls quit first) | |
279279
| `shutdown` | on system shutdown (also calls quit first) | |
280280
| `config-changed` | on the change of any configuration option | |
281281
| `controls-changed` | on change of the control settings (also calls config first) | |
282282
| `settings-changed` | on change of the regular (non-control) settings (also calls config first) | |
283283
| `theme-changed` | on change of theme (also calls settings-changed after) | `%new_theme%` `%old_theme%` |
284-
| `game-start` | before starting a game | `%rom_path%` `%rom_name%` |
284+
| `game-start` | before starting a game | `%rom_path%` `%rom_name%` `%game_name%` |
285285
| `game-end` | after finishing a game | |
286-
| `sleep` | station is without user input for more than `systemSleepTime` | see note (\*) |
287-
| `wake` | station returns from sleep (i.e. user input) | |
288-
| `screensaver-start` | after screensaver starts | |
289-
| `scrensaver-stop` | after screensaver stops | |
286+
| `sleep` | station is without user input for more than `systemSleepTime` | see note 1. |
287+
| `wake` | station returns from sleep (i.e. user input) | see note 1. |
288+
| `screensaver-start` | after screensaver starts | |
289+
| `scrensaver-stop` | after screensaver stops | |
290+
| `screensaver-game-select` | screensaver is displaying the media for a game | `%system_name%` `%rom_path%` `%game_name%` `%media%` <br> see note 2. |
291+
| `system-select` | after a system is selected | `%system_name%` `%access_type%` <br>see note 3. |
292+
| `game-select` | after a game is selected in the gamelist | `%system_name%` `%rom_path%` `%game_name%` `%access_type%` <br> see note 4. |
290293

291-
(\*) sleep/wake use no arguments. `systemSleepTime` is usually after `screenSaverTime` (both editable in the Screensaver Menu). A value of `0` disables sleep and the screensaver respectively.
294+
**Notes**
295+
296+
1. **sleep/wake** use no arguments.
297+
298+
`systemSleepTime` is usually after `screenSaverTime` (both editable in the Screensaver Menu). A value of `0` disables sleep and the screensaver respectively.
299+
300+
2. **%media%** is one of:
301+
302+
* `randomvideo`: a video is played when screensaver is set to _Random Video_
303+
* `slideshow`: a picture is displayed when screensaver is set to _Slideshow_
304+
305+
3. **%access_type%** is one of:
306+
307+
* `gotostart`: when EmulationStation is set to start on a certain system and the system is opened on startup
308+
* `input`: when the system is selected in the carousel
309+
310+
4. **%access_type%** is one of:
311+
312+
* `requestedgame`: when EmulationStation is set to start on a certain system and the game is selected after startup
313+
* `input`: when the game is selected while browsing a system's gamelist
314+
315+
`%system_name%`, `%system_path%` and `%game_name%` will be set to **NULL** (literal string) when there are no games in the system
292316

293317
#### 3. Script calling
294318

0 commit comments

Comments
 (0)