Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[haptics] Add haptic feedback on key presses
  • Loading branch information
Bernd Wachter committed Aug 23, 2013
1 parent 8b6faf6 commit 251eb51
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
2 changes: 1 addition & 1 deletion 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
Expand Down
1 change: 1 addition & 0 deletions rpm/fingerterm.spec
Expand Up @@ -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
Expand Down
16 changes: 4 additions & 12 deletions util.cpp
Expand Up @@ -32,12 +32,7 @@
#include "textrender.h"
#include "version.h"

#ifdef MEEGO_EDITION_HARMATTAN
#include <MFeedback>
#include <MComponentData>
#include <MNotification>
#include <MRemoteAction>
#endif //MEEGO_EDITION_HARMATTAN
#include <QFeedbackEffect>

Util::Util(QSettings *settings, QObject *parent) :
QObject(parent),
Expand Down Expand Up @@ -212,19 +207,16 @@ 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()
{
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()
Expand Down

0 comments on commit 251eb51

Please sign in to comment.