mirror of
https://github.com/jellyfin/jellyfin-media-player.git
synced 2024-11-27 08:10:25 +00:00
Add a setting to disable the mouse, part of #46
This commit is contained in:
parent
e036fd413a
commit
e768dc55e0
@ -49,6 +49,10 @@
|
||||
"default": false,
|
||||
"hidden": true,
|
||||
"platforms": [ "oe_rpi" ]
|
||||
},
|
||||
{
|
||||
"value": "disablemouse",
|
||||
"default": false
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -21,6 +21,16 @@ bool MouseEventFilter::eventFilter(QObject* watched, QEvent* event)
|
||||
{
|
||||
SystemComponent& system = SystemComponent::Get();
|
||||
|
||||
// ignore mouse events if mouse is disabled
|
||||
if (SettingsComponent::Get().value(SETTINGS_SECTION_MAIN, "disablemouse").toBool() &&
|
||||
((event->type() == QEvent::MouseMove) ||
|
||||
(event->type() == QEvent::MouseButtonPress) ||
|
||||
(event->type() == QEvent::MouseButtonRelease) ||
|
||||
(event->type() == QEvent::MouseButtonDblClick)))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (event->type() == QEvent::KeyPress)
|
||||
{
|
||||
// In konvergo we intercept all keyboard events and translate them
|
||||
@ -83,7 +93,7 @@ KonvergoWindow::KonvergoWindow(QWindow* parent) : QQuickWindow(parent), m_debugL
|
||||
loadGeometry();
|
||||
|
||||
connect(SettingsComponent::Get().getSection(SETTINGS_SECTION_MAIN), &SettingsSection::valuesUpdated,
|
||||
this, &KonvergoWindow::updateFullscreenSetting);
|
||||
this, &KonvergoWindow::updateMainSectionSettings);
|
||||
|
||||
connect(this, &KonvergoWindow::visibilityChanged,
|
||||
this, &KonvergoWindow::onVisibilityChanged);
|
||||
@ -214,8 +224,14 @@ void KonvergoWindow::playerWindowVisible(bool visible)
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
void KonvergoWindow::updateFullscreenSetting(const QVariantMap& values)
|
||||
void KonvergoWindow::updateMainSectionSettings(const QVariantMap& values)
|
||||
{
|
||||
// update mouse visibility if needed
|
||||
if (values.find("disablemouse") != values.end())
|
||||
{
|
||||
SystemComponent::Get().setCursorVisibility(!SettingsComponent::Get().value(SETTINGS_SECTION_MAIN, "disablemouse").toBool());
|
||||
}
|
||||
|
||||
if (values.find("fullscreen") == values.end())
|
||||
return;
|
||||
|
||||
|
@ -56,7 +56,7 @@ private slots:
|
||||
void closingWindow();
|
||||
void enableVideoWindow();
|
||||
void onVisibilityChanged(QWindow::Visibility visibility);
|
||||
void updateFullscreenSetting(const QVariantMap& values);
|
||||
void updateMainSectionSettings(const QVariantMap& values);
|
||||
void updateFullscreenState();
|
||||
void onScreenCountChanged(int newCount);
|
||||
void handleHostCommand(QString hostCommand);
|
||||
|
Loading…
Reference in New Issue
Block a user