From 251eb51ce9f4690ad8895dc05f578539fc3b9f19 Mon Sep 17 00:00:00 2001 From: Bernd Wachter Date: Fri, 23 Aug 2013 19:31:40 +0300 Subject: [PATCH] [haptics] Add haptic feedback on key presses --- fingerterm.pro | 2 +- rpm/fingerterm.spec | 1 + util.cpp | 16 ++++------------ 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/fingerterm.pro b/fingerterm.pro index 76938dc..789bcf5 100644 --- a/fingerterm.pro +++ b/fingerterm.pro @@ -1,4 +1,4 @@ -QT = core gui qml quick dbus +QT = core gui qml quick dbus feedback contains(MEEGO_EDITION,harmattan): { CONFIG += meegotouch diff --git a/rpm/fingerterm.spec b/rpm/fingerterm.spec index a69f51e..2f5bf81 100644 --- a/rpm/fingerterm.spec +++ b/rpm/fingerterm.spec @@ -11,6 +11,7 @@ BuildRequires: pkgconfig(Qt5DBus) BuildRequires: pkgconfig(Qt5Gui) BuildRequires: pkgconfig(Qt5Qml) BuildRequires: pkgconfig(Qt5Quick) +BuildRequires: pkgconfig(Qt0Feedback) Requires: qt5-qtdeclarative-import-xmllistmodel Requires: qt5-qtdeclarative-import-window2 Requires: qt-components-qt5 diff --git a/util.cpp b/util.cpp index ff188a3..8ed7cc0 100644 --- a/util.cpp +++ b/util.cpp @@ -32,12 +32,7 @@ #include "textrender.h" #include "version.h" -#ifdef MEEGO_EDITION_HARMATTAN -#include -#include -#include -#include -#endif //MEEGO_EDITION_HARMATTAN +#include Util::Util(QSettings *settings, QObject *parent) : QObject(parent), @@ -212,9 +207,7 @@ void Util::keyPressFeedback() if( !settingsValue("ui/keyPressFeedback").toBool() ) return; -#ifdef MEEGO_EDITION_HARMATTAN - MFeedback::play("priority2_static_press"); -#endif + QFeedbackEffect::playThemeEffect(QFeedbackEffect::PressWeak); } void Util::keyReleaseFeedback() @@ -222,9 +215,8 @@ void Util::keyReleaseFeedback() if( !settingsValue("ui/keyPressFeedback").toBool() ) return; -#ifdef MEEGO_EDITION_HARMATTAN - MFeedback::play("priority2_static_release"); -#endif + // TODO: check what's more comfortable, only press, or press and release + QFeedbackEffect::playThemeEffect(QFeedbackEffect::ReleaseWeak); } void Util::bellAlert()