Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backspace swipe right to delete word and Slide gestures improvements #439

Merged
merged 24 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a4405f4
Grouped together 'slide gestures checkbox' and 'slide sensitivity sli…
sslater11 Sep 23, 2023
f284722
Enable/Disable 'Slide sensitivity' slider when the 'slide gestures' c…
sslater11 Sep 23, 2023
09fe4c5
Better swipe selection toggle and better swipe delete toggle.
sslater11 Sep 23, 2023
c0dd12c
Made swiping right on backspace key delete a whole word to the right.
sslater11 Sep 23, 2023
0f3d1f1
Merge branch 'main' into slide-gestures
dessalines Sep 26, 2023
824b91a
Swipe up or down to toggle slide gestures text selection.
sslater11 Oct 5, 2023
4d79ac6
Added a deadzone for slide gestures to allow normal swipes on spaceba…
sslater11 Oct 8, 2023
3ed9680
Added up and down swipes to spacebar to move cursor up and down.
sslater11 Oct 8, 2023
6dd9648
Merge branch 'slide-gestures' of https://github.com/sslater11/thumb-k…
sslater11 Oct 8, 2023
b0bb7d2
Merge branch 'main' into slide-gestures
sslater11 Oct 8, 2023
0020b1d
Fixes #410 - Added cursor acceleration for slide gestures on the spac…
sslater11 Oct 11, 2023
e6afd91
Format kotlin
sslater11 Oct 11, 2023
de489ba
Merge branch 'main' into slide-gestures
dessalines Oct 11, 2023
b867939
Fixing merge issue.
dessalines Oct 11, 2023
2220dc3
Fixed issue with selected text being deleted when we use the spacebar…
sslater11 Oct 12, 2023
a0c03d3
Copy/Cut actions now copy/cut all text if nothing is selected (#469)
sslater11 Oct 12, 2023
cf01818
Adding threshold acceleration
WadeWT Oct 19, 2023
5dcd7ae
Added more cursor acceleration modes.
sslater11 Oct 19, 2023
7c0f76d
DB Migration: Added settings menu for slide gestures cursor accelerat…
sslater11 Oct 19, 2023
ffe3c1e
Grouped all slide gesture settings together.
sslater11 Oct 19, 2023
543c7cb
Merge branch 'slide-gestures' into threshold-acceleration
sslater11 Oct 19, 2023
7350ea7
Merge pull request #2 from WadeWT/threshold-acceleration
sslater11 Oct 19, 2023
ccb67be
Added slide gestures Threshold Acceleration to the settings menu.
sslater11 Oct 19, 2023
e20636f
Merged with upstream/main
sslater11 Oct 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 40 additions & 1 deletion app/src/main/java/com/dessalines/thumbkey/db/AppDb.kt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ const val DEFAULT_KEY_BORDERS = 1
const val DEFAULT_SPACEBAR_MULTITAPS = 1
const val DEFAULT_SLIDE_SENSITIVITY = 9
const val DEFAULT_SLIDE_ENABLED = 0
const val DEFAULT_SLIDE_CURSOR_MOVEMENT_MODE = 0
const val DEFAULT_SLIDE_SPACEBAR_DEADZONE_ENABLED = 1
const val DEFAULT_SLIDE_BACKSPACE_DEADZONE_ENABLED = 1
const val DEFAULT_BACKDROP_ENABLED = 0
const val DEFAULT_KEY_PADDING = 0
const val DEFAULT_KEY_BORDER_WIDTH = 1
Expand Down Expand Up @@ -97,6 +100,21 @@ data class AppSettings(
defaultValue = DEFAULT_SLIDE_ENABLED.toString(),
)
val slideEnabled: Int,
@ColumnInfo(
name = "slide_cursor_movement_mode",
defaultValue = DEFAULT_SLIDE_CURSOR_MOVEMENT_MODE.toString(),
)
val slideCursorMovementMode: Int,
@ColumnInfo(
name = "slide_spacebar_deadzone_enabled",
defaultValue = DEFAULT_SLIDE_SPACEBAR_DEADZONE_ENABLED.toString(),
)
val slideSpacebarDeadzoneEnabled: Int,
@ColumnInfo(
name = "slide_backspace_deadzone_enabled",
defaultValue = DEFAULT_SLIDE_BACKSPACE_DEADZONE_ENABLED.toString(),
)
val slideBackspaceDeadzoneEnabled: Int,
@ColumnInfo(
name = "sound_on_tap",
defaultValue = DEFAULT_SOUND_ON_TAP.toString(),
Expand Down Expand Up @@ -273,6 +291,12 @@ data class BehaviorUpdate(
val slideSensitivity: Int,
@ColumnInfo(name = "slide_enabled")
val slideEnabled: Int,
@ColumnInfo(name = "slide_cursor_movement_mode")
val slideCursorMovementMode: Int,
@ColumnInfo(name = "slide_spacebar_deadzone_enabled")
val slideSpacebarDeadzoneEnabled: Int,
@ColumnInfo(name = "slide_backspace_deadzone_enabled")
val slideBackspaceDeadzoneEnabled: Int,
@ColumnInfo(name = "auto_capitalize")
val autoCapitalize: Int,
@ColumnInfo(name = "spacebar_multitaps")
Expand Down Expand Up @@ -462,8 +486,22 @@ val MIGRATION_11_12 = object : Migration(11, 12) {
}
}

val MIGRATION_12_13 = object : Migration(12, 13) {
override fun migrate(database: SupportSQLiteDatabase) {
database.execSQL(
"alter table AppSettings add column slide_spacebar_deadzone_enabled INTEGER NOT NULL default $DEFAULT_SLIDE_SPACEBAR_DEADZONE_ENABLED",
)
database.execSQL(
"alter table AppSettings add column slide_backspace_deadzone_enabled INTEGER NOT NULL default $DEFAULT_SLIDE_BACKSPACE_DEADZONE_ENABLED",
)
database.execSQL(
"alter table AppSettings add column slide_cursor_movement_mode INTEGER NOT NULL default $DEFAULT_SLIDE_CURSOR_MOVEMENT_MODE",
)
}
}

@Database(
version = 12,
version = 13,
entities = [AppSettings::class],
exportSchema = true,
)
Expand Down Expand Up @@ -498,6 +536,7 @@ abstract class AppDB : RoomDatabase() {
MIGRATION_9_10,
MIGRATION_10_11,
MIGRATION_11_12,
MIGRATION_12_13,
)
// Necessary because it can't insert data on creation
.addCallback(object : Callback() {
Expand Down
56 changes: 25 additions & 31 deletions app/src/main/java/com/dessalines/thumbkey/keyboards/CommonKeys.kt
Original file line number Diff line number Diff line change
Expand Up @@ -144,20 +144,12 @@ val BACKSPACE_KEY_ITEM =
slideType = SlideType.DELETE,
swipes = mapOf(
SwipeDirection.LEFT to KeyC(
action = KeyAction.DeleteLastWord,
action = KeyAction.DeleteWordBeforeCursor,
display = null,
),
SwipeDirection.RIGHT to KeyC(
action = KeyAction.SendEvent(
KeyEvent(
KeyEvent.ACTION_DOWN,
KeyEvent
.KEYCODE_FORWARD_DEL,
),
),
action = KeyAction.DeleteWordAfterCursor,
display = null,
color = ColorVariant.MUTED,
size = FontSizeVariant.SMALLEST,
),
),
backgroundColor = ColorVariant.SURFACE_VARIANT,
Expand All @@ -169,9 +161,27 @@ val SPACEBAR_KEY_ITEM =
display = KeyDisplay.TextDisplay(" "),
action = KeyAction.CommitText(" "),
),
swipeType = SwipeNWay.TWO_WAY_HORIZONTAL,
swipeType = SwipeNWay.FOUR_WAY_CROSS,
slideType = SlideType.MOVE_CURSOR,
swipes = mapOf(
SwipeDirection.TOP to KeyC(
action = KeyAction.SendEvent(
KeyEvent(
KeyEvent.ACTION_DOWN,
KeyEvent.KEYCODE_DPAD_UP,
),
),
display = null,
),
SwipeDirection.BOTTOM to KeyC(
action = KeyAction.SendEvent(
KeyEvent(
KeyEvent.ACTION_DOWN,
KeyEvent.KEYCODE_DPAD_DOWN,
),
),
display = null,
),
SwipeDirection.LEFT to KeyC(
action = KeyAction.SendEvent(
KeyEvent(
Expand Down Expand Up @@ -394,20 +404,12 @@ val BACKSPACE_TYPESPLIT_KEY_ITEM =
swipeType = SwipeNWay.FOUR_WAY_CROSS,
swipes = mapOf(
SwipeDirection.LEFT to KeyC(
action = KeyAction.DeleteLastWord,
action = KeyAction.DeleteWordBeforeCursor,
display = null,
),
SwipeDirection.RIGHT to KeyC(
action = KeyAction.SendEvent(
KeyEvent(
KeyEvent.ACTION_DOWN,
KeyEvent
.KEYCODE_FORWARD_DEL,
),
),
action = KeyAction.DeleteWordAfterCursor,
display = null,
color = ColorVariant.MUTED,
size = FontSizeVariant.SMALLEST,
),
SwipeDirection.TOP to KeyC(
display = KeyDisplay.IconDisplay(Icons.Outlined.ArrowDropUp),
Expand All @@ -421,20 +423,12 @@ val BACKSPACE_TYPESPLIT_KEY_ITEM =
val BACKSPACE_TYPESPLIT_SHIFTED_KEY_ITEM = BACKSPACE_TYPESPLIT_KEY_ITEM.copy(
swipes = mapOf(
SwipeDirection.LEFT to KeyC(
action = KeyAction.DeleteLastWord,
action = KeyAction.DeleteWordBeforeCursor,
display = null,
),
SwipeDirection.RIGHT to KeyC(
action = KeyAction.SendEvent(
KeyEvent(
KeyEvent.ACTION_DOWN,
KeyEvent
.KEYCODE_FORWARD_DEL,
),
),
action = KeyAction.DeleteWordAfterCursor,
display = null,
color = ColorVariant.MUTED,
size = FontSizeVariant.SMALLEST,
),
SwipeDirection.TOP to KeyC(
display = KeyDisplay.IconDisplay(Icons.Outlined.KeyboardCapslock),
Expand Down
24 changes: 6 additions & 18 deletions app/src/main/java/com/dessalines/thumbkey/keyboards/T9.kt
Original file line number Diff line number Diff line change
Expand Up @@ -371,14 +371,8 @@ val KB_T9_MAIN = KeyboardC(
color = ColorVariant.MUTED,
),
SwipeDirection.RIGHT to KeyC(
display = KeyDisplay.TextDisplay("⌦"),
action = KeyAction.SendEvent(
KeyEvent(
KeyEvent.ACTION_DOWN,
KeyEvent
.KEYCODE_FORWARD_DEL,
),
),
display = KeyDisplay.TextDisplay("⇥"),
action = KeyAction.DeleteWordAfterCursor,
color = ColorVariant.MUTED,
),
SwipeDirection.BOTTOM to KeyC(
Expand All @@ -388,7 +382,7 @@ val KB_T9_MAIN = KeyboardC(
),
SwipeDirection.LEFT to KeyC(
display = KeyDisplay.TextDisplay("⇤"),
action = KeyAction.DeleteLastWord,
action = KeyAction.DeleteWordBeforeCursor,
color = ColorVariant.MUTED,
),
),
Expand Down Expand Up @@ -924,14 +918,8 @@ val KB_T9_SHIFTED = KeyboardC(
color = ColorVariant.MUTED,
),
SwipeDirection.RIGHT to KeyC(
display = KeyDisplay.TextDisplay("⌦"),
action = KeyAction.SendEvent(
KeyEvent(
KeyEvent.ACTION_DOWN,
KeyEvent
.KEYCODE_FORWARD_DEL,
),
),
display = KeyDisplay.TextDisplay("⇥"),
action = KeyAction.DeleteWordAfterCursor,
color = ColorVariant.MUTED,
),
SwipeDirection.BOTTOM to KeyC(
Expand All @@ -941,7 +929,7 @@ val KB_T9_SHIFTED = KeyboardC(
),
SwipeDirection.LEFT to KeyC(
display = KeyDisplay.TextDisplay("⇤"),
action = KeyAction.DeleteLastWord,
action = KeyAction.DeleteWordBeforeCursor,
color = ColorVariant.MUTED,
),
),
Expand Down
Loading