Skip to content

Commit 91133d0

Browse files
committed
Add Keybind to configure scroll to pan view
Closes #3555
1 parent 9e276ee commit 91133d0

3 files changed

Lines changed: 7 additions & 1 deletion

File tree

js/interface/main_tools.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ BARS.defineActions(() => {
3333
category: 'navigate',
3434
keybind: new Keybind({key: 1001})
3535
})
36+
new KeybindItem('preview_scroll_pan', {
37+
description: 'keybind.preview_scroll_pan.desc',
38+
category: 'navigate',
39+
})
3640
new KeybindItem('uv_editor_scroll_zoom', {
3741
category: 'navigate',
3842
keybind: new Keybind({key: 1001, ctrl: true})

js/preview/OrbitControls.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ constructor ( object, preview ) {
699699
let keybind = Keybinds.extra.preview_scroll_zoom.keybind;
700700
let enabled = keybind.isTriggered(event);
701701

702-
if (!enabled && !event.ctrlKey && !event.shiftKey && !event.metaKey && Math.abs(event.deltaY) != 100) {
702+
if (!enabled && Keybinds.extra.preview_scroll_pan.keybind.isTriggered(event)) {
703703
pan( -event.deltaX, -event.deltaY );
704704

705705
scope.update();

lang/en.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1335,6 +1335,8 @@
13351335
"keybind.preview_drag": "Drag View",
13361336
"keybind.preview_zoom": "Drag-to-Zoom View",
13371337
"keybind.preview_scroll_zoom": "Zoom View",
1338+
"keybind.preview_scroll_pan": "Scroll Pan View",
1339+
"keybind.preview_scroll_pan.desc": "Use scroll to pan the view, can be used for two-finger panning with trackpads",
13381340
"keybind.uv_editor_scroll_zoom": "Zoom UV/2D Editor",
13391341
"keybind.preview_area_select": "Area Select",
13401342
"keybind.paint_secondary_color": "Paint with Secondary Color",

0 commit comments

Comments
 (0)