| 1 | import QtQuick |
| 2 | import QtQuick.Layouts |
| 3 | |
| 4 | // Settings app > Input: keyboard, mouse, touchpad, cursor, through HyprConf (live + persisted). |
| 5 | Flickable { |
| 6 | id: flick |
| 7 | clip: true |
| 8 | contentWidth: width |
| 9 | contentHeight: col.implicitHeight |
| 10 | boundsBehavior: Flickable.StopAtBounds |
| 11 | |
| 12 | Component.onCompleted: HyprConf.refresh() |
| 13 | function v(o, d) { var x = HyprConf.values[o]; return x === undefined ? d : x } |
| 14 | |
| 15 | ColumnLayout { |
| 16 | id: col |
| 17 | width: flick.width |
| 18 | spacing: 8 |
| 19 | |
| 20 | Text { |
| 21 | Layout.fillWidth: true |
| 22 | Layout.leftMargin: 18 |
| 23 | visible: HyprConf.message !== "" |
| 24 | text: HyprConf.message |
| 25 | color: Theme.err |
| 26 | wrapMode: Text.WordWrap |
| 27 | font.family: Theme.ui |
| 28 | font.pixelSize: 14 |
| 29 | } |
| 30 | |
| 31 | SectionLabel { text: "keyboard" } |
| 32 | Field { label: "layouts"; placeholder: "us,de"; value: flick.v("input:kb_layout", ""); onSubmitted: x => HyprConf.set("input:kb_layout", x) } |
| 33 | Field { label: "variants"; placeholder: "(none)"; value: flick.v("input:kb_variant", ""); onSubmitted: x => HyprConf.set("input:kb_variant", x) } |
| 34 | Field { label: "xkb options"; placeholder: "grp:alt_shift_toggle"; value: flick.v("input:kb_options", ""); onSubmitted: x => HyprConf.set("input:kb_options", x) } |
| 35 | Knob { label: "repeat rate"; unit: "/s"; from: 10; to: 100; value: flick.v("input:repeat_rate", 25); onMoved: x => HyprConf.set("input:repeat_rate", x) } |
| 36 | Knob { label: "repeat delay"; unit: "ms"; from: 150; to: 1000; value: flick.v("input:repeat_delay", 600); onMoved: x => HyprConf.set("input:repeat_delay", Math.round(x / 10) * 10) } |
| 37 | |
| 38 | SectionLabel { text: "mouse" } |
| 39 | Knob { label: "sensitivity"; from: -1; to: 1; decimals: 2; value: flick.v("input:sensitivity", 0); onMoved: x => HyprConf.set("input:sensitivity", x) } |
| 40 | Choice { |
| 41 | label: "acceleration" |
| 42 | options: [{ value: "", label: "default" }, { value: "flat", label: "flat" }, { value: "adaptive", label: "adaptive" }] |
| 43 | value: flick.v("input:accel_profile", "") |
| 44 | onPicked: x => HyprConf.set("input:accel_profile", x) |
| 45 | } |
| 46 | Choice { |
| 47 | label: "focus follows mouse" |
| 48 | options: [{ value: 0, label: "off" }, { value: 1, label: "always" }, { value: 2, label: "loose" }, { value: 3, label: "hover only" }] |
| 49 | value: flick.v("input:follow_mouse", -1) |
| 50 | onPicked: x => HyprConf.set("input:follow_mouse", x) |
| 51 | } |
| 52 | Switch { label: "natural scroll"; checked: flick.v("input:natural_scroll", false); onToggled: on => HyprConf.set("input:natural_scroll", on) } |
| 53 | Switch { label: "left handed"; checked: flick.v("input:left_handed", false); onToggled: on => HyprConf.set("input:left_handed", on) } |
| 54 | |
| 55 | SectionLabel { text: "touchpad" } |
| 56 | Switch { label: "natural scroll"; checked: flick.v("input:touchpad:natural_scroll", false); onToggled: on => HyprConf.set("input:touchpad:natural_scroll", on) } |
| 57 | Switch { label: "tap to click"; checked: flick.v("input:touchpad:tap_to_click", false); onToggled: on => HyprConf.set("input:touchpad:tap_to_click", on) } |
| 58 | Switch { label: "disable while typing"; checked: flick.v("input:touchpad:disable_while_typing", false); onToggled: on => HyprConf.set("input:touchpad:disable_while_typing", on) } |
| 59 | Knob { label: "scroll speed"; from: 0.1; to: 3; decimals: 2; value: flick.v("input:touchpad:scroll_factor", 1); onMoved: x => HyprConf.set("input:touchpad:scroll_factor", x) } |
| 60 | |
| 61 | SectionLabel { text: "gestures" } |
| 62 | Switch { label: "invert swipe"; hint: "reverse the 3-finger workspace swipe"; checked: flick.v("gestures:workspace_swipe_invert", true); onToggled: on => HyprConf.set("gestures:workspace_swipe_invert", on) } |
| 63 | Knob { label: "swipe distance"; unit: "px"; from: 100; to: 1000; value: flick.v("gestures:workspace_swipe_distance", 300); onMoved: x => HyprConf.set("gestures:workspace_swipe_distance", Math.round(x / 10) * 10) } |
| 64 | |
| 65 | SectionLabel { text: "cursor" } |
| 66 | Knob { label: "hide when idle"; unit: "s"; from: 0; to: 30; value: flick.v("cursor:inactive_timeout", 0); onMoved: x => HyprConf.set("cursor:inactive_timeout", x) } |
| 67 | Switch { label: "hide while typing"; checked: flick.v("cursor:hide_on_key_press", false); onToggled: on => HyprConf.set("cursor:hide_on_key_press", on) } |
| 68 | |
| 69 | Item { Layout.preferredHeight: 6 } |
| 70 | RowLayout { |
| 71 | Layout.fillWidth: true |
| 72 | Text { |
| 73 | Layout.fillWidth: true |
| 74 | Layout.leftMargin: 18 |
| 75 | text: "per-device settings (hl.device) stay in source/input.lua" |
| 76 | elide: Text.ElideRight |
| 77 | color: Theme.dim |
| 78 | font.family: Theme.ui |
| 79 | font.pixelSize: 13 |
| 80 | } |
| 81 | IconBtn { icon: Theme.iRefresh; label: "reset to config"; onClicked: HyprConf.resetAll(["input:", "cursor:", "gestures:"]) } |
| 82 | } |
| 83 | } |
| 84 | } |