1
0
mirror of https://github.com/4yn/slidershim.git synced 2024-11-12 00:40:49 +01:00
This commit is contained in:
4yn 2022-02-09 22:30:10 +08:00
parent 2ae7a81f22
commit e2dec75e6b
7 changed files with 447 additions and 16 deletions

120
README.md
View File

@ -1,16 +1,108 @@
# Todo
<img align="right" alt="logo" width="100" height="100" src="public/icon.png">
- major
- acio support
- qol
- more error handling
- comments
- when umiguri comes out
- ouptut websocket
- led websocket
# slidershim
```
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
$env:RUST_BACKTRACE = "1";
yarn tauri dev
```
Software adapter for various Chunithm slider controllers with a built-in Brokenithm web controller. Has support for keyboard/gamepad output and LED lighting.
[Download link](https://github.com/4yn/slidershim/releases/latest)
<img width="300" alt="screenshot" src="res/screenshots/demo.png">
## Setup Instructions
1. [Download here](https://github.com/4yn/slidershim/releases/latest)
2. Extract to any location you like.
3. Run `slidershim.exe`.
4. Pick your input device, output method and preferred lighting.
5. Click apply.
6. ???
7. Profit!
### Extra Pointers
- Less resources are used when the configuration window is hidden.
- Un-hide the configuration window from the system tray.
- For gamepad output, you will need to install [ViGEmBus](https://github.com/ViGEm/ViGEmBus/releases/latest) for it to work.
- For serial LED input, you may need to install [com0com](https://sourceforge.net/projects/com0com/files/com0com/2.2.2.0/) to bridge slidershim with the LED data stream.
### Brokenithm Setup
1. Set the device option to "Brokenithm" and apply.
2. Allow firewall access to `slidershim.exe`
3. Connect a touch device to the same wifi or local network as your windows machine
> Windows hotspot works too, but make sure to give "public" firewall access
4. Open the web controller in your tablet device web browser. One of the links should work.
1. Either manually type in the IP address if you know what IP it is;
2. Or scan the generated "Broknenithm QR" to get a list of clickable links and save some typing.
5. (Optional) Add the webpage to home screen and/or enable guided access to avoid accidentally exiting the web controller.
## Output Layouts
![layouts](./res/layouts/layout.png)
## Troubleshooting
<details>
<summary><strong>My controller is not recognised</strong></summary>
- slidershim supports the GAMO2 Tasoller on HID firmware and Yuancon Laverita v2 controllers on HID firmware.
- If you are using a Tasoller controller, make sure it has the correct HID firmware installed.
- If your hardware controller is not one of these, it will not work.
- Hotplug is not supported. If you plugged in the controller after starting slidershim, re-connect your controller by just clicking the "Apply" button (even if it is grey).
</details>
<details>
<summary><strong>I am using a controller and my keyboard buttons are pressed too often</strong></summary>
- Adjust the sensitivity options.
- The higher the number, the harder it is for keyboard buttons to be pressed.
</details>
<details>
<summary><strong>The Brokenithm controller cannot be loaded</strong></summary>
- Make sure that you can load the controller in your web browser _from the same windows machine that is running slidershim_.
- Close the windows machine web browser afterwards once you have tested it.
- Double check that your tablet device is connected to the same wifi or local network.
- Try restarting slidershim.
</details>
<details>
<summary><strong>The Brokenithm controller is stuck</strong></summary>
- Applying changes to the slidershim configuration will reset the brokenithm controller.
- Refresh the web page or force-stop the controller from your tablet device's task switcher and re-open the controller.
</details>
<details>
<summary><strong>I am still having problems</strong></summary>
- Join the [Cons&amp;Stuff Discord](https://discord.com/invite/zFGemg4r) and ping me there.
- Try to bring your logs.
</details>
<details>
<summary><strong>Neardayo layout?</strong></summary>
- [Neardayo layout.](https://youtu.be/8dA-RCSB-qA?t=25)
</details>
## Technical Information
- Built with Rust, [tauri](https://github.com/tauri-apps/tauri) + [Svelte](https://github.com/sveltejs/svelte), [rusb](https://github.com/a1ien/rusb), [hyper](https://github.com/hyperium/hyper/), [tokio-](https://github.com/snapview/tokio-tungstenite)[tungstenite](https://github.com/snapview/tungstenite-rs) and [serialport](https://crates.io/crates/serialport)
- USB device polling is done on a dedicated thread while everything else is done on a async runtime.
## Planned Features
- Major:
- Support AC slider serial protocol
- Output and LED websocket adapters when UMIGURI comes out
- QOL:
- Documentation
- Comprehensive logging and error handling

5
notes.md Normal file
View File

@ -0,0 +1,5 @@
```
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
$env:RUST_BACKTRACE = "1";
yarn tauri dev
```

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

334
res/layouts/index.html Normal file
View File

@ -0,0 +1,334 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<style>
body {
max-width: 650px;
margin: 40px auto;
padding: 0 10px;
font: 18px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
"Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji",
"Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
color: #444;
}
h1,
h2,
h3 {
line-height: 1.2;
}
@media (prefers-color-scheme: dark) {
body {
color: #ccc;
background: black;
}
a:link {
color: #5bf;
}
a:visited {
color: #ccf;
}
}
.layout {
display: grid;
width: 36rem;
height: 13rem;
margin-bottom: 2rem;
gap: 0.5rem;
grid: 1.5rem 8.5rem 2rem / 32rem 3.5rem;
grid-template-areas:
"t a"
"b a"
"e a";
}
.name {
display: flex;
flex: row nowrap;
align-items: center;
justify-content: flex-start;
grid-area: t;
}
.ground {
grid-area: b;
display: grid;
width: 100%;
height: 100%;
gap: 0.25rem;
font-size: 1.5rem;
font-family: monospace;
}
.ground div {
display: flex;
align-items: center;
justify-content: center;
background-color: #ff04;
}
.ground.ground-32 {
grid: repeat(2, 1fr) / repeat(16, 1fr);
}
.ground.ground-16 {
grid: repeat(1, 1fr) / repeat(16, 1fr);
}
.ground.ground-8 {
grid: repeat(1, 1fr) / repeat(8, 1fr);
}
.ground.ground-voltex {
grid: repeat(2, 1fr) / repeat(8, 1fr);
grid-template-areas:
"ll lr a b c d rl rr"
"ll lr fl fl fr fr rl rr";
}
.air {
grid-area: a;
display: grid;
width: 100%;
height: 100%;
grid: repeat(6, 1fr) / repeat(1, 1fr);
gap: 0.25rem;
font-family: monospace;
}
.air div {
display: flex;
align-items: center;
justify-content: center;
background-color: #0ff4;
}
.air.air-single {
grid: repeat(1, 1fr) / repeat(1, 1fr);
}
.air.air-voltex {
grid-template-areas:
"rr"
"rl"
"rl"
"lr"
"lr"
"ll";
}
.extra {
grid-area: e;
display: grid;
width: 100%;
height: 100%;
grid: repeat(1, 1fr) / repeat(3, 1fr);
gap: 0.25rem;
font-family: monospace;
}
.extra div {
display: flex;
align-items: center;
justify-content: center;
background-color: #f004;
}
</style>
<title>Slidershim Layouts</title>
</head>
<body>
<div class="layout">
<div class="name">Keyboard 32-zone, Tasoller Layout</div>
<div class="ground ground-32">
<div>1</div>
<div>Q</div>
<div>2</div>
<div>W</div>
<div>3</div>
<div>E</div>
<div>4</div>
<div>R</div>
<div>5</div>
<div>T</div>
<div>6</div>
<div>Y</div>
<div>7</div>
<div>U</div>
<div>8</div>
<div>I</div>
<div>A</div>
<div>Z</div>
<div>S</div>
<div>X</div>
<div>D</div>
<div>C</div>
<div>F</div>
<div>V</div>
<div>G</div>
<div>B</div>
<div>H</div>
<div>N</div>
<div>J</div>
<div>M</div>
<div>K</div>
<div>,</div>
</div>
<div class="air">
<div>]</div>
<div>[</div>
<div>;</div>
<div>.</div>
<div>'</div>
<div>/</div>
</div>
<div class="extra">
<div>[enter]</div>
<div>[space]</div>
<div>[esc]</div>
</div>
</div>
<div class="layout">
<div class="name">Keyboard 32-zone, Yuancon Layout</div>
<div class="ground ground-32">
<div>5</div>
<div>3</div>
<div>1</div>
<div>Y</div>
<div>W</div>
<div>U</div>
<div>S</div>
<div>Q</div>
<div>O</div>
<div>M</div>
<div>K</div>
<div>I</div>
<div>G</div>
<div>E</div>
<div>C</div>
<div>A</div>
<div>6</div>
<div>4</div>
<div>2</div>
<div>Z</div>
<div>X</div>
<div>V</div>
<div>T</div>
<div>R</div>
<div>P</div>
<div>N</div>
<div>L</div>
<div>J</div>
<div>H</div>
<div>F</div>
<div>D</div>
<div>B</div>
</div>
<div class="air">
<div>;</div>
<div>\</div>
<div>]</div>
<div>[</div>
<div>=</div>
<div>-</div>
</div>
<div class="extra">
<div>[enter]</div>
<div>[space]</div>
<div>[esc]</div>
</div>
</div>
<div class="layout">
<div class="name">Keyboard 8-zone, Deemo Layout</div>
<div class="ground ground-8">
<div>A</div>
<div>S</div>
<div>D</div>
<div>F</div>
<div>J</div>
<div>K</div>
<div>L</div>
<div>;</div>
</div>
<div class="air air-single">
<div>
<span style="writing-mode: vertical-lr">[space]</span>
</div>
</div>
<div class="extra">
<div>[disabled]</div>
<div>[disabled]</div>
<div>[disabled]</div>
</div>
</div>
<div class="layout">
<div class="name">Keyboard 10-zone, Voltex/Neardayo Layout</div>
<div class="ground ground-voltex">
<div style="grid-area: ll">W</div>
<div style="grid-area: lr">E</div>
<div style="grid-area: rl">O</div>
<div style="grid-area: rr">P</div>
<div style="grid-area: a">D</div>
<div style="grid-area: b">F</div>
<div style="grid-area: c">J</div>
<div style="grid-area: d">K</div>
<div style="grid-area: fl">C</div>
<div style="grid-area: fr">M</div>
</div>
<div class="air air-voltex">
<div style="grid-area: rr">P</div>
<div style="grid-area: rl">O</div>
<div style="grid-area: lr">E</div>
<div style="grid-area: ll">W</div>
</div>
<div class="extra">
<div>1</div>
<div>[esc]</div>
<div>[enter]</div>
</div>
</div>
<div class="layout">
<div class="name">XBOX 360 Gamepad, Voltex/Neardayo Layout</div>
<div class="ground ground-voltex">
<div style="grid-area: ll">LS<br />&lt;&lt;</div>
<div style="grid-area: lr">LS<br />&gt;&gt;</div>
<div style="grid-area: rl">RS<br />&lt;&lt;</div>
<div style="grid-area: rr">RS<br />&gt;&gt;</div>
<div style="grid-area: a">A</div>
<div style="grid-area: b">B</div>
<div style="grid-area: c">X</div>
<div style="grid-area: d">Y</div>
<div style="grid-area: fl">LB</div>
<div style="grid-area: fr">RB</div>
</div>
<div class="air air-voltex">
<div style="grid-area: rr">RS&gt;</div>
<div style="grid-area: rl">RS&lt;</div>
<div style="grid-area: lr">LS&gt;</div>
<div style="grid-area: ll">LS&lt;</div>
</div>
<div class="extra">
<div>[start]</div>
<div>[back]</div>
<div>[guide]</div>
</div>
</div>
</body>
</html>

BIN
res/layouts/layout.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

BIN
res/screenshots/demo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

@ -57,7 +57,7 @@ const VOLTEX_KB_MAP: [usize; 41] = [
0x4f, 0x4f, 0x4f, 0x4f, // O
0x50, 0x50, 0x50, 0x50, // P
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Disabled
0x31, 0x1b, 0x0d, // 1, VK_ESCAPE, VK_RETURN
0x31, 0x0d, 0x1b, // 1, VK_RETURN, VK_ESCAPE
];
#[rustfmt::skip]
@ -75,7 +75,7 @@ const VOLTEX_KB_MAP_NEARDAYO: [usize; 41] = [
0x4f, 0x4f, 0x4f, 0x4f, // O
0x50, 0x50, 0x50, 0x50, // P
0x57, 0x45, 0x45, 0x4f, 0x4f, 0x50, // Disabled
0x31, 0x1b, 0x0d, // 1, VK_ESCAPE, VK_RETURN
0x31, 0x0d, 0x1b, // 1, VK_RETURN, VK_ESCAPE
];
pub struct KeyboardOutput {