mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
We can control shell vibrations from here, which can be replaced once there is a mechanism to control system-wide vibrations for QtFeedback.
26 lines
531 B
C++
26 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();
|
|
}
|
|
}
|