Skip to content

Commit

Permalink
Hindi layout 2 (#1142)
Browse files Browse the repository at this point in the history
* Adding extended hindi layout.

* Fixing formatting.
  • Loading branch information
dessalines authored Nov 4, 2024
1 parent c299135 commit 51dcdf5
Show file tree
Hide file tree
Showing 3 changed files with 224 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ val KB_HI_THUMBKEY_SHIFTED =

val KB_HI_THUMBKEY: KeyboardDefinition =
KeyboardDefinition(
title = " हिन्दी thumb-key",
title = "हिन्दी thumb-key",
modes =
KeyboardDefinitionModes(
main = KB_HI_THUMBKEY_MAIN,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,221 @@
@file:Suppress("ktlint:standard:no-wildcard-imports")

package com.dessalines.thumbkey.keyboards

import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.*
import com.dessalines.thumbkey.utils.*
import com.dessalines.thumbkey.utils.ColorVariant.*
import com.dessalines.thumbkey.utils.FontSizeVariant.*
import com.dessalines.thumbkey.utils.KeyAction.*
import com.dessalines.thumbkey.utils.SwipeNWay.*

val KB_HI_THUMBKEY_EXTENDED_MAIN =
KeyboardC(
listOf(
listOf(
KeyItemC(
center = KeyC("", size = LARGE),
topLeft = KeyC(""),
top = KeyC(""),
topRight = KeyC(""),
right = KeyC(""),
bottomRight = KeyC(""),
bottom = KeyC(""),
bottomLeft = KeyC(""),
left = KeyC(","),
),
KeyItemC(
center = KeyC("", size = LARGE),
topLeft = KeyC(""),
top = KeyC("?"),
topRight = KeyC("!"),
right = KeyC(""),
bottomRight = KeyC(""),
bottom = KeyC(""),
bottomLeft = KeyC(""),
left = KeyC("ज्ञ"),
),
KeyItemC(
center = KeyC("", size = LARGE),
topLeft = KeyC(""),
top = KeyC(""),
topRight = KeyC(""),
right = KeyC(""),
bottomRight = KeyC(""),
bottom = KeyC(""),
bottomLeft = KeyC(""),
left = KeyC(""),
),
EMOJI_KEY_ITEM,
),
listOf(
KeyItemC(
center = KeyC("", size = LARGE),
topLeft = KeyC(""),
top = KeyC(""),
topRight = KeyC("द्य"),
right = KeyC(""),
bottomRight = KeyC(""),
bottom = KeyC(""),
bottomLeft = KeyC(""),
left = KeyC("त्र"),
),
KeyItemC(
center = KeyC("", size = LARGE),
topLeft = KeyC(""),
top = KeyC(""),
topRight = KeyC(""),
right = KeyC(""),
bottomRight = KeyC(""),
bottom = KeyC(""),
bottomLeft = KeyC(""),
left = KeyC("ड़"),
),
KeyItemC(
center = KeyC("", size = LARGE),
topLeft = KeyC(""),
top =
KeyC(
display = KeyDisplay.IconDisplay(Icons.Outlined.ArrowDropUp),
action = ToggleShiftMode(true),
swipeReturnAction = ToggleCurrentWordCapitalization(true),
color = MUTED,
),
topRight = KeyC("ि"),
right = KeyC(""),
bottomRight = KeyC(""),
bottom =
KeyC(
ToggleShiftMode(false),
swipeReturnAction = ToggleCurrentWordCapitalization(false),
),
bottomLeft = KeyC(""),
left = KeyC(""),
),
NUMERIC_KEY_ITEM,
),
listOf(
KeyItemC(
center = KeyC("", size = LARGE),
topLeft = KeyC(""),
top = KeyC(""),
topRight = KeyC(""),
right = KeyC(""),
bottomRight = KeyC(""),
bottom = KeyC(""),
bottomLeft = KeyC(":"),
left = KeyC("श्र"),
),
KeyItemC(
center = KeyC("", size = LARGE),
topLeft = KeyC(""),
top = KeyC(""),
topRight = KeyC(""),
right = KeyC(""),
bottomRight = KeyC(""),
bottom = KeyC(""),
bottomLeft = KeyC(""),
left = KeyC("क्ष"),
),
KeyItemC(
center = KeyC("", size = LARGE),
topLeft = KeyC(""),
top = KeyC(""),
topRight = KeyC(""),
right = KeyC(""),
bottomRight = KeyC("'ँ"),
bottom = KeyC("|"),
bottomLeft = KeyC("-"),
left = KeyC(""),
),
BACKSPACE_KEY_ITEM,
),
listOf(
SPACEBAR_KEY_ITEM,
RETURN_KEY_ITEM,
),
),
)

val KB_HI_THUMBKEY_EXTENDED_SHIFTED =
KeyboardC(
listOf(
listOf(
KeyItemC(
center = KeyC("", size = LARGE),
bottom = KeyC(";"),
),
KeyItemC(
center = KeyC("", size = LARGE),
bottom = KeyC("_"),
),
KeyItemC(
center = KeyC("", size = LARGE),
bottom = KeyC("@"),
),
EMOJI_KEY_ITEM,
),
listOf(
KeyItemC(
center = KeyC("", size = LARGE),
bottom = KeyC("<"),
),
KeyItemC(
center = KeyC("", size = LARGE),
bottom = KeyC(">"),
),
KeyItemC(
center = KeyC("", size = LARGE),
bottom =
KeyC(
display = KeyDisplay.IconDisplay(Icons.Outlined.ArrowDropDown),
action = ToggleShiftMode(false),
swipeReturnAction = ToggleCurrentWordCapitalization(false),
color = MUTED,
),
top =
KeyC(
display = KeyDisplay.IconDisplay(Icons.Outlined.KeyboardCapslock),
capsModeDisplay = KeyDisplay.IconDisplay(Icons.Outlined.Copyright),
action = ToggleCapsLock,
swipeReturnAction = ToggleCurrentWordCapitalization(true),
color = MUTED,
),
),
NUMERIC_KEY_ITEM,
),
listOf(
KeyItemC(
center = KeyC("", size = LARGE),
bottom = KeyC(""),
),
KeyItemC(
center = KeyC("", size = LARGE),
bottomRight = KeyC("(", color = MUTED),
bottom = KeyC("", color = MUTED),
bottomLeft = KeyC(")", color = MUTED),
),
KeyItemC(
center = KeyC("", size = LARGE),
bottom = KeyC("'"),
),
BACKSPACE_KEY_ITEM,
),
listOf(
SPACEBAR_KEY_ITEM,
RETURN_KEY_ITEM,
),
),
)

val KB_HI_THUMBKEY_EXTENDED: KeyboardDefinition =
KeyboardDefinition(
title = "हिन्दी thumb-key extended",
modes =
KeyboardDefinitionModes(
main = KB_HI_THUMBKEY_EXTENDED_MAIN,
shifted = KB_HI_THUMBKEY_EXTENDED_SHIFTED,
numeric = NUMERIC_KEYBOARD,
),
)
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ import com.dessalines.thumbkey.keyboards.KB_HE_MESSAGEASE
import com.dessalines.thumbkey.keyboards.KB_HE_MESSAGEASE_SYMBOLS
import com.dessalines.thumbkey.keyboards.KB_HE_THUMBKEY
import com.dessalines.thumbkey.keyboards.KB_HI_THUMBKEY
import com.dessalines.thumbkey.keyboards.KB_HI_THUMBKEY_EXTENDED
import com.dessalines.thumbkey.keyboards.KB_HR_THUMBKEY
import com.dessalines.thumbkey.keyboards.KB_HR_THUMBKEY_SYMBOLS
import com.dessalines.thumbkey.keyboards.KB_HR_TWO_HANDS
Expand Down Expand Up @@ -318,4 +319,5 @@ enum class KeyboardLayout(
ENThumbKeyProgrammingExpanded(KB_EN_THUMBKEY_PROGRAMMING_EXPANDED),
HIThumbKey(KB_HI_THUMBKEY),
ENNLTypeSplit(KB_EN_NL_TYPESPLIT),
HIThumbKeyExtended(KB_HI_THUMBKEY_EXTENDED),
}

0 comments on commit 51dcdf5

Please sign in to comment.