mirror of https://github.com/4yn/slidershim
Compare commits
No commits in common. "main" and "v0.5.0" have entirely different histories.
src
|
@ -12,10 +12,6 @@ Software adapter for various Chunithm slider controllers with a built-in Brokeni
|
||||||
|
|
||||||
## Changelog
|
## Changelog
|
||||||
|
|
||||||
- v0.6.0
|
|
||||||
- Support Laverita v3. Thanks @sr1canskhsia
|
|
||||||
- v0.5.1
|
|
||||||
- Support SSL/wss if brokenithm used with tunnelling. Thanks @kokarare1212
|
|
||||||
- v0.5.0
|
- v0.5.0
|
||||||
- Support for Yubideck 3.0 firmware
|
- Support for Yubideck 3.0 firmware
|
||||||
- v0.4.3
|
- v0.4.3
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -223,7 +223,7 @@ var ws = null;
|
||||||
var wsTimeout = 0;
|
var wsTimeout = 0;
|
||||||
var wsConnected = false;
|
var wsConnected = false;
|
||||||
const wsConnect = () => {
|
const wsConnect = () => {
|
||||||
ws = new WebSocket((location.protocol == "https:" ? "wss://" : "ws://") + location.host + "/ws");
|
ws = new WebSocket("ws://" + location.host + "/ws");
|
||||||
ws.binaryType = "arraybuffer";
|
ws.binaryType = "arraybuffer";
|
||||||
ws.onopen = () => {
|
ws.onopen = () => {
|
||||||
ws.send("alive?");
|
ws.send("alive?");
|
||||||
|
|
|
@ -5,7 +5,6 @@ pub enum HardwareSpec {
|
||||||
TasollerOne,
|
TasollerOne,
|
||||||
TasollerTwo,
|
TasollerTwo,
|
||||||
Yuancon,
|
Yuancon,
|
||||||
YuanconThree,
|
|
||||||
Yubideck,
|
Yubideck,
|
||||||
YubideckThree,
|
YubideckThree,
|
||||||
}
|
}
|
||||||
|
@ -51,10 +50,6 @@ impl DeviceMode {
|
||||||
spec: HardwareSpec::Yuancon,
|
spec: HardwareSpec::Yuancon,
|
||||||
disable_air: v["disableAirStrings"].as_bool()?,
|
disable_air: v["disableAirStrings"].as_bool()?,
|
||||||
},
|
},
|
||||||
"yuancon-three" => DeviceMode::Hardware {
|
|
||||||
spec: HardwareSpec::YuanconThree,
|
|
||||||
disable_air: v["disableAirStrings"].as_bool()?,
|
|
||||||
},
|
|
||||||
"yubideck" => DeviceMode::Hardware {
|
"yubideck" => DeviceMode::Hardware {
|
||||||
spec: HardwareSpec::Yubideck,
|
spec: HardwareSpec::Yubideck,
|
||||||
disable_air: v["disableAirStrings"].as_bool()?,
|
disable_air: v["disableAirStrings"].as_bool()?,
|
||||||
|
|
|
@ -205,53 +205,6 @@ impl HidJob {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
HardwareSpec::YuanconThree => Self::new(
|
|
||||||
state.clone(),
|
|
||||||
0x0518,
|
|
||||||
0x2022,
|
|
||||||
0x83,
|
|
||||||
0x03,
|
|
||||||
*disable_air,
|
|
||||||
|buf, input| {
|
|
||||||
if buf.len != 46 { // real length is 46 but last 12 bytes are unused
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
input.ground.copy_from_slice(&buf.data[2..34]);
|
|
||||||
input.flip_vert();
|
|
||||||
|
|
||||||
let bits: Vec<u8> = (0..8).map(|x| (buf.data[0] >> x) & 1).collect();
|
|
||||||
for i in 0..6 {
|
|
||||||
input.air[i ^ 1] = bits[i];
|
|
||||||
}
|
|
||||||
input.extra[0..2].copy_from_slice(&bits[6..8]);
|
|
||||||
},
|
|
||||||
WriteType::Interrupt,
|
|
||||||
|buf, buf_two, lights| {
|
|
||||||
buf.len = 61;
|
|
||||||
buf.data[0] = 0;
|
|
||||||
buf_two.len = 61;
|
|
||||||
buf_two.data[0] = 1;
|
|
||||||
|
|
||||||
for (buf_chunk, state_chunk) in buf.data[1..61]
|
|
||||||
.chunks_mut(3)
|
|
||||||
.zip(lights.ground.chunks(3).skip(11).take(20).rev())
|
|
||||||
{
|
|
||||||
buf_chunk[0] = state_chunk[0];
|
|
||||||
buf_chunk[1] = state_chunk[1];
|
|
||||||
buf_chunk[2] = state_chunk[2];
|
|
||||||
}
|
|
||||||
|
|
||||||
for (buf_chunk, state_chunk) in buf_two.data[1..34]
|
|
||||||
.chunks_mut(3)
|
|
||||||
.zip(lights.ground.chunks(3).take(11).rev())
|
|
||||||
{
|
|
||||||
buf_chunk[0] = state_chunk[0];
|
|
||||||
buf_chunk[1] = state_chunk[1];
|
|
||||||
buf_chunk[2] = state_chunk[2];
|
|
||||||
}
|
|
||||||
},
|
|
||||||
),
|
|
||||||
HardwareSpec::Yubideck => Self::new(
|
HardwareSpec::Yubideck => Self::new(
|
||||||
state.clone(),
|
state.clone(),
|
||||||
0x1973,
|
0x1973,
|
||||||
|
@ -370,15 +323,8 @@ impl HidJob {
|
||||||
}
|
}
|
||||||
info!("Device setting configuration");
|
info!("Device setting configuration");
|
||||||
handle.set_active_configuration(1)?;
|
handle.set_active_configuration(1)?;
|
||||||
|
|
||||||
// A bit janky but Laverita v3 seems to require interface 3
|
|
||||||
info!("Device claiming interface");
|
info!("Device claiming interface");
|
||||||
if self.vid == 0x0518 && self.pid == 0x2022 {
|
|
||||||
handle.claim_interface(3)?;
|
|
||||||
} else {
|
|
||||||
handle.claim_interface(0)?;
|
handle.claim_interface(0)?;
|
||||||
}
|
|
||||||
|
|
||||||
self.handle = Some(handle);
|
self.handle = Some(handle);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# This file is automatically @generated by Cargo.
|
# This file is automatically @generated by Cargo.
|
||||||
# It is not intended for manual editing.
|
# It is not intended for manual editing.
|
||||||
version = 4
|
version = 3
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "CoreFoundation-sys"
|
name = "CoreFoundation-sys"
|
||||||
|
@ -2462,9 +2462,9 @@ checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "proc-macro2"
|
name = "proc-macro2"
|
||||||
version = "1.0.67"
|
version = "1.0.40"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328"
|
checksum = "dd96a1e8ed2596c337f8eae5f24924ec83f5ad5ab21ea8e455d3566c69fbcaf7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"unicode-ident",
|
"unicode-ident",
|
||||||
]
|
]
|
||||||
|
@ -2996,7 +2996,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "slidershim"
|
name = "slidershim"
|
||||||
version = "0.6.0"
|
version = "0.5.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"env_logger",
|
"env_logger",
|
||||||
"log",
|
"log",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "slidershim"
|
name = "slidershim"
|
||||||
version = "0.6.0"
|
version = "0.5.0"
|
||||||
description = "slidershim"
|
description = "slidershim"
|
||||||
authors = ["4yn"]
|
authors = ["4yn"]
|
||||||
license = ""
|
license = ""
|
||||||
|
|
|
@ -2,17 +2,13 @@
|
||||||
___| (_) __| | ___ _ __ ___| |__ (_)_ __ ___
|
___| (_) __| | ___ _ __ ___| |__ (_)_ __ ___
|
||||||
/ __| | |/ _` |/ _ \ '__/ __| '_ \| | '_ ` _ \
|
/ __| | |/ _` |/ _ \ '__/ __| '_ \| | '_ ` _ \
|
||||||
\__ \ | | (_| | __/ | \__ \ | | | | | | | | |
|
\__ \ | | (_| | __/ | \__ \ | | | | | | | | |
|
||||||
|___/_|_|\__,_|\___|_| |___/_| |_|_|_| |_| |_| v0.6.1
|
|___/_|_|\__,_|\___|_| |___/_| |_|_|_| |_| |_| v0.5.0
|
||||||
===============================================
|
===============================================
|
||||||
|
|
||||||
https://github.com/4yn/slidershim
|
https://github.com/4yn/slidershim
|
||||||
|
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
- v0.6.0
|
|
||||||
- Support Laverita v3. Thanks @sr1canskhsia
|
|
||||||
- v0.5.1
|
|
||||||
- Support SSL/wss if brokenithm used with tunnelling. Thanks @kokarare1212
|
|
||||||
- v0.5.0
|
- v0.5.0
|
||||||
- Support for Yubideck 3.0 firmware
|
- Support for Yubideck 3.0 firmware
|
||||||
- v0.4.3
|
- v0.4.3
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"package": {
|
"package": {
|
||||||
"productName": "slidershim",
|
"productName": "slidershim",
|
||||||
"version": "0.6.0"
|
"version": "0.5.0"
|
||||||
},
|
},
|
||||||
"build": {
|
"build": {
|
||||||
"distDir": "../public",
|
"distDir": "../public",
|
||||||
|
|
|
@ -196,7 +196,6 @@
|
||||||
<option value="tasoller-one">GAMO2 Tasoller, 1.0 HID Firmware</option>
|
<option value="tasoller-one">GAMO2 Tasoller, 1.0 HID Firmware</option>
|
||||||
<option value="tasoller-two">GAMO2 Tasoller, 2.0 HID Firmware</option>
|
<option value="tasoller-two">GAMO2 Tasoller, 2.0 HID Firmware</option>
|
||||||
<option value="yuancon">Yuancon Laverita, HID Firmware</option>
|
<option value="yuancon">Yuancon Laverita, HID Firmware</option>
|
||||||
<option value="yuancon-three">Yuancon Laverita v3, HID Firmware</option>
|
|
||||||
<option value="yubideck">大四 / Yubideck, HID Firmware 1.0</option>
|
<option value="yubideck">大四 / Yubideck, HID Firmware 1.0</option>
|
||||||
<option value="yubideck-three">大四 / Yubideck, HID Firmware 3.0</option>
|
<option value="yubideck-three">大四 / Yubideck, HID Firmware 3.0</option>
|
||||||
<option value="diva">Slider over Serial</option>
|
<option value="diva">Slider over Serial</option>
|
||||||
|
|
Loading…
Reference in New Issue