Skip to content

Commit

Permalink
feat: add sweep as keyboard option (#11)
Browse files Browse the repository at this point in the history
* feat: add sweep as keyboard option

* Format

---------

Co-authored-by: Mark Skelton <[email protected]>
  • Loading branch information
joebonneau and mskelton authored Jun 16, 2024
1 parent 0aea6ff commit f3261cd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/layouts/mod.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
use serde::{Deserialize, Serialize};

mod adv360;
mod sweep;

#[derive(Serialize, Deserialize)]
pub enum KeyboardLayoutType {
#[serde(rename = "kinesis:adv360")]
Adv360,
#[serde(rename = "sweep")]
Sweep,
}

pub struct KeyboardLayout {
Expand All @@ -22,5 +25,6 @@ impl KeyboardLayout {
pub fn get_layout(layout_type: &KeyboardLayoutType) -> KeyboardLayout {
match layout_type {
KeyboardLayoutType::Adv360 => adv360::get_layout(),
KeyboardLayoutType::Sweep => sweep::get_layout(),
}
}
13 changes: 13 additions & 0 deletions src/layouts/sweep.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
use super::KeyboardLayout;

pub fn get_layout() -> KeyboardLayout {
#[rustfmt::skip]
let bindings = vec![
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
0, 0, 0, 1, 1, 1, 1, 0, 0, 0,
];

return KeyboardLayout { bindings, row_count: 4 };
}

0 comments on commit f3261cd

Please sign in to comment.