From 4f624debdf2f45a3952dc00d1b4679fc779bd60e Mon Sep 17 00:00:00 2001 From: RustyRaptor Date: Fri, 30 Oct 2026 15:53:36 -0600 Subject: [PATCH] feat(vdf): KeyValues parser with real-config fixtures Ordered children with duplicate keys, case-insensitive lookup, nil-safe accessors, escapes, comments, [$PLATFORM] conditionals, UTF-8 BOM. Scans of all 232 local Steam controller configs parse cleanly. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013UzjWSBjtVZ2zi8fJxS2hH --- .gitignore | 3 + go.mod | 3 + internal/vdf/scan_local_test.go | 53 + internal/vdf/vdf.go | 287 ++++ internal/vdf/vdf_test.go | 138 ++ mise.toml | 25 + testdata/vdf/desktop_neptune.vdf | 2213 ++++++++++++++++++++++++++++++ 7 files changed, 2722 insertions(+) create mode 100644 .gitignore create mode 100644 go.mod create mode 100644 internal/vdf/scan_local_test.go create mode 100644 internal/vdf/vdf.go create mode 100644 internal/vdf/vdf_test.go create mode 100644 mise.toml create mode 100644 testdata/vdf/desktop_neptune.vdf diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..01a745e --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/bin/ +*.test +/testdata/hid/local/ diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..f7a221b --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module github.com/RustyRaptor/deckhud + +go 1.27.3 diff --git a/internal/vdf/scan_local_test.go b/internal/vdf/scan_local_test.go new file mode 100644 index 0000000..b4d8f74 --- /dev/null +++ b/internal/vdf/scan_local_test.go @@ -0,0 +1,53 @@ +package vdf + +import ( + "os" + "path/filepath" + "testing" +) + +// TestParseLocalSteamConfigs parses every .vdf under $DECKHUD_SCAN_DIR. It is a +// smoke test against real-world files and is skipped unless the variable is set. +func TestParseLocalSteamConfigs(t *testing.T) { + dir := os.Getenv("DECKHUD_SCAN_DIR") + if dir == "" { + t.Skip("set DECKHUD_SCAN_DIR to scan local Steam configs") + } + n := 0 + err := filepath.WalkDir(dir, func(path string, d os.DirEntry, err error) error { + if err != nil || d.IsDir() || filepath.Ext(path) != ".vdf" { + return err + } + f, err := os.Open(path) + if err != nil { + return err + } + defer f.Close() + if _, err := Parse(f); err != nil { + t.Errorf("%s: %v", path, err) + } + n++ + return nil + }) + if err != nil { + t.Fatal(err) + } + t.Logf("parsed %d files", n) +} + +func TestParseFixtures(t *testing.T) { + files, _ := filepath.Glob("../../testdata/vdf/*.vdf") + if len(files) == 0 { + t.Fatal("no fixtures found") + } + for _, path := range files { + f, err := os.Open(path) + if err != nil { + t.Fatal(err) + } + if _, err := Parse(f); err != nil { + t.Errorf("%s: %v", path, err) + } + f.Close() + } +} diff --git a/internal/vdf/vdf.go b/internal/vdf/vdf.go new file mode 100644 index 0000000..87f52c1 --- /dev/null +++ b/internal/vdf/vdf.go @@ -0,0 +1,287 @@ +// Package vdf parses Valve's text KeyValues format (".vdf"), as used by Steam +// Input controller configurations. +// +// Keys may repeat (a group has many "binding" entries), so a block keeps its +// children as an ordered list rather than a map. Key lookups ignore case, as +// Steam does. All accessors are safe to call on a nil *Node, which makes deep +// optional lookups such as n.Get("a").Get("b").Str("c") cheap to write. +package vdf + +import ( + "bufio" + "fmt" + "io" + "strings" +) + +// Node is either a leaf (Key/Value) or a block (Key/Children). +type Node struct { + Key string + Value string + Children []*Node // nil for leaves, non-nil (possibly empty) for blocks + Line int // 1-based line where the key appeared +} + +// IsBlock reports whether n is a block rather than a leaf. +func (n *Node) IsBlock() bool { return n != nil && n.Children != nil } + +// Get returns the first child whose key matches (case-insensitively), or nil. +func (n *Node) Get(key string) *Node { + if n == nil { + return nil + } + for _, c := range n.Children { + if strings.EqualFold(c.Key, key) { + return c + } + } + return nil +} + +// All returns every child whose key matches, in file order. +func (n *Node) All(key string) []*Node { + if n == nil { + return nil + } + var out []*Node + for _, c := range n.Children { + if strings.EqualFold(c.Key, key) { + out = append(out, c) + } + } + return out +} + +// Str returns the value of the first leaf child with the given key, or "". +func (n *Node) Str(key string) string { + if c := n.Get(key); c != nil && !c.IsBlock() { + return c.Value + } + return "" +} + +// Parse reads a whole document. The returned root is a synthetic block whose +// children are the document's top-level entries. +func Parse(r io.Reader) (*Node, error) { + br := bufio.NewReader(r) + if c, _, err := br.ReadRune(); err == nil && c != 0xFEFF { + _ = br.UnreadRune() // Valve's stock templates start with a UTF-8 BOM + } + p := &parser{lx: lexer{r: br, line: 1}} + root := &Node{Children: []*Node{}} + if err := p.parseBlock(root, true); err != nil { + return nil, err + } + return root, nil +} + +type tokKind int + +const ( + tokEOF tokKind = iota + tokString + tokOpen + tokClose + tokCond // [$PLATFORM] conditional, ignored +) + +type token struct { + kind tokKind + text string + line int +} + +type parser struct { + lx lexer + peeked *token +} + +func (p *parser) next() (token, error) { + if p.peeked != nil { + t := *p.peeked + p.peeked = nil + return t, nil + } + return p.lx.next() +} + +func (p *parser) peek() (token, error) { + if p.peeked == nil { + t, err := p.lx.next() + if err != nil { + return t, err + } + p.peeked = &t + } + return *p.peeked, nil +} + +func (p *parser) parseBlock(parent *Node, top bool) error { + for { + t, err := p.next() + if err != nil { + return err + } + switch t.kind { + case tokEOF: + if !top { + return fmt.Errorf("vdf: line %d: unterminated block %q", parent.Line, parent.Key) + } + return nil + case tokClose: + if top { + return fmt.Errorf("vdf: line %d: unexpected '}'", t.line) + } + return nil + case tokOpen, tokCond: + return fmt.Errorf("vdf: line %d: expected key", t.line) + } + + node := &Node{Key: t.text, Line: t.line} + v, err := p.next() + if err != nil { + return err + } + if v.kind == tokCond { + if v, err = p.next(); err != nil { + return err + } + } + switch v.kind { + case tokString: + node.Value = v.text + if c, err := p.peek(); err != nil { + return err + } else if c.kind == tokCond { + p.peeked = nil + } + case tokOpen: + node.Children = []*Node{} + if err := p.parseBlock(node, false); err != nil { + return err + } + default: + return fmt.Errorf("vdf: line %d: key %q has no value", t.line, t.text) + } + parent.Children = append(parent.Children, node) + } +} + +type lexer struct { + r *bufio.Reader + line int +} + +func (l *lexer) read() (rune, bool) { + c, _, err := l.r.ReadRune() + if err != nil { + return 0, false + } + if c == '\n' { + l.line++ + } + return c, true +} + +func (l *lexer) unread(c rune) { + _ = l.r.UnreadRune() + if c == '\n' { + l.line-- + } +} + +func (l *lexer) next() (token, error) { + for { + c, ok := l.read() + if !ok { + return token{kind: tokEOF, line: l.line}, nil + } + switch { + case c == ' ' || c == '\t' || c == '\r' || c == '\n': + continue + case c == '/': + if n, ok := l.read(); ok && n == '/' { + for { + c, ok := l.read() + if !ok || c == '\n' { + break + } + } + continue + } else if ok { + l.unread(n) + } + return l.bare(c) + case c == '{': + return token{kind: tokOpen, line: l.line}, nil + case c == '}': + return token{kind: tokClose, line: l.line}, nil + case c == '[': + start := l.line + for { + c, ok := l.read() + if !ok { + return token{}, fmt.Errorf("vdf: line %d: unterminated conditional", start) + } + if c == ']' { + return token{kind: tokCond, line: start}, nil + } + } + case c == '"': + return l.quoted() + default: + return l.bare(c) + } + } +} + +func (l *lexer) quoted() (token, error) { + start := l.line + var b strings.Builder + for { + c, ok := l.read() + if !ok { + return token{}, fmt.Errorf("vdf: line %d: unterminated string", start) + } + switch c { + case '"': + return token{kind: tokString, text: b.String(), line: start}, nil + case '\\': + n, ok := l.read() + if !ok { + return token{}, fmt.Errorf("vdf: line %d: unterminated string", start) + } + switch n { + case 'n': + b.WriteRune('\n') + case 't': + b.WriteRune('\t') + case '\\', '"': + b.WriteRune(n) + default: + b.WriteRune('\\') + b.WriteRune(n) + } + default: + b.WriteRune(c) + } + } +} + +func (l *lexer) bare(first rune) (token, error) { + start := l.line + var b strings.Builder + b.WriteRune(first) + for { + c, ok := l.read() + if !ok { + break + } + if c == ' ' || c == '\t' || c == '\r' || c == '\n' || c == '"' || c == '{' || c == '}' || c == '[' { + l.unread(c) + break + } + b.WriteRune(c) + } + return token{kind: tokString, text: b.String(), line: start}, nil +} diff --git a/internal/vdf/vdf_test.go b/internal/vdf/vdf_test.go new file mode 100644 index 0000000..53348b4 --- /dev/null +++ b/internal/vdf/vdf_test.go @@ -0,0 +1,138 @@ +package vdf + +import ( + "strings" + "testing" +) + +func mustParse(t *testing.T, src string) *Node { + t.Helper() + n, err := Parse(strings.NewReader(src)) + if err != nil { + t.Fatalf("Parse: %v", err) + } + return n +} + +func TestParseLeafAndBlock(t *testing.T) { + root := mustParse(t, ` +"controller_mappings" +{ + "version" "3" + "title" "d4sktop" + "actions" + { + "Default" + { + "title" "Desktop" + } + } +}`) + cm := root.Get("controller_mappings") + if cm == nil || !cm.IsBlock() { + t.Fatalf("controller_mappings block missing: %+v", root) + } + if got := cm.Str("version"); got != "3" { + t.Errorf("version = %q, want 3", got) + } + if got := cm.Get("actions").Get("Default").Str("title"); got != "Desktop" { + t.Errorf("nested title = %q, want Desktop", got) + } +} + +func TestDuplicateKeysPreservedInOrder(t *testing.T) { + root := mustParse(t, `"bindings" { "binding" "key_press LEFT_CONTROL, , " "binding" "key_press V, , " }`) + got := root.Get("bindings").All("binding") + if len(got) != 2 { + t.Fatalf("got %d bindings, want 2", len(got)) + } + if got[0].Value != "key_press LEFT_CONTROL, , " || got[1].Value != "key_press V, , " { + t.Errorf("wrong order/values: %q, %q", got[0].Value, got[1].Value) + } +} + +func TestKeysAreCaseInsensitive(t *testing.T) { + root := mustParse(t, `"Actions" { "Title" "x" }`) + if root.Get("actions").Str("title") != "x" { + t.Error("lookup should ignore case") + } +} + +func TestMissingKeysAreNilSafe(t *testing.T) { + root := mustParse(t, `"a" { }`) + if got := root.Get("nope").Get("deeper").Str("x"); got != "" { + t.Errorf("want empty string, got %q", got) + } + if root.Get("nope").All("x") != nil { + t.Error("All on nil node should be nil") + } + if !root.Get("a").IsBlock() || len(root.Get("a").Children) != 0 { + t.Error("empty block should be a block with no children") + } +} + +func TestEscapesCommentsUnquotedAndConditionals(t *testing.T) { + root := mustParse(t, ` +// leading comment +"root" +{ + "quote" "say \"hi\"\\n" // trailing comment + "tab" "a\tb" + unquoted value + "cond" "win" [$WIN32] + "blk" [$LINUX] + { + "k" "v" + } +}`) + r := root.Get("root") + if got := r.Str("quote"); got != `say "hi"\n` { + t.Errorf("quote = %q", got) + } + if got := r.Str("tab"); got != "a\tb" { + t.Errorf("tab = %q", got) + } + if got := r.Str("unquoted"); got != "value" { + t.Errorf("unquoted = %q", got) + } + if got := r.Str("cond"); got != "win" { + t.Errorf("cond = %q", got) + } + if got := r.Get("blk").Str("k"); got != "v" { + t.Errorf("conditional block child = %q", got) + } +} + +func TestStringsMaySpanLinesAndContainBraces(t *testing.T) { + root := mustParse(t, "\"a\" \"line1\nline2 { }\"") + if got := root.Str("a"); got != "line1\nline2 { }" { + t.Errorf("got %q", got) + } +} + +func TestErrorsReportLine(t *testing.T) { + cases := map[string]string{ + "unterminated block": "\"a\"\n{\n\"b\" \"c\"\n", + "unterminated string": "\"a\" \"oops\n", + "stray close": "\"a\" \"b\"\n}\n", + "key without value": "\"a\"\n", + } + for name, src := range cases { + t.Run(name, func(t *testing.T) { + _, err := Parse(strings.NewReader(src)) + if err == nil { + t.Fatal("expected error") + } + if !strings.Contains(err.Error(), "line ") { + t.Errorf("error should mention a line: %v", err) + } + }) + } +} + +func TestLeadingByteOrderMarkAndCRLF(t *testing.T) { + root := mustParse(t, "\xef\xbb\xbf\"controller_mappings\"\r\n{\r\n\t\"version\"\t\t\"3\"\r\n}\r\n") + if got := root.Get("controller_mappings").Str("version"); got != "3" { + t.Errorf("version = %q, want 3", got) + } +} diff --git a/mise.toml b/mise.toml new file mode 100644 index 0000000..c6f86b7 --- /dev/null +++ b/mise.toml @@ -0,0 +1,25 @@ +[tools] +go = "1.27.3" + +[env] +CGO_ENABLED = "0" + +[tasks.test] +description = "Run all tests" +depends = ["test:go", "test:qml"] + +[tasks."test:go"] +description = "Run Go tests" +run = "go test ./..." + +[tasks."test:qml"] +description = "Run QML tests offscreen" +run = "[ -d ui/tests ] && QT_QPA_PLATFORM=offscreen /usr/lib/qt6/bin/qmltestrunner -input ui/tests -import ui || true" + +[tasks.check] +description = "Vet and format check" +run = ["go vet ./...", "test -z \"$(gofmt -l .)\""] + +[tasks.build] +description = "Build the daemon" +run = "go build -o bin/deckhudd ./cmd/deckhudd" diff --git a/testdata/vdf/desktop_neptune.vdf b/testdata/vdf/desktop_neptune.vdf new file mode 100644 index 0000000..e872d62 --- /dev/null +++ b/testdata/vdf/desktop_neptune.vdf @@ -0,0 +1,2213 @@ +"controller_mappings" +{ + "version" "3" + "revision" "203" + "title" "d4sktop dogeeeee" + "description" "#SettingsController_AutosaveDescription" + "creator" "0" + "progenitor" "usercloud://413080/d4sktop dogeeeee_0" + "url" "autosave://testdata/desktop_neptune.vdf" + "export_type" "personal_local" + "controller_type" "controller_neptune" + "controller_caps" "23117823" + "major_revision" "0" + "minor_revision" "0" + "timestamp" "0" + "actions" + { + "Default" + { + "title" "Desktop" + "legacy_set" "1" + } + "Preset_1000001" + { + "title" "Gamepad" + "legacy_set" "1" + } + } + "action_layers" + { + } + "group" + { + "id" "0" + "mode" "four_buttons" + "name" "" + "description" "" + "inputs" + { + "button_a" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "key_press RETURN, , " + } + } + } + "disabled_activators" + { + } + } + "button_b" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "key_press ESCAPE, , " + } + } + } + "disabled_activators" + { + } + } + "button_x" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "key_press TAB, , " + } + } + } + "disabled_activators" + { + } + } + "button_y" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "key_press LEFT_SHIFT, , " + } + } + } + "disabled_activators" + { + } + } + } + } + "group" + { + "id" "1" + "mode" "dpad" + "name" "" + "description" "" + "inputs" + { + "dpad_north" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "xinput_button dpad_up, , " + } + "settings" + { + "haptic_intensity" "1" + } + } + } + "disabled_activators" + { + } + } + "dpad_south" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "xinput_button dpad_down, , " + } + "settings" + { + "haptic_intensity" "1" + } + } + } + "disabled_activators" + { + } + } + "dpad_east" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "xinput_button dpad_right, , " + } + "settings" + { + "haptic_intensity" "1" + } + } + } + "disabled_activators" + { + } + } + "dpad_west" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "xinput_button dpad_left, , " + } + "settings" + { + "haptic_intensity" "1" + } + } + } + "disabled_activators" + { + } + } + } + } + "group" + { + "id" "2" + "mode" "joystick_move" + "name" "" + "description" "" + "inputs" + { + "click" + { + "activators" + { + "Soft_Press" + { + "bindings" + { + "binding" "xinput_button JOYSTICK_RIGHT, , " + } + } + } + "disabled_activators" + { + } + } + } + } + "group" + { + "id" "3" + "mode" "joystick_move" + "name" "" + "description" "" + "inputs" + { + "click" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "xinput_button JOYSTICK_LEFT, , " + } + "settings" + { + "haptic_intensity" "2" + } + } + } + "disabled_activators" + { + } + } + } + "settings" + { + "deadzone_inner_radius" "7199" + } + } + "group" + { + "id" "4" + "mode" "trigger" + "name" "" + "description" "" + "inputs" + { + "click" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "mouse_button RIGHT, , " + } + "settings" + { + "haptic_intensity" "2" + } + } + } + "disabled_activators" + { + } + } + "edge" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "mouse_button RIGHT, , " + } + "settings" + { + "haptic_intensity" "2" + } + } + } + "disabled_activators" + { + } + } + } + } + "group" + { + "id" "5" + "mode" "trigger" + "name" "" + "description" "" + "inputs" + { + "click" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "mouse_button LEFT, , " + } + "settings" + { + "haptic_intensity" "2" + } + } + } + "disabled_activators" + { + } + } + "edge" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "mouse_button LEFT, , " + } + "settings" + { + "haptic_intensity" "2" + } + } + } + "disabled_activators" + { + } + } + } + } + "group" + { + "id" "6" + "mode" "joystick_move" + "name" "" + "description" "" + "inputs" + { + "click" + { + "activators" + { + "Soft_Press" + { + "bindings" + { + "binding" "xinput_button JOYSTICK_RIGHT, , " + } + } + } + "disabled_activators" + { + } + } + } + } + "group" + { + "id" "8" + "mode" "joystick_move" + "name" "" + "description" "" + "inputs" + { + "click" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "xinput_button JOYSTICK_RIGHT, , " + } + } + } + "disabled_activators" + { + } + } + } + } + "group" + { + "id" "9" + "mode" "dpad" + "name" "" + "description" "" + "inputs" + { + "dpad_north" + { + "activators" + { + "Double_Press" + { + "bindings" + { + "binding" "key_press EQUALS, , " + } + "settings" + { + "haptic_intensity" "1" + } + } + "Full_Press" + { + "bindings" + { + "binding" "key_press UP_ARROW, , " + } + } + } + "disabled_activators" + { + } + } + "dpad_south" + { + "activators" + { + "Double_Press" + { + "bindings" + { + "binding" "key_press DASH, , " + } + "settings" + { + "haptic_intensity" "1" + } + } + "Full_Press" + { + "bindings" + { + "binding" "key_press DOWN_ARROW, , " + } + } + } + "disabled_activators" + { + } + } + "dpad_east" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "key_press RIGHT_ARROW, , " + } + "settings" + { + "haptic_intensity" "1" + } + } + } + "disabled_activators" + { + } + } + "dpad_west" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "key_press LEFT_ARROW, , " + } + "settings" + { + "haptic_intensity" "1" + } + } + } + "disabled_activators" + { + } + } + } + "settings" + { + "requires_click" "0" + "haptic_intensity_override" "0" + } + } + "group" + { + "id" "10" + "mode" "single_button" + "name" "" + "description" "" + "inputs" + { + "click" + { + "activators" + { + "Soft_Press" + { + "bindings" + { + "binding" "xinput_button START, , " + } + } + } + "disabled_activators" + { + } + } + } + } + "group" + { + "id" "11" + "mode" "single_button" + "name" "" + "description" "" + "inputs" + { + "click" + { + "activators" + { + "Soft_Press" + { + "bindings" + { + "binding" "mouse_button RIGHT, , " + } + } + } + "disabled_activators" + { + } + } + } + } + "group" + { + "id" "12" + "mode" "mouse_joystick" + "name" "" + "description" "" + "inputs" + { + "click" + { + "activators" + { + "Soft_Press" + { + "bindings" + { + "binding" "xinput_button JOYSTICK_RIGHT, , " + } + } + } + "disabled_activators" + { + } + } + } + } + "group" + { + "id" "14" + "mode" "absolute_mouse" + "name" "" + "description" "" + "inputs" + { + } + } + "group" + { + "id" "15" + "mode" "four_buttons" + "name" "" + "description" "" + "inputs" + { + } + } + "group" + { + "id" "17" + "mode" "four_buttons" + "name" "" + "description" "" + "inputs" + { + "button_a" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "xinput_button A, , " + } + } + } + "disabled_activators" + { + } + } + "button_b" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "xinput_button B, , " + } + } + } + "disabled_activators" + { + } + } + "button_x" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "xinput_button X, , " + } + } + } + "disabled_activators" + { + } + } + "button_y" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "xinput_button Y, , " + } + } + } + "disabled_activators" + { + } + } + } + } + "group" + { + "id" "18" + "mode" "single_button" + "name" "" + "description" "" + "inputs" + { + "click" + { + "activators" + { + "Soft_Press" + { + "bindings" + { + "binding" "mouse_button RIGHT, , " + } + } + } + "disabled_activators" + { + } + } + } + } + "group" + { + "id" "19" + "mode" "absolute_mouse" + "name" "" + "description" "" + "inputs" + { + "click" + { + "activators" + { + "Soft_Press" + { + "bindings" + { + "binding" "mouse_button LEFT, , " + } + } + } + "disabled_activators" + { + } + } + } + } + "group" + { + "id" "20" + "mode" "joystick_move" + "name" "" + "description" "" + "inputs" + { + "click" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "xinput_button JOYSTICK_LEFT, , " + } + "settings" + { + "haptic_intensity" "2" + } + } + } + "disabled_activators" + { + } + } + } + "settings" + { + "deadzone_inner_radius" "7199" + } + } + "group" + { + "id" "21" + "mode" "trigger" + "name" "" + "description" "" + "inputs" + { + } + "settings" + { + "output_trigger" "1" + } + } + "group" + { + "id" "22" + "mode" "trigger" + "name" "" + "description" "" + "inputs" + { + } + "settings" + { + "output_trigger" "2" + } + } + "group" + { + "id" "23" + "mode" "joystick_move" + "name" "" + "description" "" + "inputs" + { + "click" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "xinput_button JOYSTICK_RIGHT, , " + } + } + } + "disabled_activators" + { + } + } + } + } + "group" + { + "id" "24" + "mode" "dpad" + "name" "" + "description" "" + "inputs" + { + "dpad_north" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "xinput_button DPAD_UP, , " + } + "settings" + { + "haptic_intensity" "1" + } + } + } + "disabled_activators" + { + } + } + "dpad_south" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "xinput_button DPAD_DOWN, , " + } + "settings" + { + "haptic_intensity" "1" + } + } + } + "disabled_activators" + { + } + } + "dpad_east" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "xinput_button DPAD_RIGHT, , " + } + "settings" + { + "haptic_intensity" "1" + } + } + } + "disabled_activators" + { + } + } + "dpad_west" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "xinput_button DPAD_LEFT, , " + } + "settings" + { + "haptic_intensity" "1" + } + } + } + "disabled_activators" + { + } + } + } + "settings" + { + "requires_click" "0" + "haptic_intensity_override" "0" + } + } + "group" + { + "id" "25" + "mode" "joystick_mouse" + "name" "" + "description" "" + "inputs" + { + "click" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "mouse_button LEFT, , " + } + } + } + "disabled_activators" + { + } + } + } + "settings" + { + "output_joystick" "2" + } + } + "group" + { + "id" "26" + "mode" "scrollwheel" + "name" "" + "description" "" + "inputs" + { + "scroll_clockwise" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "mouse_wheel SCROLL_DOWN, , " + } + } + } + "disabled_activators" + { + } + } + "scroll_counterclockwise" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "mouse_wheel SCROLL_UP, , " + } + } + } + "disabled_activators" + { + } + } + "click" + { + "activators" + { + "Soft_Press" + { + "bindings" + { + "binding" "mouse_button MIDDLE, , " + } + } + } + "disabled_activators" + { + } + } + } + "settings" + { + "scroll_angle" "160" + } + } + "group" + { + "id" "27" + "mode" "dpad" + "name" "" + "description" "" + "inputs" + { + "dpad_north" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "key_press UP_ARROW, , " + } + } + } + "disabled_activators" + { + } + } + "dpad_south" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "key_press DOWN_ARROW, , " + } + } + } + "disabled_activators" + { + } + } + "dpad_east" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "key_press RIGHT_ARROW, , " + } + } + } + "disabled_activators" + { + } + } + "dpad_west" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "key_press LEFT_ARROW, , " + } + } + } + "disabled_activators" + { + } + } + "click" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "key_press RIGHT_CONTROL, , " + "binding" "key_press K, , " + } + } + } + "disabled_activators" + { + } + } + } + "settings" + { + "requires_click" "0" + } + } + "group" + { + "id" "29" + "mode" "four_buttons" + "name" "" + "description" "" + "inputs" + { + "button_a" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "key_press RETURN, , " + } + } + } + "disabled_activators" + { + } + } + "button_b" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "key_press ESCAPE, , " + } + } + } + "disabled_activators" + { + } + } + "button_x" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "key_press TAB, , " + } + } + } + "disabled_activators" + { + } + } + "button_y" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "key_press LEFT_SHIFT, , " + } + } + } + "disabled_activators" + { + } + } + } + } + "group" + { + "id" "31" + "mode" "scrollwheel" + "name" "" + "description" "" + "inputs" + { + "scroll_clockwise" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "mouse_wheel SCROLL_UP, , " + } + "settings" + { + "haptic_intensity" "3" + } + } + } + "disabled_activators" + { + } + } + "scroll_counterclockwise" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "mouse_wheel SCROLL_DOWN, , " + } + } + } + "disabled_activators" + { + } + } + "click" + { + "activators" + { + "Soft_Press" + { + "bindings" + { + "binding" "mouse_button MIDDLE, , " + } + } + } + "disabled_activators" + { + } + } + } + "settings" + { + "scroll_type" "1" + } + } + "group" + { + "id" "33" + "mode" "2dscroll" + "name" "" + "description" "" + "inputs" + { + "click" + { + "activators" + { + "Soft_Press" + { + "bindings" + { + "binding" "mouse_button MIDDLE, , " + } + } + } + "disabled_activators" + { + } + } + "dpad_north" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "mouse_wheel SCROLL_UP, , " + } + "settings" + { + "haptic_intensity" "1" + } + } + } + "disabled_activators" + { + } + } + "dpad_south" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "mouse_wheel SCROLL_DOWN, , " + } + "settings" + { + "haptic_intensity" "1" + } + } + } + "disabled_activators" + { + } + } + "dpad_east" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "key_press LEFT_ARROW, , " + } + "settings" + { + "haptic_intensity" "1" + } + } + } + "disabled_activators" + { + } + } + "dpad_west" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "key_press RIGHT_ARROW, , " + } + "settings" + { + "haptic_intensity" "1" + } + } + } + "disabled_activators" + { + } + } + } + "settings" + { + "sensitivity" "175" + "scroll_friction" "1" + } + } + "group" + { + "id" "34" + "mode" "scrollwheel" + "name" "" + "description" "" + "inputs" + { + } + } + "group" + { + "id" "35" + "mode" "radial_menu" + "name" "text ops" + "description" "" + "inputs" + { + "touch_menu_button_1" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "key_press LEFT_CONTROL, , ghost_045_move_0010.png, " + "binding" "key_press V, , ghost_045_move_0010.png, " + } + "settings" + { + "haptic_intensity" "2" + } + } + } + "disabled_activators" + { + } + } + "touch_menu_button_2" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "key_press LEFT_CONTROL, , ghost_070_setting_0300.png, " + "binding" "key_press Z, , ghost_070_setting_0300.png, " + } + "settings" + { + "haptic_intensity" "2" + } + } + } + "disabled_activators" + { + } + } + "touch_menu_button_3" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "key_press LEFT_CONTROL, , ghost_040_act_0331.png, " + "binding" "key_press X, , ghost_040_act_0331.png, " + } + "settings" + { + "haptic_intensity" "2" + } + } + } + "disabled_activators" + { + } + } + "touch_menu_button_4" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "key_press LEFT_CONTROL, , ghost_070_setting_0303.png, " + "binding" "key_press C, , ghost_070_setting_0303.png, " + } + "settings" + { + "haptic_intensity" "2" + } + } + } + "disabled_activators" + { + } + } + "touch_menu_button_5" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "key_press LEFT_CONTROL, , ghost_070_setting_0304.png, " + "binding" "key_press A, , ghost_070_setting_0304.png, " + } + "settings" + { + "haptic_intensity" "2" + } + } + } + "disabled_activators" + { + } + } + "touch_menu_button_6" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "key_press LEFT_CONTROL, , ghost_075_utility_020.png, " + "binding" "key_press S, , ghost_075_utility_020.png, " + } + "settings" + { + "haptic_intensity" "2" + } + } + } + "disabled_activators" + { + } + } + "touch_menu_button_7" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "key_press LEFT_CONTROL, , ghost_070_setting_0301.png, " + "binding" "key_press LEFT_SHIFT, , ghost_070_setting_0301.png, " + "binding" "key_press Z, , ghost_070_setting_0301.png, " + } + "settings" + { + "haptic_intensity" "2" + } + } + } + "disabled_activators" + { + } + } + } + "settings" + { + "touchmenu_button_fire_type" "0" + "haptic_intensity" "3" + } + } + "group" + { + "id" "37" + "mode" "radial_menu" + "name" "" + "description" "" + "inputs" + { + "touch_menu_button_1" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "key_press LEFT_CONTROL, , ghost_045_move_0010.png, " + "binding" "key_press V, , ghost_045_move_0010.png, " + } + "settings" + { + "haptic_intensity" "2" + } + } + } + "disabled_activators" + { + } + } + "touch_menu_button_2" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "key_press LEFT_CONTROL, , ghost_070_setting_0300.png, " + "binding" "key_press Z, , ghost_070_setting_0300.png, " + } + "settings" + { + "haptic_intensity" "2" + } + } + } + "disabled_activators" + { + } + } + "touch_menu_button_3" + { + "activators" + { + "chord" + { + "bindings" + { + "binding" "key_press LEFT_CONTROL, , ghost_040_act_0331.png, " + "binding" "key_press X, , ghost_040_act_0331.png, " + } + "settings" + { + "haptic_intensity" "2" + } + } + } + "disabled_activators" + { + } + } + "touch_menu_button_4" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "key_press LEFT_CONTROL, , ghost_070_setting_0303.png, " + "binding" "key_press C, , ghost_070_setting_0303.png, " + } + "settings" + { + "haptic_intensity" "2" + } + } + } + "disabled_activators" + { + } + } + "touch_menu_button_5" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "key_press LEFT_CONTROL, , ghost_070_setting_0304.png, " + "binding" "key_press A, , ghost_070_setting_0304.png, " + } + "settings" + { + "haptic_intensity" "2" + } + } + } + "disabled_activators" + { + } + } + "touch_menu_button_6" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "key_press LEFT_CONTROL, , ghost_075_utility_020.png, " + "binding" "key_press S, , ghost_075_utility_020.png, " + } + "settings" + { + "haptic_intensity" "2" + } + } + } + "disabled_activators" + { + } + } + "touch_menu_button_7" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "key_press LEFT_SHIFT, , ghost_070_setting_0301.png, " + "binding" "key_press LEFT_CONTROL, , ghost_070_setting_0301.png, " + "binding" "key_press Z, , ghost_070_setting_0301.png, " + } + "settings" + { + "haptic_intensity" "2" + } + } + } + "disabled_activators" + { + } + } + } + "settings" + { + "touchmenu_button_fire_type" "0" + "haptic_intensity" "3" + } + } + "group" + { + "id" "39" + "mode" "radial_menu" + "name" "" + "description" "" + "inputs" + { + } + } + "group" + { + "id" "41" + "mode" "radial_menu" + "name" "" + "description" "" + "inputs" + { + } + } + "group" + { + "id" "43" + "mode" "scrollwheel" + "name" "" + "description" "" + "inputs" + { + "scroll_clockwise" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "mouse_wheel SCROLL_UP, , " + } + "settings" + { + "haptic_intensity" "2" + } + } + } + "disabled_activators" + { + } + } + "scroll_counterclockwise" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "mouse_wheel SCROLL_DOWN, , " + } + "settings" + { + "haptic_intensity" "2" + } + } + } + "disabled_activators" + { + } + } + "click" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "mouse_button MIDDLE, , " + } + "settings" + { + "haptic_intensity" "2" + } + } + } + "disabled_activators" + { + } + } + } + "settings" + { + "scroll_angle" "140" + "scroll_friction" "1" + } + } + "group" + { + "id" "45" + "mode" "absolute_mouse" + "name" "" + "description" "" + "inputs" + { + } + } + "group" + { + "id" "46" + "mode" "scrollwheel" + "name" "" + "description" "" + "inputs" + { + } + } + "group" + { + "id" "47" + "mode" "flickstick" + "name" "" + "description" "" + "inputs" + { + } + } + "group" + { + "id" "48" + "mode" "2dscroll" + "name" "" + "description" "" + "inputs" + { + "dpad_north" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "mouse_wheel SCROLL_UP, , " + } + "settings" + { + "haptic_intensity" "1" + } + } + } + "disabled_activators" + { + } + } + "dpad_south" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "mouse_wheel SCROLL_DOWN, , " + } + "settings" + { + "haptic_intensity" "1" + } + } + } + "disabled_activators" + { + } + } + } + "settings" + { + "scroll_friction" "3" + } + } + "group" + { + "id" "7" + "mode" "switches" + "name" "" + "description" "" + "inputs" + { + "button_escape" + { + "activators" + { + "Double_Press" + { + "bindings" + { + "binding" "key_press F11, , " + } + } + "Long_Press" + { + "bindings" + { + "binding" "key_press F12, , " + } + } + "Full_Press" + { + "bindings" + { + "binding" "key_press F10, , " + } + } + } + "disabled_activators" + { + } + } + "button_menu" + { + "activators" + { + "Double_Press" + { + "bindings" + { + "binding" "controller_action SCREENSHOT, , " + } + } + "Full_Press" + { + "bindings" + { + "binding" "key_press LEFT_WINDOWS, , " + } + } + } + "disabled_activators" + { + } + } + "left_bumper" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "key_press LEFT_ALT, , " + } + } + } + "disabled_activators" + { + } + } + "right_bumper" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "key_press RIGHT_CONTROL, , " + } + } + } + "disabled_activators" + { + } + } + "button_back_left" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "key_press SPACE, , " + } + } + } + "disabled_activators" + { + } + } + "button_back_right" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "key_press LEFT_CONTROL, , " + "binding" "key_press V, , " + } + } + "Double_Press" + { + "bindings" + { + "binding" "key_press LEFT_SHIFT, , " + "binding" "key_press LEFT_CONTROL, , " + "binding" "key_press V, , " + } + } + } + "disabled_activators" + { + } + } + "button_back_left_upper" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "key_press DELETE, , " + } + } + "Long_Press" + { + "bindings" + { + "binding" "controller_action CHANGE_PRESET 2 1 1, , " + } + } + } + "disabled_activators" + { + } + } + "button_back_right_upper" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "key_press RIGHT_SHIFT, , " + "binding" "key_press LEFT_WINDOWS, , " + "binding" "key_press PERIOD, , " + } + } + } + "disabled_activators" + { + } + } + } + } + "group" + { + "id" "16" + "mode" "switches" + "name" "" + "description" "" + "inputs" + { + "button_escape" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "xinput_button start, , " + } + } + "Long_Press" + { + "bindings" + { + "binding" "controller_action CHANGE_PRESET 1 1 1, , " + } + } + } + "disabled_activators" + { + } + } + "button_menu" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "xinput_button select, , " + } + } + } + "disabled_activators" + { + } + } + "left_bumper" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "xinput_button shoulder_left, , " + } + } + } + "disabled_activators" + { + } + } + "right_bumper" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "xinput_button shoulder_right, , " + } + } + } + "disabled_activators" + { + } + } + "button_back_left_upper" + { + "activators" + { + "Long_Press" + { + "bindings" + { + "binding" "controller_action CHANGE_PRESET 1 1 1, , " + } + } + } + "disabled_activators" + { + } + } + } + } + "preset" + { + "id" "0" + "name" "Default" + "group_source_bindings" + { + "7" "switch active" + "0" "button_diamond inactive" + "29" "button_diamond active" + "1" "left_trackpad inactive" + "11" "left_trackpad inactive" + "15" "left_trackpad inactive" + "26" "left_trackpad inactive" + "31" "left_trackpad inactive" + "33" "left_trackpad inactive" + "45" "left_trackpad inactive" + "46" "left_trackpad inactive" + "47" "left_trackpad inactive" + "48" "left_trackpad active" + "2" "right_trackpad inactive" + "6" "right_trackpad inactive" + "10" "right_trackpad inactive" + "12" "right_trackpad inactive" + "14" "right_trackpad active" + "3" "joystick inactive" + "27" "joystick inactive" + "35" "joystick inactive" + "43" "joystick active" + "4" "left_trigger active" + "5" "right_trigger active" + "8" "right_joystick inactive" + "25" "right_joystick inactive" + "34" "right_joystick inactive" + "37" "right_joystick active" + "39" "right_joystick inactive" + "41" "right_joystick inactive" + "9" "dpad active" + } + } + "preset" + { + "id" "1" + "name" "Preset_1000001" + "group_source_bindings" + { + "16" "switch active" + "17" "button_diamond active" + "18" "left_trackpad active" + "19" "right_trackpad active" + "20" "joystick active" + "21" "left_trigger active" + "22" "right_trigger active" + "23" "right_joystick active" + "24" "dpad active" + } + } + "settings" + { + "left_trackpad_mode" "0" + "right_trackpad_mode" "0" + } +}