Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,8 @@ Thumbs.db

# Local Claude Code settings (per-machine)
.claude/settings.local.json

# Local StreamController shop checkout (lives at ../xp-sdcontroller)
_xp-sdcontroller/
gh
*.AppImage
22 changes: 22 additions & 0 deletions com.robertw.xplane.sdPlugin/layouts/encoder-value.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"$schema": "https://schemas.elgato.com/streamdeck/plugins/layout.json",
"id": "encoder-value",
"items": [
{
"key": "label",
"type": "text",
"rect": [8, 8, 184, 24],
"font": { "size": 14, "weight": 600 },
"alignment": "center",
"value": ""
},
{
"key": "value",
"type": "text",
"rect": [8, 36, 184, 52],
"font": { "size": 26, "weight": 600 },
"alignment": "center",
"value": ""
}
]
}
23 changes: 23 additions & 0 deletions com.robertw.xplane.sdPlugin/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,29 @@
}
]
},
{
"Name": "Encoder",
"UUID": "com.robertw.xplane.encoder",
"Icon": "imgs/actions/rotary/icon",
"Tooltip": "Stream Deck+ dial: rotate / click / shift. DataRef step (linear or octal) or CW/CCW commands. Live value on the touch strip.",
"PropertyInspectorPath": "ui/encoder.html",
"Controllers": [
"Encoder"
],
"Encoder": {
"layout": "layouts/encoder-value.json",
"TriggerDescription": {
"Rotate": "Fine adjust",
"Push": "Click command"
}
},
"States": [
{
"Image": "imgs/actions/rotary/key",
"TitleAlignment": "middle"
}
]
},
{
"Name": "DataRef Display",
"UUID": "com.robertw.xplane.dataref-display",
Expand Down
188 changes: 188 additions & 0 deletions com.robertw.xplane.sdPlugin/ui/encoder.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
<!doctype html>
<!--
xp_streamdeck - Stream Deck plugin for X-Plane 12
Copyright (c) 2026 thWelly

Licensed under the MIT License.
See the LICENSE file in the project root for full license text.
-->
<html lang="en">
<head>
<meta charset="utf-8" />
<title>X-Plane Encoder</title>
<script src="https://sdpi-components.dev/releases/v4/sdpi-components.js"></script>
<script src="xplane-pi-helpers.js"></script>
<style>
.live-preview {
font-family: monospace;
color: #aaa;
font-size: 11px;
word-break: break-all;
}
.live-preview[data-state="not-found"],
.live-preview[data-state="error"] {
color: #d97;
}
.hint {
color: #888;
font-size: 11px;
padding: 4px 0;
}
</style>
</head>
<body>
<div class="hint">
Rotate = fine. Press+rotate = shift. Press+release (no turn) = click.
</div>

<sdpi-item label="Drive Mode">
<sdpi-select setting="driveMode" default="dataref" id="driveModeSelect">
<option value="dataref">DataRef step</option>
<option value="command">Command pair</option>
</sdpi-select>
</sdpi-item>

<details open id="datarefDrive">
<summary>DataRef rotate</summary>
<sdpi-item label="Step Mode">
<sdpi-select setting="stepMode" default="linear">
<option value="linear">Linear</option>
<option value="octal">Octal / XPDR</option>
</sdpi-select>
</sdpi-item>
<sdpi-item label="Delta">
<sdpi-textfield setting="delta" placeholder="1" inputmode="decimal"></sdpi-textfield>
</sdpi-item>
<sdpi-item label="Min">
<sdpi-textfield setting="minValue" placeholder="optional" inputmode="decimal"></sdpi-textfield>
</sdpi-item>
<sdpi-item label="Max">
<sdpi-textfield setting="maxValue" placeholder="e.g. 7777" inputmode="decimal"></sdpi-textfield>
</sdpi-item>
<sdpi-item label="Cycle">
<sdpi-checkbox
setting="cycle"
label="Wrap at Min/Max (linear step grid)"
></sdpi-checkbox>
</sdpi-item>
<sdpi-item label="Endstop">
<sdpi-checkbox setting="hideEndstopAlert" label="Hide alert at Min/Max"></sdpi-checkbox>
</sdpi-item>
</details>

<details id="commandDrive">
<summary>Command rotate</summary>
<sdpi-item label="CW">
<sdpi-textfield setting="commandPath" placeholder="…_up" id="commandField"></sdpi-textfield>
</sdpi-item>
<sdpi-item label="CCW">
<sdpi-textfield
setting="commandPathReverse"
placeholder="…_down"
id="commandReverseField"
></sdpi-textfield>
</sdpi-item>
</details>

<details open>
<summary>Click</summary>
<sdpi-item label="Command">
<sdpi-textfield
setting="clickCommand"
placeholder="optional"
id="clickCommandField"
></sdpi-textfield>
</sdpi-item>
<sdpi-item label="Hold">
<sdpi-checkbox
setting="clickHoldMode"
label="begin/end while pressed (cancelled if shifted)"
></sdpi-checkbox>
</sdpi-item>
</details>

<details open>
<summary>Shift (press + rotate)</summary>
<sdpi-item label="Shift Delta">
<sdpi-textfield
setting="coarseDelta"
placeholder="DataRef coarse (octal: 8/64/512)"
inputmode="decimal"
></sdpi-textfield>
</sdpi-item>
<sdpi-item label="Shift CW">
<sdpi-textfield
setting="shiftCommandPath"
placeholder="optional"
id="shiftCommandField"
></sdpi-textfield>
</sdpi-item>
<sdpi-item label="Shift CCW">
<sdpi-textfield
setting="shiftCommandPathReverse"
placeholder="optional"
id="shiftCommandReverseField"
></sdpi-textfield>
</sdpi-item>
</details>

<sdpi-item label="DataRef Path">
<sdpi-textfield
setting="datarefPath"
placeholder="sim/cockpit2/radios/actuators/transponder_code"
id="datarefField"
></sdpi-textfield>
</sdpi-item>
<sdpi-item label="Live Value">
<span class="live-preview" id="datarefPreview"></span>
</sdpi-item>
<sdpi-item label="Label">
<sdpi-textfield setting="label" placeholder="shown above value"></sdpi-textfield>
</sdpi-item>
<sdpi-item label="Format">
<sdpi-textfield setting="format" placeholder="%.0f"></sdpi-textfield>
</sdpi-item>
<sdpi-item label="Unit">
<sdpi-textfield setting="unit" placeholder="optional"></sdpi-textfield>
</sdpi-item>
<sdpi-item label="Unit Scale">
<sdpi-textfield setting="unitScale" placeholder="optional" inputmode="decimal"></sdpi-textfield>
</sdpi-item>
<sdpi-item label="Precision">
<sdpi-textfield setting="precision" placeholder="optional" inputmode="numeric"></sdpi-textfield>
</sdpi-item>

<script>
(async () => {
const driveModeSelect = document.getElementById("driveModeSelect");
const datarefDrive = document.getElementById("datarefDrive");
const commandDrive = document.getElementById("commandDrive");
const sync = () => {
const mode = driveModeSelect?.value ?? "dataref";
if (datarefDrive) datarefDrive.open = mode === "dataref";
if (commandDrive) commandDrive.open = mode === "command";
};
driveModeSelect?.addEventListener("valuechange", sync);
driveModeSelect?.addEventListener("input", sync);
setTimeout(sync, 0);
setTimeout(sync, 200);

if (!window.XPlanePI) return;
for (const [id, kind] of [
["commandField", "command"],
["commandReverseField", "command"],
["clickCommandField", "command"],
["shiftCommandField", "command"],
["shiftCommandReverseField", "command"],
["datarefField", "dataref"],
]) {
const el = document.getElementById(id);
if (el) await window.XPlanePI.attachAutocomplete(el, kind);
}
const datarefField = document.getElementById("datarefField");
const preview = document.getElementById("datarefPreview");
if (datarefField) await window.XPlanePI.attachLivePreview(datarefField, preview);
})();
</script>
</body>
</html>
13 changes: 11 additions & 2 deletions com.robertw.xplane.sdPlugin/ui/rotary-dataref.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,17 @@
</sdpi-item>
<div class="hint">
Leave Min/Max empty for unbounded setpoints. With both set, the value
clamps at the endstops and the button flashes the alert icon when
already at the limit (unless suppressed below).
clamps at the endstops (unless Cycle is checked) and the button flashes
the alert icon when already at the limit (unless suppressed below).
</div>
<sdpi-item label="Cycle">
<sdpi-checkbox
setting="cycle"
label="Wrap at Min/Max (step through the grid and repeat)"
></sdpi-checkbox>
</sdpi-item>
<div class="hint">
Requires Min and Max. Example: Min 0, Max 30, Delta 10 → 0→10→20→30→0.
</div>
<sdpi-item label="Feedback">
<sdpi-checkbox
Expand Down
40 changes: 36 additions & 4 deletions com.robertw.xplane.sdPlugin/ui/rotary.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,44 @@
</sdpi-item>
<sdpi-item label="Direction">
<sdpi-select setting="direction" default="right">
<option value="right">Right (CW)</option>
<option value="left">Left (CCW)</option>
<option value="up">Up</option>
<option value="down">Down</option>
<option value="right">Right (CW / +delta)</option>
<option value="left">Left (CCW / −delta)</option>
<option value="up">Up (+delta)</option>
<option value="down">Down (−delta)</option>
</sdpi-select>
</sdpi-item>
<details>
<summary>DataRef step (optional — instead of Command on press)</summary>
<div class="hint">
When Delta is set, press writes DataRef Path by ±Delta (Direction sets the
sign) instead of firing Command Path. Use with Min/Max/Cycle like Rotary DataRef.
</div>
<sdpi-item label="Delta">
<sdpi-textfield
setting="delta"
placeholder="leave empty to use Command Path"
inputmode="decimal"
></sdpi-textfield>
</sdpi-item>
<sdpi-item label="Min Value">
<sdpi-textfield setting="minValue" placeholder="optional" inputmode="decimal"></sdpi-textfield>
</sdpi-item>
<sdpi-item label="Max Value">
<sdpi-textfield setting="maxValue" placeholder="optional" inputmode="decimal"></sdpi-textfield>
</sdpi-item>
<sdpi-item label="Cycle">
<sdpi-checkbox
setting="cycle"
label="Wrap at Min/Max (step through the grid and repeat)"
></sdpi-checkbox>
</sdpi-item>
<sdpi-item label="Endstop">
<sdpi-checkbox
setting="hideEndstopAlert"
label="Hide alert when already at Min/Max"
></sdpi-checkbox>
</sdpi-item>
</details>
<sdpi-item label="DataRef Path">
<sdpi-textfield
setting="datarefPath"
Expand Down
Loading