1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-08-01 19:18:28 -04:00

feat(settings): add Mouse & Touchpad settings tab for Niri (#2905)

* feat(settings): add Mouse & Trackpad settings tab

* style(settings): clarify touchpad natural scroll description

* chore(settings): update settings search index

* refactor(settings): unify Mouse & Trackpad terminology to Mouse & Touchpad

* feat(setup): deploy default dms/input.kdl on setup

* style(niri): restore include section comment in base config template

* refactor(niri): remove redundant input block from base config template

* refactor(niri): restore keyboard and non-mouse input config to base template

* feat(settings): add touchpad disable-on-external-mouse toggle

* feat(settings): add left-handed, scroll-factor and dwt options

* feat(settings): add middle-emulation, scroll-method, tap-and-drag and drag-lock options

* refactor(settings): re-order mouse and touchpad UI options logically
This commit is contained in:
Huỳnh Thiện Lộc
2026-07-23 00:28:40 +07:00
committed by GitHub
parent ce548cb29c
commit 75eac83b47
13 changed files with 665 additions and 26 deletions
+26
View File
@@ -184,6 +184,24 @@ Singleton {
property int mangoLayoutRadiusOverride: -1
property int mangoLayoutBorderSize: -1
property bool mangoTrackpadNaturalScrolling: true
property string mouseAccelProfile: "default"
property real mouseAccelSpeed: 0.0
property bool mouseLeftHanded: false
property bool mouseMiddleEmulation: false
property bool mouseNaturalScroll: false
property real mouseScrollFactor: 1.0
property string mouseScrollMethod: "default"
property string touchpadAccelProfile: "default"
property real touchpadAccelSpeed: 0.0
property bool touchpadDisableOnExternalMouse: false
property bool touchpadDisableWhileTyping: true
property bool touchpadDragLock: false
property bool touchpadMiddleEmulation: false
property bool touchpadNaturalScroll: true
property real touchpadScrollFactor: 1.0
property string touchpadScrollMethod: "default"
property bool touchpadTapAndDrag: true
property bool touchpadTapToClick: true
property int firstDayOfWeek: -1
property bool showWeekNumber: false
@@ -1479,6 +1497,13 @@ Singleton {
MangoService.generateLayoutConfig();
}
function updateCompositorInput() {
if (typeof CompositorService === "undefined")
return;
if (CompositorService.isNiri && typeof NiriService !== "undefined")
NiriService.generateNiriInputConfig();
}
function updateFrameCompositorLayout() {
// Generate before begin() so compositor readiness is already pending at transitionRequested
if (typeof CompositorService !== "undefined") {
@@ -1707,6 +1732,7 @@ Singleton {
"applyStoredTheme": applyStoredTheme,
"regenSystemThemes": regenSystemThemes,
"updateCompositorLayout": updateCompositorLayout,
"updateCompositorInput": updateCompositorInput,
"applyStoredIconTheme": applyStoredIconTheme,
"updateBarConfigs": updateBarConfigs,
"updateCompositorCursor": updateCompositorCursor,
@@ -38,6 +38,24 @@ var SPEC = {
mangoLayoutRadiusOverride: { def: -1, onChange: "updateCompositorLayout" },
mangoLayoutBorderSize: { def: -1, onChange: "updateCompositorLayout" },
mangoTrackpadNaturalScrolling: { def: true, onChange: "updateCompositorCursor" },
mouseAccelProfile: { def: "default", onChange: "updateCompositorInput" },
mouseAccelSpeed: { def: 0.0, onChange: "updateCompositorInput" },
mouseLeftHanded: { def: false, onChange: "updateCompositorInput" },
mouseMiddleEmulation: { def: false, onChange: "updateCompositorInput" },
mouseNaturalScroll: { def: false, onChange: "updateCompositorInput" },
mouseScrollFactor: { def: 1.0, onChange: "updateCompositorInput" },
mouseScrollMethod: { def: "default", onChange: "updateCompositorInput" },
touchpadAccelProfile: { def: "default", onChange: "updateCompositorInput" },
touchpadAccelSpeed: { def: 0.0, onChange: "updateCompositorInput" },
touchpadDisableOnExternalMouse: { def: false, onChange: "updateCompositorInput" },
touchpadDisableWhileTyping: { def: true, onChange: "updateCompositorInput" },
touchpadDragLock: { def: false, onChange: "updateCompositorInput" },
touchpadMiddleEmulation: { def: false, onChange: "updateCompositorInput" },
touchpadNaturalScroll: { def: true, onChange: "updateCompositorInput" },
touchpadScrollFactor: { def: 1.0, onChange: "updateCompositorInput" },
touchpadScrollMethod: { def: "default", onChange: "updateCompositorInput" },
touchpadTapAndDrag: { def: true, onChange: "updateCompositorInput" },
touchpadTapToClick: { def: true, onChange: "updateCompositorInput" },
firstDayOfWeek: { def: -1 },
showWeekNumber: { def: false },