mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
This is an initial port to feedbackd for the haptics plugin. This implementation is a simple port to have the motor enabled for a certain duration. We will eventually want to use feedbackd events to trigger these instead. Related MR for qtfeedback: https://invent.kde.org/jbbgameich/ktactilefeedback/-/merge_requests/2 https://invent.kde.org/teams/plasma-mobile/issues/-/issues/10
28 lines
558 B
C++
28 lines
558 B
C++
// SPDX-FileCopyrightText: 2023 Devin Lin <devin@kde.org>
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#pragma once
|
|
|
|
#include <QList>
|
|
#include <QObject>
|
|
#include <qqmlregistration.h>
|
|
|
|
#include "hapticinterface.h"
|
|
#include "vibrationevent.h"
|
|
|
|
#include <QCoroDBusPendingReply>
|
|
|
|
class VibrationManager : public QObject
|
|
{
|
|
Q_OBJECT
|
|
QML_ELEMENT
|
|
QML_SINGLETON
|
|
|
|
public:
|
|
VibrationManager(QObject *parent = nullptr);
|
|
|
|
Q_INVOKABLE QCoro::Task<void> vibrate(int durationMs);
|
|
|
|
private:
|
|
OrgSigxcpuFeedbackHapticInterface *m_interface{nullptr};
|
|
};
|