mirror of
https://github.com/anomalyco/hex.git
synced 2026-11-27 07:58:01 +01:00
| Filename | Latest commit message | Latest commit date |
|---|---|---|
Key haptics were silent on a Galaxy S23 (One UI 9, Hex Preview 2348) with the phone's vibration and Hex's Haptics switch on. Hex only asked Android for its stock effect (View.performHapticFeedback KEYBOARD_TAP / KEYBOARD_RELEASE, GESTURE_START / GESTURE_END), and One UI ties that effect to Samsung's own keyboard settings. Gboard and other keyboards drive the vibrator themselves. Changed: - New KeyHaptics.kt: tap() plays EFFECT_TICK (key press, key release, emoji pick, dictation end) or EFFECT_CLICK (dictation start) through VibratorManager.defaultVibrator when the vibrator reports the effect as supported, and a 12 ms (20 ms) one-shot at amplitude 80 otherwise. - Attributes: VibrationAttributes.USAGE_TOUCH on API 33+; before that, AudioAttributes USAGE_ASSISTANCE_SONIFICATION / CONTENT_TYPE_SONIFICATION, which Android maps to touch. Android decides when to drop the tick. - Hex's Haptics switch and the system Keyboard vibration switch (keyboard_vibration_enabled, kept) still gate every tick. - Manifest: android.permission.VIBRATE, nothing else. - README: the haptics line describes the tick and the settings that apply. Removed: every performHapticFeedback call (KeyCap press and release, KeyPlaneView emoji pick, KeyboardView dictation start/end). Only the direct path plays, so a press is one tick on every phone, never the stock effect plus ours. The press is now a tick rather than the stock click, and the release tick is the same tick (EFFECT_TEXTURE_TICK is hidden from apps). Behaviour change on Android 16: the stock keyboard effect used the hidden IME usage, which ignores Touch feedback; Hex's tick is touch usage, so Touch feedback off now silences Hex's keys. Verified: :app:testDebugUnitTest green, assembleDebug and assemblePreview green, aapt2 shows VIBRATE as the only new permission. On an Android 16 emulator (API 36), five taps per case, dumpsys vibrator_manager: - Haptics on: 5 USAGE_TOUCH Prebaked=TICK requests, finished (text field and password field); dev build: 5 USAGE_IME CLICK in both fields, so password fields behave as before (one tick per press). - Hex Haptics off: none. keyboard_vibration_enabled=0: none. - haptic_feedback_enabled=0: 5 requests, ignored_for_settings. - Do Not Disturb on (zen_mode 2): 5 finished, as the stock effect did. |
||
| .. | ||
| src | ||
| build.gradle.kts | ||
| proguard-rules.pro | ||