mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-29 15:03:09 +00:00
27 lines
531 B
C++
27 lines
531 B
C++
|
|
/*
|
||
|
|
* SPDX-FileCopyrightText: 2022 Devin Lin <devin@kde.org>
|
||
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
||
|
|
*/
|
||
|
|
|
||
|
|
#include "haptics.h"
|
||
|
|
|
||
|
|
#include <QFeedbackHapticsEffect>
|
||
|
|
|
||
|
|
#include "mobileshellsettings.h"
|
||
|
|
|
||
|
|
Haptics *Haptics::self()
|
||
|
|
{
|
||
|
|
static Haptics *singleton = new Haptics();
|
||
|
|
return singleton;
|
||
|
|
}
|
||
|
|
|
||
|
|
void Haptics::buttonVibrate()
|
||
|
|
{
|
||
|
|
if (MobileShellSettings::self()->vibrationsEnabled()) {
|
||
|
|
QFeedbackHapticsEffect rumble;
|
||
|
|
rumble.setIntensity(0.5);
|
||
|
|
rumble.setDuration(100);
|
||
|
|
rumble.start();
|
||
|
|
}
|
||
|
|
}
|