mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
rog-aura: adjustment of layouts and key sizes
This commit is contained in:
@@ -5,6 +5,7 @@ matches = [
|
|||||||
locale = "US"
|
locale = "US"
|
||||||
|
|
||||||
[[rows]]
|
[[rows]]
|
||||||
|
height = 0.8
|
||||||
row = [
|
row = [
|
||||||
'NormalSpacer',
|
'NormalSpacer',
|
||||||
'FuncSpacer',
|
'FuncSpacer',
|
||||||
@@ -16,6 +17,7 @@ row = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[rows]]
|
[[rows]]
|
||||||
|
height = 0.8
|
||||||
row = [
|
row = [
|
||||||
'Esc',
|
'Esc',
|
||||||
'FuncSpacer',
|
'FuncSpacer',
|
||||||
@@ -38,6 +40,7 @@ row = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[rows]]
|
[[rows]]
|
||||||
|
height = 1.0
|
||||||
row = [
|
row = [
|
||||||
'Tilde',
|
'Tilde',
|
||||||
'N1',
|
'N1',
|
||||||
@@ -58,6 +61,7 @@ row = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[rows]]
|
[[rows]]
|
||||||
|
height = 1.0
|
||||||
row = [
|
row = [
|
||||||
'Tab',
|
'Tab',
|
||||||
'Q',
|
'Q',
|
||||||
@@ -78,6 +82,7 @@ row = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[rows]]
|
[[rows]]
|
||||||
|
height = 1.0
|
||||||
row = [
|
row = [
|
||||||
'Caps',
|
'Caps',
|
||||||
'A',
|
'A',
|
||||||
@@ -97,6 +102,7 @@ row = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[rows]]
|
[[rows]]
|
||||||
|
height = 1.0
|
||||||
row = [
|
row = [
|
||||||
'LShift',
|
'LShift',
|
||||||
'Z',
|
'Z',
|
||||||
@@ -115,6 +121,7 @@ row = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[rows]]
|
[[rows]]
|
||||||
|
height = 1.2
|
||||||
row = [
|
row = [
|
||||||
'LCtrl',
|
'LCtrl',
|
||||||
'LFn',
|
'LFn',
|
||||||
@@ -132,6 +139,7 @@ row = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[rows]]
|
[[rows]]
|
||||||
|
height = 0.8
|
||||||
row = [
|
row = [
|
||||||
'ArrowSpacer',
|
'ArrowSpacer',
|
||||||
'ArrowSpacer',
|
'ArrowSpacer',
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
matches = [
|
matches = [
|
||||||
'G533',
|
'G533',
|
||||||
'GU502',
|
|
||||||
]
|
]
|
||||||
|
|
||||||
locale = "US"
|
locale = "US"
|
||||||
|
|
||||||
[[rows]]
|
[[rows]]
|
||||||
|
height = 0.8
|
||||||
row = [
|
row = [
|
||||||
'NormalSpacer',
|
'NormalSpacer',
|
||||||
'FuncSpacer',
|
'FuncSpacer',
|
||||||
@@ -17,6 +17,7 @@ row = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[rows]]
|
[[rows]]
|
||||||
|
height = 0.8
|
||||||
row = [
|
row = [
|
||||||
'Esc',
|
'Esc',
|
||||||
'FuncSpacer',
|
'FuncSpacer',
|
||||||
@@ -38,6 +39,7 @@ row = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[rows]]
|
[[rows]]
|
||||||
|
height = 1.0
|
||||||
row = [
|
row = [
|
||||||
'Tilde',
|
'Tilde',
|
||||||
'N1',
|
'N1',
|
||||||
@@ -57,6 +59,7 @@ row = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[rows]]
|
[[rows]]
|
||||||
|
height = 1.0
|
||||||
row = [
|
row = [
|
||||||
'Tab',
|
'Tab',
|
||||||
'Q',
|
'Q',
|
||||||
@@ -76,6 +79,7 @@ row = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[rows]]
|
[[rows]]
|
||||||
|
height = 1.0
|
||||||
row = [
|
row = [
|
||||||
'Caps',
|
'Caps',
|
||||||
'A',
|
'A',
|
||||||
@@ -94,6 +98,7 @@ row = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[rows]]
|
[[rows]]
|
||||||
|
height = 1.0
|
||||||
row = [
|
row = [
|
||||||
'LShift',
|
'LShift',
|
||||||
'Z',
|
'Z',
|
||||||
@@ -112,6 +117,7 @@ row = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[rows]]
|
[[rows]]
|
||||||
|
height = 1.0
|
||||||
row = [
|
row = [
|
||||||
'LCtrlMed',
|
'LCtrlMed',
|
||||||
'LFn',
|
'LFn',
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ matches = [
|
|||||||
locale = "US"
|
locale = "US"
|
||||||
|
|
||||||
[[rows]]
|
[[rows]]
|
||||||
|
height = 0.8
|
||||||
row = [
|
row = [
|
||||||
'NormalSpacer',
|
'NormalSpacer',
|
||||||
'FuncSpacer',
|
'FuncSpacer',
|
||||||
@@ -20,6 +21,7 @@ row = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[rows]]
|
[[rows]]
|
||||||
|
height = 0.8
|
||||||
row = [
|
row = [
|
||||||
'Esc',
|
'Esc',
|
||||||
'FuncSpacer',
|
'FuncSpacer',
|
||||||
@@ -40,6 +42,7 @@ row = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[rows]]
|
[[rows]]
|
||||||
|
height = 1.0
|
||||||
row = [
|
row = [
|
||||||
'Tilde',
|
'Tilde',
|
||||||
'N1',
|
'N1',
|
||||||
@@ -58,6 +61,7 @@ row = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[rows]]
|
[[rows]]
|
||||||
|
height = 1.0
|
||||||
row = [
|
row = [
|
||||||
'Tab',
|
'Tab',
|
||||||
'Q',
|
'Q',
|
||||||
@@ -76,6 +80,7 @@ row = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[rows]]
|
[[rows]]
|
||||||
|
height = 1.0
|
||||||
row = [
|
row = [
|
||||||
'Caps',
|
'Caps',
|
||||||
'A',
|
'A',
|
||||||
@@ -93,6 +98,7 @@ row = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[rows]]
|
[[rows]]
|
||||||
|
height = 1.0
|
||||||
row = [
|
row = [
|
||||||
'LShift',
|
'LShift',
|
||||||
'Z',
|
'Z',
|
||||||
@@ -109,6 +115,7 @@ row = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[rows]]
|
[[rows]]
|
||||||
|
height = 1.2
|
||||||
row = [
|
row = [
|
||||||
'LCtrl',
|
'LCtrl',
|
||||||
'LFn',
|
'LFn',
|
||||||
@@ -124,6 +131,7 @@ row = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[rows]]
|
[[rows]]
|
||||||
|
height = 0.8
|
||||||
row = [
|
row = [
|
||||||
'FuncSpacer',
|
'FuncSpacer',
|
||||||
'FuncSpacer',
|
'FuncSpacer',
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ matches = [
|
|||||||
locale = "US"
|
locale = "US"
|
||||||
|
|
||||||
[[rows]]
|
[[rows]]
|
||||||
|
height = 0.8
|
||||||
row = [
|
row = [
|
||||||
'NormalSpacer',
|
'NormalSpacer',
|
||||||
'FuncSpacer',
|
'FuncSpacer',
|
||||||
@@ -15,6 +16,7 @@ row = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[rows]]
|
[[rows]]
|
||||||
|
height = 0.8
|
||||||
row = [
|
row = [
|
||||||
'Esc',
|
'Esc',
|
||||||
'FuncSpacer',
|
'FuncSpacer',
|
||||||
@@ -39,6 +41,7 @@ row = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[rows]]
|
[[rows]]
|
||||||
|
height = 1.0
|
||||||
row = [
|
row = [
|
||||||
'Tilde',
|
'Tilde',
|
||||||
'N1',
|
'N1',
|
||||||
@@ -61,6 +64,7 @@ row = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[rows]]
|
[[rows]]
|
||||||
|
height = 1.0
|
||||||
row = [
|
row = [
|
||||||
'Tab',
|
'Tab',
|
||||||
'Q',
|
'Q',
|
||||||
@@ -83,6 +87,7 @@ row = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[rows]]
|
[[rows]]
|
||||||
|
height = 1.0
|
||||||
row = [
|
row = [
|
||||||
'Caps',
|
'Caps',
|
||||||
'A',
|
'A',
|
||||||
@@ -104,6 +109,7 @@ row = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[rows]]
|
[[rows]]
|
||||||
|
height = 1.0
|
||||||
row = [
|
row = [
|
||||||
'LShift',
|
'LShift',
|
||||||
'Z',
|
'Z',
|
||||||
@@ -124,8 +130,9 @@ row = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[rows]]
|
[[rows]]
|
||||||
|
height = 1.0
|
||||||
row = [
|
row = [
|
||||||
'LCtrlMed',
|
'LCtrl',
|
||||||
'LFn',
|
'LFn',
|
||||||
'Meta',
|
'Meta',
|
||||||
'LAlt',
|
'LAlt',
|
||||||
@@ -141,6 +148,7 @@ row = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[rows]]
|
[[rows]]
|
||||||
|
height = 1.0
|
||||||
row = [
|
row = [
|
||||||
'FuncSpacer',
|
'FuncSpacer',
|
||||||
'FuncSpacer',
|
'FuncSpacer',
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ matches = [
|
|||||||
locale = "US"
|
locale = "US"
|
||||||
|
|
||||||
[[rows]]
|
[[rows]]
|
||||||
|
height = 0.8
|
||||||
row = [
|
row = [
|
||||||
'NormalSpacer',
|
'NormalSpacer',
|
||||||
'FuncSpacer',
|
'FuncSpacer',
|
||||||
@@ -16,6 +17,7 @@ row = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[rows]]
|
[[rows]]
|
||||||
|
height = 0.8
|
||||||
row = [
|
row = [
|
||||||
'Esc',
|
'Esc',
|
||||||
'FuncSpacer',
|
'FuncSpacer',
|
||||||
@@ -38,6 +40,7 @@ row = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[rows]]
|
[[rows]]
|
||||||
|
height = 1.0
|
||||||
row = [
|
row = [
|
||||||
'Tilde',
|
'Tilde',
|
||||||
'N1',
|
'N1',
|
||||||
@@ -60,6 +63,7 @@ row = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[rows]]
|
[[rows]]
|
||||||
|
height = 1.0
|
||||||
row = [
|
row = [
|
||||||
'Tab',
|
'Tab',
|
||||||
'Q',
|
'Q',
|
||||||
@@ -80,6 +84,7 @@ row = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[rows]]
|
[[rows]]
|
||||||
|
height = 1.0
|
||||||
row = [
|
row = [
|
||||||
'Caps',
|
'Caps',
|
||||||
'A',
|
'A',
|
||||||
@@ -101,6 +106,7 @@ row = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[rows]]
|
[[rows]]
|
||||||
|
height = 1.0
|
||||||
row = [
|
row = [
|
||||||
'LShift',
|
'LShift',
|
||||||
'Z',
|
'Z',
|
||||||
@@ -121,6 +127,7 @@ row = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[rows]]
|
[[rows]]
|
||||||
|
height = 1.2
|
||||||
row = [
|
row = [
|
||||||
'LCtrl',
|
'LCtrl',
|
||||||
'LFn',
|
'LFn',
|
||||||
@@ -142,6 +149,7 @@ row = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[rows]]
|
[[rows]]
|
||||||
|
height = 0.8
|
||||||
row = [
|
row = [
|
||||||
'FuncSpacer',
|
'FuncSpacer',
|
||||||
'FuncSpacer',
|
'FuncSpacer',
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ pub enum KeyShape {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl KeyShape {
|
impl KeyShape {
|
||||||
pub const fn ux(&self) -> f32 {
|
pub const fn width(&self) -> f32 {
|
||||||
match self {
|
match self {
|
||||||
Self::Tilde => 0.8,
|
Self::Tilde => 0.8,
|
||||||
Self::Normal => 1.0,
|
Self::Normal => 1.0,
|
||||||
@@ -208,7 +208,7 @@ impl KeyShape {
|
|||||||
Self::LShift => 2.0,
|
Self::LShift => 2.0,
|
||||||
Self::LShift3 => 0.67,
|
Self::LShift3 => 0.67,
|
||||||
Self::RShift => 2.8,
|
Self::RShift => 2.8,
|
||||||
Self::RshiftSmall => 1.7,
|
Self::RshiftSmall => 1.8,
|
||||||
Self::RShift3 => 0.93,
|
Self::RShift3 => 0.93,
|
||||||
Self::Return => 2.2,
|
Self::Return => 2.2,
|
||||||
Self::Return3 => 0.7333,
|
Self::Return3 => 0.7333,
|
||||||
@@ -223,17 +223,6 @@ impl KeyShape {
|
|||||||
Self::RowEndSpacer => 0.1,
|
Self::RowEndSpacer => 0.1,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pub const fn uy(&self) -> f32 {
|
|
||||||
match self {
|
|
||||||
Self::Func => 0.8,
|
|
||||||
Self::RowEndSpacer => 0.1,
|
|
||||||
Self::FuncBlank => 0.8,
|
|
||||||
Self::FuncSpacer => 0.8,
|
|
||||||
Self::Arrow | Self::ArrowBlank | Self::ArrowSpacer => 0.6,
|
|
||||||
Self::ArrowSplit | Self::ArrowSplitBlank | Self::ArrowSplitSpacer => 5.0,
|
|
||||||
_ => 1.0,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// A blank is used to space keys out in GUI's and can be used or ignored
|
/// A blank is used to space keys out in GUI's and can be used or ignored
|
||||||
/// depednign on the per-key effect
|
/// depednign on the per-key effect
|
||||||
|
|||||||
@@ -8,138 +8,162 @@ impl KeyLayout {
|
|||||||
matches: vec!["G513".into()],
|
matches: vec!["G513".into()],
|
||||||
locale: "US".to_string(),
|
locale: "US".to_string(),
|
||||||
rows: vec![
|
rows: vec![
|
||||||
KeyRow::new(vec![
|
KeyRow::new(
|
||||||
Key::NormalSpacer,
|
0.8,
|
||||||
Key::FuncSpacer,
|
vec![
|
||||||
Key::VolDown,
|
Key::NormalSpacer,
|
||||||
Key::VolUp,
|
Key::FuncSpacer,
|
||||||
Key::MicMute,
|
Key::VolDown,
|
||||||
Key::Fan,
|
Key::VolUp,
|
||||||
Key::Rog,
|
Key::MicMute,
|
||||||
]),
|
Key::Fan,
|
||||||
KeyRow::new(vec![
|
Key::Rog,
|
||||||
Key::Esc,
|
],
|
||||||
Key::FuncSpacer,
|
),
|
||||||
Key::F1,
|
KeyRow::new(
|
||||||
Key::F2,
|
0.8,
|
||||||
Key::F3,
|
vec![
|
||||||
Key::F4,
|
Key::Esc,
|
||||||
Key::FuncSpacer, // not sure which key to put here
|
Key::FuncSpacer,
|
||||||
Key::F5,
|
Key::F1,
|
||||||
Key::F6,
|
Key::F2,
|
||||||
Key::F7,
|
Key::F3,
|
||||||
Key::F8,
|
Key::F4,
|
||||||
Key::FuncSpacer,
|
Key::FuncSpacer, // not sure which key to put here
|
||||||
Key::F9,
|
Key::F5,
|
||||||
Key::F10,
|
Key::F6,
|
||||||
Key::F11,
|
Key::F7,
|
||||||
Key::F12,
|
Key::F8,
|
||||||
Key::RowEndSpacer,
|
Key::FuncSpacer,
|
||||||
Key::Del,
|
Key::F9,
|
||||||
]),
|
Key::F10,
|
||||||
KeyRow::new(vec![
|
Key::F11,
|
||||||
Key::Tilde,
|
Key::F12,
|
||||||
Key::N1,
|
Key::RowEndSpacer,
|
||||||
Key::N2,
|
Key::Del,
|
||||||
Key::N3,
|
],
|
||||||
Key::N4,
|
),
|
||||||
Key::N5,
|
KeyRow::new(
|
||||||
Key::N6,
|
1.0,
|
||||||
Key::N7,
|
vec![
|
||||||
Key::N8,
|
Key::Tilde,
|
||||||
Key::N9,
|
Key::N1,
|
||||||
Key::N0,
|
Key::N2,
|
||||||
Key::Hyphen,
|
Key::N3,
|
||||||
Key::Equals,
|
Key::N4,
|
||||||
Key::BkSpc,
|
Key::N5,
|
||||||
Key::RowEndSpacer,
|
Key::N6,
|
||||||
Key::Home,
|
Key::N7,
|
||||||
]),
|
Key::N8,
|
||||||
KeyRow::new(vec![
|
Key::N9,
|
||||||
Key::Tab,
|
Key::N0,
|
||||||
Key::Q,
|
Key::Hyphen,
|
||||||
Key::W,
|
Key::Equals,
|
||||||
Key::E,
|
Key::BkSpc,
|
||||||
Key::R,
|
Key::RowEndSpacer,
|
||||||
Key::T,
|
Key::Home,
|
||||||
Key::Y,
|
],
|
||||||
Key::U,
|
),
|
||||||
Key::I,
|
KeyRow::new(
|
||||||
Key::O,
|
1.0,
|
||||||
Key::P,
|
vec![
|
||||||
Key::LBracket,
|
Key::Tab,
|
||||||
Key::RBracket,
|
Key::Q,
|
||||||
Key::BackSlash,
|
Key::W,
|
||||||
Key::RowEndSpacer,
|
Key::E,
|
||||||
Key::PgUp,
|
Key::R,
|
||||||
]),
|
Key::T,
|
||||||
KeyRow::new(vec![
|
Key::Y,
|
||||||
Key::Caps,
|
Key::U,
|
||||||
Key::A,
|
Key::I,
|
||||||
Key::S,
|
Key::O,
|
||||||
Key::D,
|
Key::P,
|
||||||
Key::F,
|
Key::LBracket,
|
||||||
Key::G,
|
Key::RBracket,
|
||||||
Key::H,
|
Key::BackSlash,
|
||||||
Key::J,
|
Key::RowEndSpacer,
|
||||||
Key::K,
|
Key::PgUp,
|
||||||
Key::L,
|
],
|
||||||
Key::SemiColon,
|
),
|
||||||
Key::Quote,
|
KeyRow::new(
|
||||||
Key::Return,
|
1.0,
|
||||||
Key::RowEndSpacer,
|
vec![
|
||||||
Key::PgDn,
|
Key::Caps,
|
||||||
]),
|
Key::A,
|
||||||
KeyRow::new(vec![
|
Key::S,
|
||||||
Key::LShift,
|
Key::D,
|
||||||
Key::Z,
|
Key::F,
|
||||||
Key::X,
|
Key::G,
|
||||||
Key::C,
|
Key::H,
|
||||||
Key::V,
|
Key::J,
|
||||||
Key::B,
|
Key::K,
|
||||||
Key::N,
|
Key::L,
|
||||||
Key::M,
|
Key::SemiColon,
|
||||||
Key::Comma,
|
Key::Quote,
|
||||||
Key::Period,
|
Key::Return,
|
||||||
Key::FwdSlash,
|
Key::RowEndSpacer,
|
||||||
Key::Rshift,
|
Key::PgDn,
|
||||||
Key::RowEndSpacer,
|
],
|
||||||
Key::End,
|
),
|
||||||
]),
|
KeyRow::new(
|
||||||
KeyRow::new(vec![
|
1.0,
|
||||||
Key::LCtrl,
|
vec![
|
||||||
Key::LFn,
|
Key::LShift,
|
||||||
Key::Meta,
|
Key::Z,
|
||||||
Key::LAlt,
|
Key::X,
|
||||||
Key::Space,
|
Key::C,
|
||||||
Key::RAlt,
|
Key::V,
|
||||||
Key::PrtSc,
|
Key::B,
|
||||||
Key::RCtrl,
|
Key::N,
|
||||||
Key::ArrowSpacer,
|
Key::M,
|
||||||
Key::Up,
|
Key::Comma,
|
||||||
Key::ArrowSpacer,
|
Key::Period,
|
||||||
Key::RowEndSpacer,
|
Key::FwdSlash,
|
||||||
Key::RFn,
|
Key::Rshift,
|
||||||
]),
|
Key::RowEndSpacer,
|
||||||
KeyRow::new(vec![
|
Key::End,
|
||||||
Key::ArrowSpacer,
|
],
|
||||||
Key::ArrowSpacer,
|
),
|
||||||
Key::ArrowSpacer,
|
KeyRow::new(
|
||||||
Key::ArrowSpacer,
|
1.0,
|
||||||
Key::ArrowSpacer,
|
vec![
|
||||||
Key::ArrowSpacer,
|
Key::LCtrl,
|
||||||
Key::ArrowSpacer,
|
Key::LFn,
|
||||||
Key::ArrowSpacer,
|
Key::Meta,
|
||||||
Key::ArrowSpacer,
|
Key::LAlt,
|
||||||
Key::ArrowSpacer,
|
Key::Space,
|
||||||
Key::ArrowSpacer,
|
Key::RAlt,
|
||||||
Key::ArrowSpacer,
|
Key::PrtSc,
|
||||||
Key::ArrowSpacer,
|
Key::RCtrl,
|
||||||
Key::Left,
|
Key::ArrowSpacer,
|
||||||
Key::Down,
|
Key::Up,
|
||||||
Key::Right,
|
Key::ArrowSpacer,
|
||||||
Key::ArrowSpacer,
|
Key::RowEndSpacer,
|
||||||
]),
|
Key::RFn,
|
||||||
|
],
|
||||||
|
),
|
||||||
|
KeyRow::new(
|
||||||
|
1.0,
|
||||||
|
vec![
|
||||||
|
Key::ArrowSpacer,
|
||||||
|
Key::ArrowSpacer,
|
||||||
|
Key::ArrowSpacer,
|
||||||
|
Key::ArrowSpacer,
|
||||||
|
Key::ArrowSpacer,
|
||||||
|
Key::ArrowSpacer,
|
||||||
|
Key::ArrowSpacer,
|
||||||
|
Key::ArrowSpacer,
|
||||||
|
Key::ArrowSpacer,
|
||||||
|
Key::ArrowSpacer,
|
||||||
|
Key::ArrowSpacer,
|
||||||
|
Key::ArrowSpacer,
|
||||||
|
Key::ArrowSpacer,
|
||||||
|
Key::Left,
|
||||||
|
Key::Down,
|
||||||
|
Key::Right,
|
||||||
|
Key::ArrowSpacer,
|
||||||
|
],
|
||||||
|
),
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,125 +7,149 @@ impl KeyLayout {
|
|||||||
matches: vec!["GA401".into(), "GA402".into()],
|
matches: vec!["GA401".into(), "GA402".into()],
|
||||||
locale: "US".to_string(),
|
locale: "US".to_string(),
|
||||||
rows: vec![
|
rows: vec![
|
||||||
KeyRow::new(vec![
|
KeyRow::new(
|
||||||
Key::NormalSpacer,
|
0.8,
|
||||||
Key::FuncSpacer,
|
vec![
|
||||||
Key::VolDown,
|
Key::NormalSpacer,
|
||||||
Key::VolUp,
|
Key::FuncSpacer,
|
||||||
Key::MicMute,
|
Key::VolDown,
|
||||||
Key::Rog,
|
Key::VolUp,
|
||||||
]),
|
Key::MicMute,
|
||||||
KeyRow::new(vec![
|
Key::Rog,
|
||||||
Key::Esc,
|
],
|
||||||
Key::FuncSpacer,
|
),
|
||||||
Key::F1,
|
KeyRow::new(
|
||||||
Key::F2,
|
0.8,
|
||||||
Key::F3,
|
vec![
|
||||||
Key::F4,
|
Key::Esc,
|
||||||
Key::FuncSpacer, // not sure which key to put here
|
Key::FuncSpacer,
|
||||||
Key::F5,
|
Key::F1,
|
||||||
Key::F6,
|
Key::F2,
|
||||||
Key::F7,
|
Key::F3,
|
||||||
Key::F8,
|
Key::F4,
|
||||||
Key::FuncSpacer,
|
Key::FuncSpacer, // not sure which key to put here
|
||||||
Key::F9,
|
Key::F5,
|
||||||
Key::F10,
|
Key::F6,
|
||||||
Key::F11,
|
Key::F7,
|
||||||
Key::F12,
|
Key::F8,
|
||||||
]),
|
Key::FuncSpacer,
|
||||||
KeyRow::new(vec![
|
Key::F9,
|
||||||
Key::Tilde,
|
Key::F10,
|
||||||
Key::N1,
|
Key::F11,
|
||||||
Key::N2,
|
Key::F12,
|
||||||
Key::N3,
|
],
|
||||||
Key::N4,
|
),
|
||||||
Key::N5,
|
KeyRow::new(
|
||||||
Key::N6,
|
1.0,
|
||||||
Key::N7,
|
vec![
|
||||||
Key::N8,
|
Key::Tilde,
|
||||||
Key::N9,
|
Key::N1,
|
||||||
Key::N0,
|
Key::N2,
|
||||||
Key::Hyphen,
|
Key::N3,
|
||||||
Key::Equals,
|
Key::N4,
|
||||||
Key::BkSpc,
|
Key::N5,
|
||||||
]),
|
Key::N6,
|
||||||
KeyRow::new(vec![
|
Key::N7,
|
||||||
Key::Tab,
|
Key::N8,
|
||||||
Key::Q,
|
Key::N9,
|
||||||
Key::W,
|
Key::N0,
|
||||||
Key::E,
|
Key::Hyphen,
|
||||||
Key::R,
|
Key::Equals,
|
||||||
Key::T,
|
Key::BkSpc,
|
||||||
Key::Y,
|
],
|
||||||
Key::U,
|
),
|
||||||
Key::I,
|
KeyRow::new(
|
||||||
Key::O,
|
1.0,
|
||||||
Key::P,
|
vec![
|
||||||
Key::LBracket,
|
Key::Tab,
|
||||||
Key::RBracket,
|
Key::Q,
|
||||||
Key::BackSlash,
|
Key::W,
|
||||||
]),
|
Key::E,
|
||||||
KeyRow::new(vec![
|
Key::R,
|
||||||
Key::Caps,
|
Key::T,
|
||||||
Key::A,
|
Key::Y,
|
||||||
Key::S,
|
Key::U,
|
||||||
Key::D,
|
Key::I,
|
||||||
Key::F,
|
Key::O,
|
||||||
Key::G,
|
Key::P,
|
||||||
Key::H,
|
Key::LBracket,
|
||||||
Key::J,
|
Key::RBracket,
|
||||||
Key::K,
|
Key::BackSlash,
|
||||||
Key::L,
|
],
|
||||||
Key::SemiColon,
|
),
|
||||||
Key::Quote,
|
KeyRow::new(
|
||||||
Key::Return,
|
1.0,
|
||||||
]),
|
vec![
|
||||||
KeyRow::new(vec![
|
Key::Caps,
|
||||||
Key::LShift,
|
Key::A,
|
||||||
Key::Z,
|
Key::S,
|
||||||
Key::X,
|
Key::D,
|
||||||
Key::C,
|
Key::F,
|
||||||
Key::V,
|
Key::G,
|
||||||
Key::B,
|
Key::H,
|
||||||
Key::N,
|
Key::J,
|
||||||
Key::M,
|
Key::K,
|
||||||
Key::Comma,
|
Key::L,
|
||||||
Key::Period,
|
Key::SemiColon,
|
||||||
Key::FwdSlash,
|
Key::Quote,
|
||||||
Key::Rshift,
|
Key::Return,
|
||||||
]),
|
],
|
||||||
KeyRow::new(vec![
|
),
|
||||||
Key::LCtrl,
|
KeyRow::new(
|
||||||
Key::LFn,
|
1.0,
|
||||||
Key::Meta,
|
vec![
|
||||||
Key::LAlt,
|
Key::LShift,
|
||||||
Key::Space,
|
Key::Z,
|
||||||
Key::RAlt,
|
Key::X,
|
||||||
Key::PrtSc,
|
Key::C,
|
||||||
Key::RCtrl,
|
Key::V,
|
||||||
Key::ArrowSpacer,
|
Key::B,
|
||||||
Key::Up,
|
Key::N,
|
||||||
Key::ArrowSpacer,
|
Key::M,
|
||||||
]),
|
Key::Comma,
|
||||||
KeyRow::new(vec![
|
Key::Period,
|
||||||
Key::ArrowSpacer,
|
Key::FwdSlash,
|
||||||
Key::ArrowSpacer,
|
Key::Rshift,
|
||||||
Key::ArrowSpacer,
|
],
|
||||||
Key::ArrowSpacer,
|
),
|
||||||
Key::ArrowSpacer,
|
KeyRow::new(
|
||||||
Key::ArrowSpacer,
|
1.0,
|
||||||
Key::ArrowSpacer,
|
vec![
|
||||||
Key::ArrowSpacer,
|
Key::LCtrl,
|
||||||
Key::ArrowSpacer,
|
Key::LFn,
|
||||||
Key::ArrowSpacer,
|
Key::Meta,
|
||||||
Key::ArrowSpacer,
|
Key::LAlt,
|
||||||
Key::ArrowSpacer,
|
Key::Space,
|
||||||
Key::ArrowSpacer,
|
Key::RAlt,
|
||||||
Key::Left,
|
Key::PrtSc,
|
||||||
Key::Down,
|
Key::RCtrl,
|
||||||
Key::Right,
|
Key::ArrowSpacer,
|
||||||
Key::ArrowSpacer,
|
Key::Up,
|
||||||
]),
|
Key::ArrowSpacer,
|
||||||
|
],
|
||||||
|
),
|
||||||
|
KeyRow::new(
|
||||||
|
1.2,
|
||||||
|
vec![
|
||||||
|
Key::ArrowSpacer,
|
||||||
|
Key::ArrowSpacer,
|
||||||
|
Key::ArrowSpacer,
|
||||||
|
Key::ArrowSpacer,
|
||||||
|
Key::ArrowSpacer,
|
||||||
|
Key::ArrowSpacer,
|
||||||
|
Key::ArrowSpacer,
|
||||||
|
Key::ArrowSpacer,
|
||||||
|
Key::ArrowSpacer,
|
||||||
|
Key::ArrowSpacer,
|
||||||
|
Key::ArrowSpacer,
|
||||||
|
Key::ArrowSpacer,
|
||||||
|
Key::ArrowSpacer,
|
||||||
|
Key::Left,
|
||||||
|
Key::Down,
|
||||||
|
Key::Right,
|
||||||
|
Key::ArrowSpacer,
|
||||||
|
],
|
||||||
|
),
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,147 +7,171 @@ impl KeyLayout {
|
|||||||
matches: vec!["GX502".into(), "GU502".into()],
|
matches: vec!["GX502".into(), "GU502".into()],
|
||||||
locale: "US".to_string(),
|
locale: "US".to_string(),
|
||||||
rows: vec![
|
rows: vec![
|
||||||
KeyRow::new(vec![
|
KeyRow::new(
|
||||||
Key::NormalSpacer,
|
0.8,
|
||||||
Key::FuncSpacer,
|
vec![
|
||||||
Key::VolDown,
|
Key::NormalSpacer,
|
||||||
Key::VolUp,
|
Key::FuncSpacer,
|
||||||
Key::MicMute,
|
Key::VolDown,
|
||||||
Key::Rog,
|
Key::VolUp,
|
||||||
]),
|
Key::MicMute,
|
||||||
KeyRow::new(vec![
|
Key::Rog,
|
||||||
Key::Esc,
|
],
|
||||||
Key::FuncSpacer,
|
),
|
||||||
Key::F1,
|
KeyRow::new(
|
||||||
Key::F2,
|
0.8,
|
||||||
Key::F3,
|
vec![
|
||||||
Key::F4,
|
Key::Esc,
|
||||||
Key::FuncSpacer, // not sure which key to put here
|
Key::FuncSpacer,
|
||||||
Key::F5,
|
Key::F1,
|
||||||
Key::F6,
|
Key::F2,
|
||||||
Key::F7,
|
Key::F3,
|
||||||
Key::F8,
|
Key::F4,
|
||||||
Key::FuncSpacer,
|
Key::FuncSpacer, // not sure which key to put here
|
||||||
Key::F9,
|
Key::F5,
|
||||||
Key::F10,
|
Key::F6,
|
||||||
Key::F11,
|
Key::F7,
|
||||||
Key::F12,
|
Key::F8,
|
||||||
Key::RowEndSpacer,
|
Key::FuncSpacer,
|
||||||
Key::Del,
|
Key::F9,
|
||||||
]),
|
Key::F10,
|
||||||
KeyRow::new(vec![
|
Key::F11,
|
||||||
Key::Tilde,
|
Key::F12,
|
||||||
Key::N1,
|
Key::RowEndSpacer,
|
||||||
Key::N2,
|
Key::Del,
|
||||||
Key::N3,
|
],
|
||||||
Key::N4,
|
),
|
||||||
Key::N5,
|
KeyRow::new(
|
||||||
Key::N6,
|
1.0,
|
||||||
Key::N7,
|
vec![
|
||||||
Key::N8,
|
Key::Tilde,
|
||||||
Key::N9,
|
Key::N1,
|
||||||
Key::N0,
|
Key::N2,
|
||||||
Key::Hyphen,
|
Key::N3,
|
||||||
Key::Equals,
|
Key::N4,
|
||||||
Key::BkSpc3_1,
|
Key::N5,
|
||||||
Key::BkSpc3_2,
|
Key::N6,
|
||||||
Key::BkSpc3_3,
|
Key::N7,
|
||||||
Key::RowEndSpacer,
|
Key::N8,
|
||||||
Key::Home,
|
Key::N9,
|
||||||
]),
|
Key::N0,
|
||||||
KeyRow::new(vec![
|
Key::Hyphen,
|
||||||
Key::Tab,
|
Key::Equals,
|
||||||
Key::Q,
|
Key::BkSpc3_1,
|
||||||
Key::W,
|
Key::BkSpc3_2,
|
||||||
Key::E,
|
Key::BkSpc3_3,
|
||||||
Key::R,
|
Key::RowEndSpacer,
|
||||||
Key::T,
|
Key::Home,
|
||||||
Key::Y,
|
],
|
||||||
Key::U,
|
),
|
||||||
Key::I,
|
KeyRow::new(
|
||||||
Key::O,
|
1.0,
|
||||||
Key::P,
|
vec![
|
||||||
Key::LBracket,
|
Key::Tab,
|
||||||
Key::RBracket,
|
Key::Q,
|
||||||
Key::BackSlash,
|
Key::W,
|
||||||
Key::RowEndSpacer,
|
Key::E,
|
||||||
Key::PgUp,
|
Key::R,
|
||||||
]),
|
Key::T,
|
||||||
KeyRow::new(vec![
|
Key::Y,
|
||||||
Key::Caps,
|
Key::U,
|
||||||
Key::A,
|
Key::I,
|
||||||
Key::S,
|
Key::O,
|
||||||
Key::D,
|
Key::P,
|
||||||
Key::F,
|
Key::LBracket,
|
||||||
Key::G,
|
Key::RBracket,
|
||||||
Key::H,
|
Key::BackSlash,
|
||||||
Key::J,
|
Key::RowEndSpacer,
|
||||||
Key::K,
|
Key::PgUp,
|
||||||
Key::L,
|
],
|
||||||
Key::SemiColon,
|
),
|
||||||
Key::Quote,
|
KeyRow::new(
|
||||||
Key::Return3_1,
|
1.0,
|
||||||
Key::Return3_2,
|
vec![
|
||||||
Key::Return3_3,
|
Key::Caps,
|
||||||
Key::RowEndSpacer,
|
Key::A,
|
||||||
Key::PgDn,
|
Key::S,
|
||||||
]),
|
Key::D,
|
||||||
KeyRow::new(vec![
|
Key::F,
|
||||||
Key::LShift,
|
Key::G,
|
||||||
Key::Z,
|
Key::H,
|
||||||
Key::X,
|
Key::J,
|
||||||
Key::C,
|
Key::K,
|
||||||
Key::V,
|
Key::L,
|
||||||
Key::B,
|
Key::SemiColon,
|
||||||
Key::N,
|
Key::Quote,
|
||||||
Key::M,
|
Key::Return3_1,
|
||||||
Key::Comma,
|
Key::Return3_2,
|
||||||
Key::Period,
|
Key::Return3_3,
|
||||||
Key::FwdSlash,
|
Key::RowEndSpacer,
|
||||||
Key::Rshift3_1,
|
Key::PgDn,
|
||||||
Key::Rshift3_2,
|
],
|
||||||
Key::Rshift3_3,
|
),
|
||||||
Key::RowEndSpacer,
|
KeyRow::new(
|
||||||
Key::End,
|
1.0,
|
||||||
]),
|
vec![
|
||||||
KeyRow::new(vec![
|
Key::LShift,
|
||||||
Key::LCtrl,
|
Key::Z,
|
||||||
Key::LFn,
|
Key::X,
|
||||||
Key::Meta,
|
Key::C,
|
||||||
Key::LAlt,
|
Key::V,
|
||||||
Key::Space5_1,
|
Key::B,
|
||||||
Key::Space5_2,
|
Key::N,
|
||||||
Key::Space5_3,
|
Key::M,
|
||||||
Key::Space5_4,
|
Key::Comma,
|
||||||
Key::Space5_5,
|
Key::Period,
|
||||||
Key::RAlt,
|
Key::FwdSlash,
|
||||||
Key::PrtSc,
|
Key::Rshift3_1,
|
||||||
Key::RCtrl,
|
Key::Rshift3_2,
|
||||||
Key::ArrowSpacer,
|
Key::Rshift3_3,
|
||||||
Key::Up,
|
Key::RowEndSpacer,
|
||||||
Key::ArrowSpacer,
|
Key::End,
|
||||||
Key::RowEndSpacer,
|
],
|
||||||
Key::RFn,
|
),
|
||||||
]),
|
KeyRow::new(
|
||||||
KeyRow::new(vec![
|
1.0,
|
||||||
Key::ArrowSpacer,
|
vec![
|
||||||
Key::ArrowSpacer,
|
Key::LCtrl,
|
||||||
Key::ArrowSpacer,
|
Key::LFn,
|
||||||
Key::ArrowSpacer,
|
Key::Meta,
|
||||||
Key::ArrowSpacer,
|
Key::LAlt,
|
||||||
Key::ArrowSpacer,
|
Key::Space5_1,
|
||||||
Key::ArrowSpacer,
|
Key::Space5_2,
|
||||||
Key::ArrowSpacer,
|
Key::Space5_3,
|
||||||
Key::ArrowSpacer,
|
Key::Space5_4,
|
||||||
Key::ArrowSpacer,
|
Key::Space5_5,
|
||||||
Key::ArrowSpacer,
|
Key::RAlt,
|
||||||
Key::ArrowSpacer,
|
Key::PrtSc,
|
||||||
Key::ArrowSpacer,
|
Key::RCtrl,
|
||||||
Key::Left,
|
Key::ArrowSpacer,
|
||||||
Key::Down,
|
Key::Up,
|
||||||
Key::Right,
|
Key::ArrowSpacer,
|
||||||
Key::ArrowSpacer,
|
Key::RowEndSpacer,
|
||||||
]),
|
Key::RFn,
|
||||||
|
],
|
||||||
|
),
|
||||||
|
KeyRow::new(
|
||||||
|
1.0,
|
||||||
|
vec![
|
||||||
|
Key::ArrowSpacer,
|
||||||
|
Key::ArrowSpacer,
|
||||||
|
Key::ArrowSpacer,
|
||||||
|
Key::ArrowSpacer,
|
||||||
|
Key::ArrowSpacer,
|
||||||
|
Key::ArrowSpacer,
|
||||||
|
Key::ArrowSpacer,
|
||||||
|
Key::ArrowSpacer,
|
||||||
|
Key::ArrowSpacer,
|
||||||
|
Key::ArrowSpacer,
|
||||||
|
Key::ArrowSpacer,
|
||||||
|
Key::ArrowSpacer,
|
||||||
|
Key::ArrowSpacer,
|
||||||
|
Key::Left,
|
||||||
|
Key::Down,
|
||||||
|
Key::Right,
|
||||||
|
Key::ArrowSpacer,
|
||||||
|
],
|
||||||
|
),
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,15 +50,20 @@ impl KeyLayout {
|
|||||||
|
|
||||||
#[derive(Debug, Deserialize, Serialize)]
|
#[derive(Debug, Deserialize, Serialize)]
|
||||||
pub struct KeyRow {
|
pub struct KeyRow {
|
||||||
|
height: f32,
|
||||||
row: Vec<Key>,
|
row: Vec<Key>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl KeyRow {
|
impl KeyRow {
|
||||||
pub fn new(row: Vec<Key>) -> Self {
|
pub fn new(height: f32, row: Vec<Key>) -> Self {
|
||||||
Self { row }
|
Self { height, row }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn row(&self) -> Iter<Key> {
|
pub fn row(&self) -> Iter<Key> {
|
||||||
self.row.iter()
|
self.row.iter()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn height(&self) -> f32 {
|
||||||
|
self.height
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
let mut path = PathBuf::from(DATA_DIR);
|
let mut path = PathBuf::from(DATA_DIR);
|
||||||
#[cfg(feature = "mocking")]
|
#[cfg(feature = "mocking")]
|
||||||
{
|
{
|
||||||
board_name = "G513".to_string();
|
board_name = "gx502".to_string();
|
||||||
path.pop();
|
path.pop();
|
||||||
path.push("rog-aura");
|
path.push("rog-aura");
|
||||||
path.push("data");
|
path.push("data");
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ impl<'a> RogApp<'a> {
|
|||||||
ui.spacing_mut().item_spacing = egui::vec2(0.0, 0.0);
|
ui.spacing_mut().item_spacing = egui::vec2(0.0, 0.0);
|
||||||
let mut arrows_done = false;
|
let mut arrows_done = false;
|
||||||
for row in states.keyboard_layout.rows() {
|
for row in states.keyboard_layout.rows() {
|
||||||
|
let height = row.height();
|
||||||
ui.horizontal_top(|ui| {
|
ui.horizontal_top(|ui| {
|
||||||
for key in row.row() {
|
for key in row.row() {
|
||||||
// your boat
|
// your boat
|
||||||
@@ -38,11 +39,11 @@ impl<'a> RogApp<'a> {
|
|||||||
arrows_done = true;
|
arrows_done = true;
|
||||||
}
|
}
|
||||||
} else if shape.is_blank() || shape.is_spacer() {
|
} else if shape.is_blank() || shape.is_spacer() {
|
||||||
blank(ui, shape);
|
blank(ui, shape.width(), height);
|
||||||
} else if shape.is_group() {
|
} else if shape.is_group() {
|
||||||
key_group(ui, colour, shape.ux(), shape.uy()).on_hover_text(label);
|
key_group(ui, colour, shape.width(), height).on_hover_text(label);
|
||||||
} else {
|
} else {
|
||||||
key_shape(ui, colour, shape).on_hover_text(label);
|
key_shape(ui, colour, shape.width(), height).on_hover_text(label);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -51,9 +52,8 @@ impl<'a> RogApp<'a> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn key_shape(ui: &mut egui::Ui, colour: Color32, shape: KeyShape) -> egui::Response {
|
fn key_shape(ui: &mut egui::Ui, colour: Color32, ux: f32, uy: f32) -> egui::Response {
|
||||||
let desired_size =
|
let desired_size = ui.spacing().interact_size.y * egui::vec2(2.0 * ux, 2.0 * uy);
|
||||||
ui.spacing().interact_size.y * egui::vec2(2.0 * shape.ux(), 2.0 * shape.uy());
|
|
||||||
let (mut rect, mut response) = ui.allocate_exact_size(desired_size, egui::Sense::click());
|
let (mut rect, mut response) = ui.allocate_exact_size(desired_size, egui::Sense::click());
|
||||||
rect = rect.shrink(3.0);
|
rect = rect.shrink(3.0);
|
||||||
if response.clicked() {
|
if response.clicked() {
|
||||||
@@ -94,32 +94,32 @@ fn key_group(ui: &mut egui::Ui, colour: Color32, ux: f32, uy: f32) -> egui::Resp
|
|||||||
response
|
response
|
||||||
}
|
}
|
||||||
|
|
||||||
fn blank(ui: &mut egui::Ui, shape: KeyShape) {
|
fn blank(ui: &mut egui::Ui, ux: f32, uy: f32) {
|
||||||
let desired_size =
|
let desired_size = ui.spacing().interact_size.y * egui::vec2(2.0 * ux, 2.0 * uy);
|
||||||
ui.spacing().interact_size.y * egui::vec2(2.0 * shape.ux(), 2.0 * shape.uy());
|
|
||||||
ui.allocate_exact_size(desired_size, egui::Sense::click());
|
ui.allocate_exact_size(desired_size, egui::Sense::click());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Draws entire arrow cluster block. This is visibly different to the split-arrows.
|
/// Draws entire arrow cluster block. This is visibly different to the split-arrows.
|
||||||
fn arrow_cluster(ui: &mut egui::Ui, colour: Color32) {
|
fn arrow_cluster(ui: &mut egui::Ui, colour: Color32) {
|
||||||
|
let height = 0.7;
|
||||||
let space = KeyShape::ArrowSpacer;
|
let space = KeyShape::ArrowSpacer;
|
||||||
let shape = KeyShape::Arrow;
|
let shape = KeyShape::Arrow;
|
||||||
ui.horizontal_top(|ui| {
|
ui.horizontal_top(|ui| {
|
||||||
ui.with_layout(egui::Layout::top_down(Align::LEFT), |ui| {
|
ui.with_layout(egui::Layout::top_down(Align::LEFT), |ui| {
|
||||||
blank(ui, space);
|
blank(ui, space.width(), height);
|
||||||
ui.horizontal(|ui| {
|
ui.horizontal(|ui| {
|
||||||
blank(ui, KeyShape::RowEndSpacer);
|
blank(ui, KeyShape::RowEndSpacer.width(), height);
|
||||||
blank(ui, KeyShape::RowEndSpacer);
|
blank(ui, KeyShape::RowEndSpacer.width(), height);
|
||||||
key_shape(ui, colour, shape).on_hover_text("Left");
|
key_shape(ui, colour, shape.width(), height).on_hover_text("Left");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
ui.with_layout(egui::Layout::top_down(Align::LEFT), |ui| {
|
ui.with_layout(egui::Layout::top_down(Align::LEFT), |ui| {
|
||||||
key_shape(ui, colour, shape).on_hover_text("Up");
|
key_shape(ui, colour, shape.width(), height).on_hover_text("Up");
|
||||||
key_shape(ui, colour, shape).on_hover_text("Down");
|
key_shape(ui, colour, shape.width(), height).on_hover_text("Down");
|
||||||
});
|
});
|
||||||
ui.with_layout(egui::Layout::top_down(Align::LEFT), |ui| {
|
ui.with_layout(egui::Layout::top_down(Align::LEFT), |ui| {
|
||||||
blank(ui, space);
|
blank(ui, space.width(), height);
|
||||||
key_shape(ui, colour, shape).on_hover_text("Right");
|
key_shape(ui, colour, shape.width(), height).on_hover_text("Right");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user