feat(keyboard): add haptic feedback on key press#639
feat(keyboard): add haptic feedback on key press#639prince-0408 wants to merge 2 commits intoscribe-org:mainfrom
Conversation
Thank you for the pull request! 💙🩵The Scribe-iOS team will do our best to address your contribution as soon as we can. The following are some important points:
Note Scribe uses Conventional Comments in reviews to make sure that communication is as clear as possible. |
Maintainer ChecklistThe following is a checklist for maintainers to make sure this process goes as well as possible. Feel free to address the points below yourself in further commits if you realize that actions are needed :) |
|
Did you also include a menu option to turn this off, @prince-0408? Should also be off by default I would say, as I don't think that it's on by default for the system keyboards. This option should be within the keyboard sub-settings pages, not the main app settings page. I'm not sure if there's a Scribe-i18n entry for this now, so I could add that for you and for now you can hard code the strings for the option. |
|
Appreciate the feedback, @andrewtavis! I completely agree, and yes, it should be off by default and user-controlled. I'll add a toggle in the keyboard sub-settings page, along with the other sub-settings, and wire it up to only send haptics if the user has enabled the feature. I'll hard code the strings for now until the i18n entry is added. Will push an update to this PR shortly! |
…cribe-org#638 - Add hapticFeedback case to UserInteractiveState enum - Add 'Haptic feedback' toggle to Functionality section in languageSettingsData (keyboard sub-settings page, not main settings) - Handle save/load of langCode+HapticFeedback UserDefaults key in InfoChildTableViewCell (switchDidChange + fetchSwitchStateForCell) - Add hapticFeedbackIsEnabled() in KeyboardViewController reading from shared UserDefaults container - Guard haptic block behind hapticFeedbackIsEnabled() — off by default - Strings hard-coded for now pending Scribe-i18n entry
93e8d33 to
e4f939a
Compare
|
Hey @andrewtavis, done! Here's what was added:
Let me know if anything needs adjusting! |
Summary
Adds tactile feedback to all Scribe keyboard key presses using Apple's native
UIImpactFeedbackGenerator. This is one of the most noticeable gaps compared to the system keyboard and other third-party keyboards.Closes #638
Changes
KeyboardViewController.swiftkeyTouchDownHaptic Intensity Map
delete,hideKeyboardshift,return,space,ABC,123,#+=,.?123,selectKeyboard,capsLock,indent,Translate,Conjugate,Plural, autocomplete / emoji / annotation / nav keysNotes
UIImpactFeedbackGeneratoris Apple-native — no new dependencies