Skip to content

Commit e07223d

Browse files
committed
make autoscroll require holding shift by default
1 parent b98b14c commit e07223d

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

Loenn/consts/version.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
return require("utils.version_parser")("1.7.0")
1+
return require("utils.version_parser")("1.7.1")

Loenn/modules/nicer_mouse_pan/device.lua

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
local mods = require("mods")
22
local utils = require("utils")
3+
local keyboardHelper = require("utils.keyboard")
34
local configs = require("configs")
45
local viewportHandler = require("viewport_handler")
56
local drawing = require("utils.drawing")
@@ -38,6 +39,14 @@ local function wrap(s, ds, min, max, mode)
3839
return 0
3940
end
4041

42+
local function autoscroll_modifier_pressed()
43+
local mod = settings.autoscroll_modifier
44+
45+
if mod == "" then return true end
46+
47+
return keyboardHelper.modifierHeld(mod)
48+
end
49+
4150
---
4251

4352
function device.mouseclicked(x, y, button, istouched, presses)
@@ -48,7 +57,7 @@ function device.mouseclicked(x, y, button, istouched, presses)
4857
return true
4958
end
5059

51-
if button == autoscrollButton and presses == 1 then
60+
if button == autoscrollButton and presses == 1 and autoscroll_modifier_pressed() then
5261
autoscroll_mode = "click"
5362
autoscrollX, autoscrollY = x, y
5463
return true
@@ -61,7 +70,7 @@ function device.mousedragmoved(x, y, dx, dy, button, istouch)
6170
local autoscrollButton = settings.autoscroll_button
6271
local viewport = viewportHandler.viewport
6372

64-
if button == autoscrollButton then
73+
if button == autoscrollButton and (autoscroll_mode or autoscroll_modifier_pressed()) then
6574
if not autoscroll_mode then
6675
autoscroll_mode = "drag"
6776
autoscrollX, autoscrollY = x, y

Loenn/modules/nicer_mouse_pan/settings.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ handler.defaults = {
1212
wrap_margin = 25,
1313
enable_autoscroll = true,
1414
autoscroll_button = 3,
15+
autoscroll_modifier = "shift",
1516
autoscroll_speed = 20,
1617
autoscroll_power = 1.3,
1718
autoscroll_widget_radius = 15,
@@ -69,7 +70,7 @@ function handler.load(settings)
6970
settings.nicer_mouse_pan[k] = v
7071
end
7172

72-
handler[k] = settings.nicer_mouse_pan[k]
73+
handler[k] = v
7374
end
7475

7576
return settings.nicer_mouse_pan._enabled

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This plugin adds:
88
- a tool to **teleport the player** using Everest's DebugRC interface
99
- a **coordinate viewer** (<kbd>`</kbd> by default)
1010
- the ability to **wrap the mouse around the screen when panning**
11-
- **autoscrolling** (middle mouse by default)
11+
- **autoscrolling** (shift + middle mouse by default)
1212
- scripts (for use with [Lönn Scripts](https://gamebanana.com/tools/8050)) to:
1313
- **copy and paste stylegrounds** using the clipboard, so you can move them between maps, edit them in a text editor, or send them to others;
1414
- **convert fillers into filler rooms**, for easier editing

0 commit comments

Comments
 (0)