From 12cf628c71cfa41bc73bab2043b680382d63c5ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Fri, 3 Dec 2021 10:30:08 +0100 Subject: [PATCH] Add URL and EMail keyboard variants for us Closes: #65 --- data/keyboards/email/us.yaml | 81 ++++++++++++++++++++++++++++++++++++ data/keyboards/url/us.yaml | 81 ++++++++++++++++++++++++++++++++++++ src/data/loading.rs | 6 ++- src/resources.rs | 6 +++ 4 files changed, 172 insertions(+), 2 deletions(-) create mode 100644 data/keyboards/email/us.yaml create mode 100644 data/keyboards/url/us.yaml diff --git a/data/keyboards/email/us.yaml b/data/keyboards/email/us.yaml new file mode 100644 index 00000000..22f9dc2c --- /dev/null +++ b/data/keyboards/email/us.yaml @@ -0,0 +1,81 @@ +--- +outlines: + default: { width: 35.33, height: 52 } + altline: { width: 52.67, height: 52 } + wide: { width: 62, height: 52 } + spaceline: { width: 106.67, height: 52 } + special: { width: 44, height: 52 } + +views: + base: + - "q w e r t y u i o p" + - "a s d f g h j k l" + - "Shift_L z x c v b n m BackSpace" + - "show_numbers preferences space at period Return" + upper: + - "Q W E R T Y U I O P" + - "A S D F G H J K L" + - "Shift_L Z X C V B N M BackSpace" + - "show_numbers preferences space at period Return" + numbers: + - "1 2 3 4 5 6 7 8 9 0" + - "@ # $ % & - _ + ( )" + - "show_symbols , \" ' colon ; ! ? BackSpace" + - "show_letters preferences space at period Return" + symbols: + - "~ ` | · √ π τ ÷ × ¶" + - "© ® £ € ¥ ^ ° * { }" + - "show_numbers_from_symbols \\ / < > = [ ] BackSpace" + - "show_letters preferences space at period Return" + +buttons: + Shift_L: + action: + locking: + lock_view: "upper" + unlock_view: "base" + outline: "altline" + icon: "key-shift" + BackSpace: + outline: "altline" + icon: "edit-clear-symbolic" + action: erase + at: + outline: "special" + text: "@" + preferences: + action: show_prefs + outline: "special" + icon: "keyboard-mode-symbolic" + show_numbers: + action: + set_view: "numbers" + outline: "wide" + label: "123" + show_numbers_from_symbols: + action: + set_view: "numbers" + outline: "altline" + label: "123" + show_letters: + action: + set_view: "base" + outline: "wide" + label: "ABC" + show_symbols: + action: + set_view: "symbols" + outline: "altline" + label: "*/=" + period: + outline: "special" + text: "." + space: + outline: "spaceline" + text: " " + Return: + outline: "wide" + icon: "key-enter" + keysym: "Return" + colon: + text: ":" diff --git a/data/keyboards/url/us.yaml b/data/keyboards/url/us.yaml new file mode 100644 index 00000000..8a8a7482 --- /dev/null +++ b/data/keyboards/url/us.yaml @@ -0,0 +1,81 @@ +--- +outlines: + default: { width: 35.33, height: 52 } + altline: { width: 52.67, height: 52 } + wide: { width: 62, height: 52 } + spaceline: { width: 106.67, height: 52 } + special: { width: 44, height: 52 } + +views: + base: + - "q w e r t y u i o p" + - "a s d f g h j k l" + - "Shift_L z x c v b n m BackSpace" + - "show_numbers preferences space slash period Return" + upper: + - "Q W E R T Y U I O P" + - "A S D F G H J K L" + - "Shift_L Z X C V B N M BackSpace" + - "show_numbers preferences space slash period Return" + numbers: + - "1 2 3 4 5 6 7 8 9 0" + - "@ # $ % & - _ + ( )" + - "show_symbols , \" ' colon ; ! ? BackSpace" + - "show_letters preferences space slash period Return" + symbols: + - "~ ` | · √ π τ ÷ × ¶" + - "© ® £ € ¥ ^ ° * { }" + - "show_numbers_from_symbols \\ / < > = [ ] BackSpace" + - "show_letters preferences space slash period Return" + +buttons: + Shift_L: + action: + locking: + lock_view: "upper" + unlock_view: "base" + outline: "altline" + icon: "key-shift" + BackSpace: + outline: "altline" + icon: "edit-clear-symbolic" + action: erase + preferences: + action: show_prefs + outline: "special" + icon: "keyboard-mode-symbolic" + show_numbers: + action: + set_view: "numbers" + outline: "wide" + label: "123" + show_numbers_from_symbols: + action: + set_view: "numbers" + outline: "altline" + label: "123" + show_letters: + action: + set_view: "base" + outline: "wide" + label: "ABC" + show_symbols: + action: + set_view: "symbols" + outline: "altline" + label: "*/=" + period: + outline: "special" + text: "." + slash: + outline: "special" + text: "/" + space: + outline: "spaceline" + text: " " + Return: + outline: "wide" + icon: "key-enter" + keysym: "Return" + colon: + text: ":" diff --git a/src/data/loading.rs b/src/data/loading.rs index 30cbcc7f..20360f43 100644 --- a/src/data/loading.rs +++ b/src/data/loading.rs @@ -166,11 +166,13 @@ fn get_directory_string( let layout_purpose = match overlay { None => match content_purpose { - ContentPurpose::Number => Special("number"), + ContentPurpose::Email => Special("email"), ContentPurpose::Digits => Special("number"), + ContentPurpose::Number => Special("number"), ContentPurpose::Phone => Special("number"), - ContentPurpose::Terminal => Special("terminal"), ContentPurpose::Pin => Special("pin"), + ContentPurpose::Terminal => Special("terminal"), + ContentPurpose::Url => Special("url"), _ => Default, }, Some(overlay) => Special(overlay), diff --git a/src/resources.rs b/src/resources.rs index cfc3c3f8..f512921d 100644 --- a/src/resources.rs +++ b/src/resources.rs @@ -91,6 +91,12 @@ static KEYBOARDS: &[(&'static str, &'static str)] = &[ ("us+dvorak", include_str!("../data/keyboards/us+dvorak.yaml")), ("us+dvorak_wide", include_str!("../data/keyboards/us+dvorak_wide.yaml")), + // Email + ("email/us", include_str!("../data/keyboards/email/us.yaml")), + + // URL + ("url/us", include_str!("../data/keyboards/url/us.yaml")), + // Others ("number/us", include_str!("../data/keyboards/number/us.yaml")), ("pin/us", include_str!("../data/keyboards/pin/us.yaml")),