Merge lp:~bfiller/ubuntu-keyboard/haptic-feedback into lp:ubuntu-keyboard

Proposed by Bill Filler
Status: Merged
Merged at revision: 159
Proposed branch: lp:~bfiller/ubuntu-keyboard/haptic-feedback
Merge into: lp:ubuntu-keyboard
Diff against target: 52 lines (+15/-3)
2 files modified
qml/KeyboardContainer.qml (+11/-0)
qml/keys/CharKey.qml (+4/-3)
To merge this branch: bzr merge lp:~bfiller/ubuntu-keyboard/haptic-feedback
Reviewer Review Type Date Requested Status
Ubuntu Phablet Team Pending
Review via email: mp+209127@code.launchpad.net

Commit message

initial support for haptic feedback

Description of the change

initial support for haptic feedback

To post a comment you must log in.
Revision history for this message
Bill Filler (bfiller) wrote :

this works, but will give haptic feedback instead of audio feedback if the audio feedback setting is turned on.

TODO:
- make haptic feedback it's own setting
- make haptic/audio mutually exclusive
- add haptic setting switch to settings panel.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'qml/KeyboardContainer.qml'
--- qml/KeyboardContainer.qml 2014-01-20 00:09:37 +0000
+++ qml/KeyboardContainer.qml 2014-03-03 20:14:14 +0000
@@ -20,6 +20,7 @@
20import "languages/"20import "languages/"
21import "keys/"21import "keys/"
22import UbuntuKeyboard 1.022import UbuntuKeyboard 1.0
23import QtFeedback 5.0
2324
24Item {25Item {
25 id: panel26 id: panel
@@ -57,6 +58,16 @@
57 source: Qt.resolvedUrl("styles/ubuntu/sounds/key_tick2_quiet.wav")58 source: Qt.resolvedUrl("styles/ubuntu/sounds/key_tick2_quiet.wav")
58 }59 }
5960
61 HapticsEffect {
62 id: pressEffect
63 attackIntensity: 0.0
64 attackTime: 125
65 intensity: 0.5
66 duration: 75
67 fadeTime: 125
68 fadeIntensity: 0.0
69 }
70
60 states: [71 states: [
61 State {72 State {
62 name: "CHARACTERS"73 name: "CHARACTERS"
6374
=== modified file 'qml/keys/CharKey.qml'
--- qml/keys/CharKey.qml 2013-11-15 12:31:04 +0000
+++ qml/keys/CharKey.qml 2014-03-03 20:14:14 +0000
@@ -137,9 +137,6 @@
137137
138 onReleased: {138 onReleased: {
139 if (!extendedKeysShown) {139 if (!extendedKeysShown) {
140 if (maliit_input_method.useAudioFeedback)
141 audioFeedback.play();
142
143 event_handler.onKeyReleased(valueToSubmit, action);140 event_handler.onKeyReleased(valueToSubmit, action);
144 if (!skipAutoCaps)141 if (!skipAutoCaps)
145 if (panel.activeKeypadState === "SHIFTED" && panel.state === "CHARACTERS")142 if (panel.activeKeypadState === "SHIFTED" && panel.state === "CHARACTERS")
@@ -148,6 +145,10 @@
148 }145 }
149 onPressed: {146 onPressed: {
150 event_handler.onKeyPressed(valueToSubmit, action);147 event_handler.onKeyPressed(valueToSubmit, action);
148 // TODO, add a setting for haptic feedback
149 if (maliit_input_method.useAudioFeedback)
150 pressEffect.start()
151 //audioFeedback.play();
151 }152 }
152 }153 }
153154

Subscribers

People subscribed via source and target branches