steaminput

package
v1.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 27, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package steaminput routes games without DualSense support through Steam Input. Each such game gets a non-Steam shortcut in the user's shortcuts.vdf (in a "Seaglass" collection) and is started with steam://rungameid/…, so Steam presents the controller as an Xbox pad.

Steam keeps shortcuts.vdf in memory and writes it back when it exits, so the file is only changed while Steam is closed.

Index

Constants

View Source
const Tag = "Seaglass"

Tag is the Steam collection Seaglass's shortcuts go in.

Variables

View Source
var ErrNoSteam = errors.New("Steam isn't installed or no Steam account has signed in on this PC")

ErrNoSteam means Steam isn't installed or has no signed-in account.

Functions

func Add

func Add(files []string, list []Shortcut) error

Add puts the shortcuts that are missing into every file. Steam must be closed. The first time a file is changed, a copy of the original is kept next to it (shortcuts.vdf.seaglass-backup).

func Files

func Files() ([]string, error)

Files returns the shortcuts.vdf of the Steam account(s) used on this PC.

func Find

func Find(files []string, s Shortcut) (id uint32, ok bool)

Find returns the id of an existing shortcut for s in every file, or ok=false when any file lacks one.

func Running

func Running() bool

Running reports whether Steam runs.

func Shutdown

func Shutdown(ctx context.Context) error

Shutdown asks Steam to exit and waits until it has.

func URI

func URI(id uint32) string

URI starts the shortcut through Steam.

Types

type Shortcut

type Shortcut struct {
	Name    string
	Exe     string // full path
	WorkDir string
	Args    string
}

Shortcut is a game as Steam should start it.

func (Shortcut) ID

func (s Shortcut) ID() uint32

ID is the id Steam gives a non-Steam shortcut: a CRC of the quoted exe and the name, with the top bit set.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL