@@ -67,6 +67,8 @@ abstract class BaseKeyboard(
67
67
68
68
private val vivoKeypressWorkaround by prefs.advanced.vivoKeypressWorkaround
69
69
70
+ private val hapticOnRepeat by prefs.keyboard.hapticOnRepeat
71
+
70
72
var popupActionListener: PopupActionListener ? = null
71
73
72
74
private val selectionSwipeThreshold = dp(10f )
@@ -162,7 +164,7 @@ abstract class BaseKeyboard(
162
164
swipeRepeatEnabled = true
163
165
swipeThresholdX = selectionSwipeThreshold
164
166
swipeThresholdY = disabledSwipeThreshold
165
- onGestureListener = OnGestureListener { _ , event ->
167
+ onGestureListener = OnGestureListener { view , event ->
166
168
when (event.type) {
167
169
GestureType .Move -> when (val count = event.countX) {
168
170
0 -> false
@@ -172,6 +174,7 @@ abstract class BaseKeyboard(
172
174
val action = KeyAction .SymAction (KeySym (sym), KeyStates .Empty )
173
175
repeat(count.absoluteValue) {
174
176
onAction(action)
177
+ if (hapticOnRepeat) InputFeedbacks .hapticFeedback(view)
175
178
}
176
179
true
177
180
}
@@ -184,12 +187,13 @@ abstract class BaseKeyboard(
184
187
swipeRepeatEnabled = true
185
188
swipeThresholdX = selectionSwipeThreshold
186
189
swipeThresholdY = disabledSwipeThreshold
187
- onGestureListener = OnGestureListener { _ , event ->
190
+ onGestureListener = OnGestureListener { view , event ->
188
191
when (event.type) {
189
192
GestureType .Move -> {
190
193
val count = event.countX
191
194
if (count != 0 ) {
192
195
onAction(KeyAction .MoveSelectionAction (count))
196
+ if (hapticOnRepeat) InputFeedbacks .hapticFeedback(view)
193
197
true
194
198
} else false
195
199
}
@@ -216,8 +220,9 @@ abstract class BaseKeyboard(
216
220
}
217
221
is KeyDef .Behavior .Repeat -> {
218
222
repeatEnabled = true
219
- onRepeatListener = { _ ->
223
+ onRepeatListener = { view ->
220
224
onAction(it.action)
225
+ if (hapticOnRepeat) InputFeedbacks .hapticFeedback(view)
221
226
}
222
227
}
223
228
is KeyDef .Behavior .Swipe -> {
0 commit comments