Skip to content

Commit

Permalink
Numeric layout for type-split. (#337)
Browse files Browse the repository at this point in the history
* Numeric layout for type-split.

A numeric layout better suited for the type-split layouts.

* Numeric layout for type-split.

A numeric layout better suited for the type-split layouts.

* Revert "Numeric layout for type-split."

This reverts commit e525ab6.

* Type-split: set new numeric mode.
  • Loading branch information
mockballed authored Aug 2, 2023
1 parent 21a0c5e commit fd8859b
Show file tree
Hide file tree
Showing 8 changed files with 316 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -560,5 +560,5 @@ val TYPESPLIT_DE_V1_SHIFTED = KeyboardC(
val TYPESPLIT_DE_V1_KEYBOARD_MODES: Map<KeyboardMode, KeyboardC> = mapOf(
KeyboardMode.MAIN to TYPESPLIT_DE_V1,
KeyboardMode.SHIFTED to TYPESPLIT_DE_V1_SHIFTED,
KeyboardMode.NUMERIC to NUMERIC_KEYBOARD,
KeyboardMode.NUMERIC to TYPESPLIT_NUMERIC_KEYBOARD,
)
Original file line number Diff line number Diff line change
Expand Up @@ -496,5 +496,5 @@ val TYPESPLIT_EN_V2_SHIFTED = KeyboardC(
val TYPESPLIT_EN_V2_KEYBOARD_MODES: Map<KeyboardMode, KeyboardC> = mapOf(
KeyboardMode.MAIN to TYPESPLIT_EN_V2,
KeyboardMode.SHIFTED to TYPESPLIT_EN_V2_SHIFTED,
KeyboardMode.NUMERIC to NUMERIC_KEYBOARD,
KeyboardMode.NUMERIC to TYPESPLIT_NUMERIC_KEYBOARD,
)
Original file line number Diff line number Diff line change
Expand Up @@ -608,5 +608,5 @@ val TYPESPLIT_ES_V1_SHIFTED = KeyboardC(
val TYPESPLIT_ES_V1_KEYBOARD_MODES: Map<KeyboardMode, KeyboardC> = mapOf(
KeyboardMode.MAIN to TYPESPLIT_ES_V1,
KeyboardMode.SHIFTED to TYPESPLIT_ES_V1_SHIFTED,
KeyboardMode.NUMERIC to NUMERIC_KEYBOARD,
KeyboardMode.NUMERIC to TYPESPLIT_NUMERIC_KEYBOARD,
)
Original file line number Diff line number Diff line change
Expand Up @@ -620,5 +620,5 @@ val TYPESPLIT_FR_V1_SHIFTED = KeyboardC(
val TYPESPLIT_FR_V1_KEYBOARD_MODES: Map<KeyboardMode, KeyboardC> = mapOf(
KeyboardMode.MAIN to TYPESPLIT_FR_V1,
KeyboardMode.SHIFTED to TYPESPLIT_FR_V1_SHIFTED,
KeyboardMode.NUMERIC to NUMERIC_KEYBOARD,
KeyboardMode.NUMERIC to TYPESPLIT_NUMERIC_KEYBOARD,
)
Original file line number Diff line number Diff line change
Expand Up @@ -548,5 +548,5 @@ val TYPESPLIT_IT_V1_SHIFTED = KeyboardC(
val TYPESPLIT_IT_V1_KEYBOARD_MODES: Map<KeyboardMode, KeyboardC> = mapOf(
KeyboardMode.MAIN to TYPESPLIT_IT_V1,
KeyboardMode.SHIFTED to TYPESPLIT_IT_V1_SHIFTED,
KeyboardMode.NUMERIC to NUMERIC_KEYBOARD,
KeyboardMode.NUMERIC to TYPESPLIT_NUMERIC_KEYBOARD,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,309 @@
package com.dessalines.thumbkey.keyboards

import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.Abc
import androidx.compose.material.icons.outlined.Settings
import com.dessalines.thumbkey.utils.ColorVariant
import com.dessalines.thumbkey.utils.FontSizeVariant
import com.dessalines.thumbkey.utils.KeyAction
import com.dessalines.thumbkey.utils.KeyC
import com.dessalines.thumbkey.utils.KeyDisplay
import com.dessalines.thumbkey.utils.KeyItemC
import com.dessalines.thumbkey.utils.KeyboardC
import com.dessalines.thumbkey.utils.SwipeDirection

val TYPESPLIT_NUMERIC_KEYBOARD = KeyboardC(
listOf(
listOf(
KeyItemC(
center = KeyC(
display = KeyDisplay.TextDisplay(" "),
action = KeyAction.CommitText(" "),
),
swipes = mapOf(
SwipeDirection.TOP to KeyC(
display = KeyDisplay.IconDisplay(Icons.Outlined.Settings),
action = KeyAction.GotoSettings,
color = ColorVariant.SECONDARY,
),
),
backgroundColor = ColorVariant.SURFACE_VARIANT,
),
KeyItemC(
center = KeyC(
display = KeyDisplay.TextDisplay("1"),
action = KeyAction.CommitText("1"),
size = FontSizeVariant.LARGE,
color = ColorVariant.PRIMARY,
),
swipes = mapOf(
SwipeDirection.BOTTOM_LEFT to KeyC(
display = KeyDisplay.TextDisplay("$"),
action = KeyAction.CommitText("$"),
),
),
),
KeyItemC(
center = KeyC(
display = KeyDisplay.TextDisplay("2"),
action = KeyAction.CommitText("2"),
size = FontSizeVariant.LARGE,
color = ColorVariant.PRIMARY,
),
swipes = mapOf(
SwipeDirection.TOP_LEFT to KeyC(
display = KeyDisplay.TextDisplay("`"),
action = KeyAction.CommitText("`"),
),
SwipeDirection.TOP to KeyC(
display = KeyDisplay.TextDisplay("^"),
action = KeyAction.CommitText("^"),
),
SwipeDirection.TOP_RIGHT to KeyC(
display = KeyDisplay.TextDisplay("´"),
action = KeyAction.CommitText("´"),
),
SwipeDirection.RIGHT to KeyC(
display = KeyDisplay.TextDisplay("!"),
action = KeyAction.CommitText("!"),
),
SwipeDirection.BOTTOM_RIGHT to KeyC(
display = KeyDisplay.TextDisplay("\\"),
action = KeyAction.CommitText("\\"),
),
SwipeDirection.BOTTOM_LEFT to KeyC(
display = KeyDisplay.TextDisplay("/"),
action = KeyAction.CommitText("/"),
),
SwipeDirection.LEFT to KeyC(
display = KeyDisplay.TextDisplay("+"),
action = KeyAction.CommitText("+"),
),
),
),
KeyItemC(
center = KeyC(
display = KeyDisplay.TextDisplay("3"),
action = KeyAction.CommitText("3"),
size = FontSizeVariant.LARGE,
color = ColorVariant.PRIMARY,
),
swipes = mapOf(
SwipeDirection.LEFT to KeyC(
display = KeyDisplay.TextDisplay("?"),
action = KeyAction.CommitText("?"),
),
SwipeDirection.BOTTOM_RIGHT to KeyC(
display = KeyDisplay.TextDisplay(""),
action = KeyAction.CommitText(""),
),
SwipeDirection.BOTTOM_LEFT to KeyC(
display = KeyDisplay.TextDisplay("£"),
action = KeyAction.CommitText("£"),
),
SwipeDirection.BOTTOM to KeyC(
display = KeyDisplay.TextDisplay("="),
action = KeyAction.CommitText("="),
),
),
),
KeyItemC(
center = KeyC(
display = KeyDisplay.TextDisplay("."),
action = KeyAction.CommitText("."),
size = FontSizeVariant.LARGE,
color = ColorVariant.PRIMARY,
),
),
),
listOf(
SPACEBAR_SKINNY_KEY_ITEM,
KeyItemC(
center = KeyC(
display = KeyDisplay.TextDisplay("4"),
action = KeyAction.CommitText("4"),
size = FontSizeVariant.LARGE,
color = ColorVariant.PRIMARY,
),
swipes = mapOf(
SwipeDirection.TOP_LEFT to KeyC(
display = KeyDisplay.TextDisplay("{"),
action = KeyAction.CommitText("{"),
),
SwipeDirection.TOP_RIGHT to KeyC(
display = KeyDisplay.TextDisplay("%"),
action = KeyAction.CommitText("%"),
),
SwipeDirection.BOTTOM_RIGHT to KeyC(
display = KeyDisplay.TextDisplay("_"),
action = KeyAction.CommitText("_"),
),
SwipeDirection.BOTTOM_LEFT to KeyC(
display = KeyDisplay.TextDisplay("["),
action = KeyAction.CommitText("["),
),
SwipeDirection.LEFT to KeyC(
display = KeyDisplay.TextDisplay("("),
action = KeyAction.CommitText("("),
),
),
),
KeyItemC(
center = KeyC(
display = KeyDisplay.TextDisplay("5"),
action = KeyAction.CommitText("5"),
size = FontSizeVariant.LARGE,
color = ColorVariant.PRIMARY,
),
),
KeyItemC(
center = KeyC(
display = KeyDisplay.TextDisplay("6"),
action = KeyAction.CommitText("6"),
size = FontSizeVariant.LARGE,
color = ColorVariant.PRIMARY,
),
swipes = mapOf(
SwipeDirection.TOP_LEFT to KeyC(
display = KeyDisplay.TextDisplay("|"),
action = KeyAction.CommitText("|"),
),
SwipeDirection.TOP_RIGHT to KeyC(
display = KeyDisplay.TextDisplay("}"),
action = KeyAction.CommitText("}"),
),
SwipeDirection.RIGHT to KeyC(
display = KeyDisplay.TextDisplay(")"),
action = KeyAction.CommitText(")"),
),
SwipeDirection.BOTTOM_RIGHT to KeyC(
display = KeyDisplay.TextDisplay("]"),
action = KeyAction.CommitText("]"),
),
SwipeDirection.BOTTOM_LEFT to KeyC(
display = KeyDisplay.TextDisplay("@"),
action = KeyAction.CommitText("@"),
),
),
),
KeyItemC(
center = KeyC(
display = KeyDisplay.TextDisplay(","),
action = KeyAction.CommitText(","),
size = FontSizeVariant.LARGE,
color = ColorVariant.PRIMARY,
),
),
),
listOf(
SPACEBAR_SKINNY_KEY_ITEM,
KeyItemC(
center = KeyC(
display = KeyDisplay.TextDisplay("7"),
action = KeyAction.CommitText("7"),
size = FontSizeVariant.LARGE,
color = ColorVariant.PRIMARY,
),
swipes = mapOf(
SwipeDirection.TOP_LEFT to KeyC(
display = KeyDisplay.TextDisplay("~"),
action = KeyAction.CommitText("~"),
),
SwipeDirection.BOTTOM_RIGHT to KeyC(
display = KeyDisplay.TextDisplay(":"),
action = KeyAction.CommitText(":"),
),
SwipeDirection.BOTTOM_LEFT to KeyC(
display = KeyDisplay.TextDisplay("<"),
action = KeyAction.CommitText("<"),
),
),
),
KeyItemC(
center = KeyC(
display = KeyDisplay.TextDisplay("8"),
action = KeyAction.CommitText("8"),
size = FontSizeVariant.LARGE,
color = ColorVariant.PRIMARY,
),
swipes = mapOf(
SwipeDirection.TOP_LEFT to KeyC(
display = KeyDisplay.TextDisplay("\""),
action = KeyAction.CommitText("\""),
),
SwipeDirection.TOP_RIGHT to KeyC(
display = KeyDisplay.TextDisplay("'"),
action = KeyAction.CommitText("'"),
),
SwipeDirection.BOTTOM_RIGHT to KeyC(
display = KeyDisplay.TextDisplay("-"),
action = KeyAction.CommitText("-"),
),
SwipeDirection.BOTTOM to KeyC(
display = KeyDisplay.TextDisplay("."),
action = KeyAction.CommitText("."),
),
SwipeDirection.BOTTOM_LEFT to KeyC(
display = KeyDisplay.TextDisplay("*"),
action = KeyAction.CommitText("*"),
),
SwipeDirection.LEFT to KeyC(
display = KeyDisplay.TextDisplay(","),
action = KeyAction.CommitText(","),
),
),
),
KeyItemC(
center = KeyC(
display = KeyDisplay.TextDisplay("9"),
action = KeyAction.CommitText("9"),
size = FontSizeVariant.LARGE,
color = ColorVariant.PRIMARY,
),
swipes = mapOf(
SwipeDirection.TOP to KeyC(
display = KeyDisplay.TextDisplay("&"),
action = KeyAction.CommitText("&"),
),
SwipeDirection.TOP_RIGHT to KeyC(
display = KeyDisplay.TextDisplay("°"),
action = KeyAction.CommitText("°"),
),
SwipeDirection.BOTTOM_RIGHT to KeyC(
display = KeyDisplay.TextDisplay(">"),
action = KeyAction.CommitText(">"),
),
SwipeDirection.BOTTOM_LEFT to KeyC(
display = KeyDisplay.TextDisplay(";"),
action = KeyAction.CommitText(";"),
),
SwipeDirection.LEFT to KeyC(
display = KeyDisplay.TextDisplay("#"),
action = KeyAction.CommitText("#"),
),
),
),
KeyItemC(
center = KeyC(
display = KeyDisplay.TextDisplay("0"),
action = KeyAction.CommitText("0"),
size = FontSizeVariant.LARGE,
color = ColorVariant.PRIMARY,
),
),
),
listOf(
KeyItemC(
center = KeyC(
display = KeyDisplay.IconDisplay(Icons.Outlined.Abc),
action = KeyAction.ToggleNumericMode(false),
size = FontSizeVariant.LARGE,
color = ColorVariant.PRIMARY,
),
backgroundColor = ColorVariant.SURFACE_VARIANT,
),
BACKSPACE_TYPESPLIT_SHIFTED_KEY_ITEM,
RETURN_KEY_ITEM,
),
),
)
Original file line number Diff line number Diff line change
Expand Up @@ -636,5 +636,5 @@ val TYPESPLIT_PL_V1_SHIFTED = KeyboardC(
val TYPESPLIT_PL_V1_KEYBOARD_MODES: Map<KeyboardMode, KeyboardC> = mapOf(
KeyboardMode.MAIN to TYPESPLIT_PL_V1,
KeyboardMode.SHIFTED to TYPESPLIT_PL_V1_SHIFTED,
KeyboardMode.NUMERIC to NUMERIC_KEYBOARD,
KeyboardMode.NUMERIC to TYPESPLIT_NUMERIC_KEYBOARD,
)
Original file line number Diff line number Diff line change
Expand Up @@ -608,5 +608,5 @@ val TYPESPLIT_PT_V1_SHIFTED = KeyboardC(
val TYPESPLIT_PT_V1_KEYBOARD_MODES: Map<KeyboardMode, KeyboardC> = mapOf(
KeyboardMode.MAIN to TYPESPLIT_PT_V1,
KeyboardMode.SHIFTED to TYPESPLIT_PT_V1_SHIFTED,
KeyboardMode.NUMERIC to NUMERIC_KEYBOARD,
KeyboardMode.NUMERIC to TYPESPLIT_NUMERIC_KEYBOARD,
)

0 comments on commit fd8859b

Please sign in to comment.