Repository navigation
feat(frontend,installer): map the controller to keyboard and mouse with a Workshop layout - #5
Merged
Merged
Conversation
…th a Workshop layout A player could turn, switch weapons and fire in Deus Ex with the controller, but not walk: a game made for keyboard and mouse needs a layout that maps the controller to them, and Steam keeps one per game. - The site gets a Controller section: a box, off by default, and once it is ticked a field for a link to a layout on SteamInputDB, next to a link that searches it for the title. The ID goes into recipe.json as controller_layout. - The installer asks Steam which controller the layout is made for, writes "workshop" "<ID>" for the game into that controller's configset file while Steam is down, and checks it after the restart. Steam fetches the layout by itself, verified on a Deck. A layout that could not be set leaves the game installed, and the last window says so. - The uninstaller takes the entry out, backing the file up first, and --purge also removes the game's shader cache and the emptied <slug> folder. - steamGridDbUrl is getSteamGridDbUrl: functions of services start with a verb.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Feedback from a player: of the games added, only Myst worked with the controller out of the box. Syberia wanted a real mouse, and in Deus Ex the controller could turn, switch weapons and fire, but not walk. A game made for keyboard and mouse needs a layout that maps the controller to them. Steam keeps one per game and controller type, and community layouts come from the Workshop (SPEC 7.8).
What
Site
getLayoutIdtakes the ID out ofsteaminputdb.com/config/<ID>or a bare ID, and anything else is marked in the field with an example of a right link. Neither Steam nor SteamInputDB answers a page on another site, so the link is all there is to go by.recipe.jsonascontroller_layout, null with the box off. With the box ticked, the build waits for a layout. Another archive unticks the box and empties the field.steamGridDbUrlis renamedgetSteamGridDbUrl: functions of services start with a verb.Installer
ISteamRemoteStorage/GetPublishedFileDetails, which needs no key, which controller the layout is made for: the layout'scontroller_*tag.configset_controller_<type>.vdfand writes"workshop" "<ID>"for the game into it, keyed by the game's name the way Steam keys shortcuts. After the restart it checks that the entry is still there. A missing entry is logged and shown, not retried: a layout is no reason to restart Steam once more.install.pywrites such things asNOTE:lines, andsetup.shadds them to the window.--purgealso removes the game'sshadercache/<appid>and the<slug>folder once nothing else is in it. Both were left behind after every purge on a Deck and had to be deleted by hand.Verified on a Deck
SteamOS 3.8.28 in Desktop Mode, with Deus Ex Revision and the layout
3037080160(controller_neptune), built into a.runwith this installer:controller layout: 3037080160, made for controller_neptune, and after the restartcontroller layout: kept.steamapps/workshop/content/241100/3037080160/, so the installer downloads nothing. The game played with the layout on its first launch.--uninstall --purgeremoved the shortcut, Proton, the layout entry, the game folder and the prefix, and Steam's rewrite ofshortcuts.vdfdid not bring the shortcut back. The shader cache and the empty folder were then removed by hand: the--purgechange above is covered by the self-test, not run on the Deck yet.Notes
editorconfig-checkerfinds no errors..runit builds, so the installer part reaches a player once the site is deployed and the.runis built again.