mirror of
https://github.com/4yn/slidershim.git
synced 2024-11-12 00:40:49 +01:00
add umiguri keyboard layout
This commit is contained in:
parent
7e387ea541
commit
3e36cc551f
@ -13,6 +13,7 @@ pub enum PollingRate {
|
||||
pub enum KeyboardLayout {
|
||||
Tasoller,
|
||||
Yuancon,
|
||||
Umiguri,
|
||||
TasollerHalf,
|
||||
EightK,
|
||||
SixK,
|
||||
@ -94,6 +95,11 @@ impl OutputMode {
|
||||
polling: PollingRate::from_str(v["outputPolling"].as_str()?)?,
|
||||
sensitivity: u8::try_from(v["keyboardSensitivity"].as_i64()?).ok()?,
|
||||
},
|
||||
"kb-32-umiguri" => OutputMode::Keyboard {
|
||||
layout: KeyboardLayout::Umiguri,
|
||||
polling: PollingRate::from_str(v["outputPolling"].as_str()?)?,
|
||||
sensitivity: u8::try_from(v["keyboardSensitivity"].as_i64()?).ok()?,
|
||||
},
|
||||
"kb-16" => OutputMode::Keyboard {
|
||||
layout: KeyboardLayout::TasollerHalf,
|
||||
polling: PollingRate::from_str(v["outputPolling"].as_str()?)?,
|
||||
|
@ -31,6 +31,17 @@ const YUANCON_KB_MAP: [usize; 41] = [
|
||||
0x0d, 0x20, 0x1b, // VK_RETURN, VK_SPACE, VK_ESCAPE
|
||||
];
|
||||
|
||||
#[rustfmt::skip]
|
||||
const UMIGURI_KB_MAP: [usize; 41] = [
|
||||
0x41 /* A */, 0x31 /* 1 */, 0x5a /* Z */, 0x51 /* Q */, 0x53 /* S */, 0x32 /* 2 */, 0x58 /* X */, 0x57 /* W */,
|
||||
0x44 /* D */, 0x33 /* 3 */, 0x43 /* C */, 0x45 /* E */, 0x46 /* F */, 0x34 /* 4 */, 0x56 /* V */, 0x52 /* R */,
|
||||
0x47 /* G */, 0x35 /* 5 */, 0x42 /* B */, 0x54 /* T */, 0x48 /* H */, 0x36 /* 6 */, 0x4e /* N */, 0x59 /* Y */,
|
||||
0x4a /* J */, 0x37 /* 7 */, 0x4d /* M */, 0x55 /* U */, 0x4b /* K */, 0x38 /* 8 */, 0xbc /* VK_OEM_COMMA */, 0x49 /* I */,
|
||||
0x30, 0x4f, 0x4c, // 0, O, L
|
||||
0x50, 0xbc, 0xbe, // P, VK_OEM_COMMA, VK_OEM_PERIOD,
|
||||
0x0d, 0x20, 0x1b // VK_RETURN, VK_SPACE, VK_ESCAPE
|
||||
];
|
||||
|
||||
#[rustfmt::skip]
|
||||
const TASOLLER_HALF_KB_MAP: [usize; 41] = [
|
||||
0x41, 0x41 /* A */, 0x5a, 0x5a /* Z */, 0x53, 0x53 /* S */, 0x58, 0x58 /* X */,
|
||||
@ -130,6 +141,7 @@ impl KeyboardOutput {
|
||||
let kb_map = match layout {
|
||||
KeyboardLayout::Tasoller => &TASOLLER_KB_MAP,
|
||||
KeyboardLayout::Yuancon => &YUANCON_KB_MAP,
|
||||
KeyboardLayout::Umiguri => &UMIGURI_KB_MAP,
|
||||
KeyboardLayout::TasollerHalf => &TASOLLER_HALF_KB_MAP,
|
||||
KeyboardLayout::EightK => &EIGHT_K_MAP,
|
||||
KeyboardLayout::SixK => &SIX_K_MAP,
|
||||
|
@ -296,6 +296,8 @@
|
||||
>
|
||||
<option value="kb-32-yuancon">Keyboard 32-zone, Yuancon Layout</option
|
||||
>
|
||||
<option value="kb-32-umiguri">Keyboard 32-zone, UMIGURI Layout</option
|
||||
>
|
||||
<option value="kb-16">Keyboard 16-zone, Linear</option>
|
||||
<option value="kb-8">Keyboard 8-zone, Linear</option>
|
||||
<option value="kb-6">Keyboard 6-zone, Linear</option>
|
||||
|
Loading…
Reference in New Issue
Block a user