mirror of
https://github.com/CharaChorder/DeviceManager.git
synced 2026-01-09 19:42:48 +00:00
Compare commits
3 Commits
72a8e084ce
...
6201cf5b0c
| Author | SHA1 | Date | |
|---|---|---|---|
|
6201cf5b0c
|
|||
|
aaafadf732
|
|||
|
fe80867ce4
|
@@ -106,24 +106,21 @@ actions:
|
|||||||
variant: right
|
variant: right
|
||||||
558:
|
558:
|
||||||
id: HOLD_COMPOUND
|
id: HOLD_COMPOUND
|
||||||
title: Activate Chord Library
|
title: Dynamic Library
|
||||||
icon: layers
|
icon: layers
|
||||||
description: |
|
description: |
|
||||||
When used in a chord includes that chord as a base
|
Allows for the activation & creation of dynamic chord libraries.
|
||||||
compound chord for all subsequent chords.
|
When included as part of a chord output,
|
||||||
This is effectively a library switch.
|
that chord's input becomes the seed for a dynamic chord library,
|
||||||
Since library activations can be nested, you
|
and that library is activated.
|
||||||
usually add a "Reset Chord Library" before this action.
|
Any new chords created while a dynamic library is active are established one level above its seed.
|
||||||
559:
|
559:
|
||||||
id: RELEASE_COMPOUND
|
id: RELEASE_COMPOUND
|
||||||
title: Reset Chord Library
|
title: Base Library
|
||||||
icon: layers_clear
|
icon: layers_clear
|
||||||
description: |
|
description: |
|
||||||
Releases the active compound state, returning
|
Re-activates your base chord library,
|
||||||
to the default library.
|
and deactivates any currently active dynamic chord library.
|
||||||
While "Activate Chord Library" can only be used
|
|
||||||
as an output of a chord, this action can be assigned
|
|
||||||
to switches directly.
|
|
||||||
576:
|
576:
|
||||||
id: ACTION_DELAY_1000
|
id: ACTION_DELAY_1000
|
||||||
icon: clock_loader_90
|
icon: clock_loader_90
|
||||||
|
|||||||
37
src/lib/assets/layouts/m4g.yml
Normal file
37
src/lib/assets/layouts/m4g.yml
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
name: M4G
|
||||||
|
col:
|
||||||
|
# Ring / Middle
|
||||||
|
- offset: [2, 0]
|
||||||
|
row:
|
||||||
|
- switch: { d: 25, e: 26, n: 27, w: 28, s: 29 }
|
||||||
|
- switch: { d: 20, e: 21, n: 22, w: 23, s: 24 }
|
||||||
|
- offset: [4, 0]
|
||||||
|
switch: { d: 65, w: 66, n: 67, e: 68, s: 69 }
|
||||||
|
- switch: { d: 70, w: 71, n: 72, e: 73, s: 74 }
|
||||||
|
- offset: [2, 0]
|
||||||
|
row:
|
||||||
|
- switch: { d: 40, e: 41, n: 42, w: 43, s: 44 }
|
||||||
|
- switch: { d: 35, e: 36, n: 37, w: 38, s: 39 }
|
||||||
|
- offset: [4, 0]
|
||||||
|
switch: { d: 80, w: 81, n: 82, e: 83, s: 84 }
|
||||||
|
- switch: { d: 85, w: 86, n: 87, e: 88, s: 89 }
|
||||||
|
# Pinkie / Index
|
||||||
|
- offset: [0, -3]
|
||||||
|
row:
|
||||||
|
- switch: { d: 30, e: 31, n: 32, w: 33, s: 34 }
|
||||||
|
- offset: [4, 0]
|
||||||
|
switch: { d: 15, e: 16, n: 17, w: 18, s: 19 }
|
||||||
|
- switch: { d: 60, w: 61, n: 62, e: 63, s: 64 }
|
||||||
|
- offset: [4, 0]
|
||||||
|
switch: { d: 75, w: 76, n: 77, e: 78, s: 79 }
|
||||||
|
# Thumbs
|
||||||
|
- row:
|
||||||
|
- offset: [5.5, 0.5]
|
||||||
|
switch: { d: 10, e: 11, n: 12, w: 13, s: 14 }
|
||||||
|
- offset: [1, 0.5]
|
||||||
|
switch: { d: 55, w: 56, n: 57, e: 58, s: 59 }
|
||||||
|
- row:
|
||||||
|
- offset: [4.5, -0.25]
|
||||||
|
switch: { d: 5, e: 6, n: 7, w: 8, s: 9 }
|
||||||
|
- offset: [3, -0.25]
|
||||||
|
switch: { d: 50, w: 51, n: 52, e: 53, s: 54 }
|
||||||
@@ -33,6 +33,10 @@
|
|||||||
import("$lib/assets/layouts/generic/103-key.yml").then(
|
import("$lib/assets/layouts/generic/103-key.yml").then(
|
||||||
(it) => it.default as VisualLayout,
|
(it) => it.default as VisualLayout,
|
||||||
),
|
),
|
||||||
|
M4G: () =>
|
||||||
|
import("$lib/assets/layouts/m4g.yml").then(
|
||||||
|
(it) => it.default as VisualLayout,
|
||||||
|
),
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ const PORT_FILTERS: Map<string, SerialPortFilter> = new Map([
|
|||||||
["LITE S2", { usbProductId: 33070, usbVendorId: 12346 }],
|
["LITE S2", { usbProductId: 33070, usbVendorId: 12346 }],
|
||||||
["LITE M0", { usbProductId: 32796, usbVendorId: 9114 }],
|
["LITE M0", { usbProductId: 32796, usbVendorId: 9114 }],
|
||||||
["X", { usbProductId: 33163, usbVendorId: 12346 }],
|
["X", { usbProductId: 33163, usbVendorId: 12346 }],
|
||||||
|
["M4G S3", { usbProductId: 4097, usbVendorId: 12346 }],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const KEY_COUNTS = {
|
const KEY_COUNTS = {
|
||||||
@@ -23,6 +24,7 @@ const KEY_COUNTS = {
|
|||||||
TWO: 90,
|
TWO: 90,
|
||||||
LITE: 67,
|
LITE: 67,
|
||||||
X: 256,
|
X: 256,
|
||||||
|
M4G: 90,
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
@@ -88,8 +90,8 @@ export class CharaDevice {
|
|||||||
private suspendDebounceId?: number;
|
private suspendDebounceId?: number;
|
||||||
|
|
||||||
version!: SemVer;
|
version!: SemVer;
|
||||||
company!: "CHARACHORDER";
|
company!: "CHARACHORDER" | "FORGE";
|
||||||
device!: "ONE" | "TWO" | "LITE" | "X";
|
device!: "ONE" | "TWO" | "LITE" | "X" | "M4G";
|
||||||
chipset!: "M0" | "S2" | "S3";
|
chipset!: "M0" | "S2" | "S3";
|
||||||
keyCount!: 90 | 67 | 256;
|
keyCount!: 90 | 67 | 256;
|
||||||
|
|
||||||
@@ -126,9 +128,9 @@ export class CharaDevice {
|
|||||||
await this.send(1, "VERSION").then(([version]) => version),
|
await this.send(1, "VERSION").then(([version]) => version),
|
||||||
);
|
);
|
||||||
const [company, device, chipset] = await this.send(3, "ID");
|
const [company, device, chipset] = await this.send(3, "ID");
|
||||||
this.company = company as "CHARACHORDER";
|
this.company = company as typeof this.company;
|
||||||
this.device = device as "ONE" | "TWO" | "LITE" | "X";
|
this.device = device as typeof this.device;
|
||||||
this.chipset = chipset as "M0" | "S2" | "S3";
|
this.chipset = chipset as typeof this.chipset;
|
||||||
this.keyCount = KEY_COUNTS[this.device];
|
this.keyCount = KEY_COUNTS[this.device];
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
alert(e);
|
alert(e);
|
||||||
|
|||||||
Reference in New Issue
Block a user