Added in more broad strokes for clicking to match wheel. 's' is single, 'd' is double, 't' is triple, and no prefix will always take any amount of clicks.
This commit is contained in:
parent
7a3e8ed86a
commit
7babed1e6b
|
@ -93,9 +93,9 @@ local function keymap_macos(keymap)
|
||||||
["pageup"] = "doc:move-to-previous-page",
|
["pageup"] = "doc:move-to-previous-page",
|
||||||
["pagedown"] = "doc:move-to-next-page",
|
["pagedown"] = "doc:move-to-next-page",
|
||||||
|
|
||||||
["shift+lclick"] = "doc:select-to-cursor",
|
["shift+slclick"] = "doc:select-to-cursor",
|
||||||
["ctrl+lclick"] = "doc:split-cursor",
|
["ctrl+slclick"] = "doc:split-cursor",
|
||||||
["lclick"] = "doc:set-cursor",
|
["slclick"] = "doc:set-cursor",
|
||||||
["dlclick"] = "doc:set-cursor-word",
|
["dlclick"] = "doc:set-cursor-word",
|
||||||
["tlclick"] = "doc:set-cursor-line",
|
["tlclick"] = "doc:set-cursor-line",
|
||||||
["shift+left"] = "doc:select-to-previous-char",
|
["shift+left"] = "doc:select-to-previous-char",
|
||||||
|
|
|
@ -90,9 +90,10 @@ function keymap.on_mouse_wheel(delta, ...)
|
||||||
and keymap.on_key_pressed("wheel", delta, ...)
|
and keymap.on_key_pressed("wheel", delta, ...)
|
||||||
end
|
end
|
||||||
|
|
||||||
local click_prefixes = { "", "d", "t" }
|
local click_prefixes = { "s", "d", "t" }
|
||||||
function keymap.on_mouse_pressed(button, x, y, clicks)
|
function keymap.on_mouse_pressed(button, x, y, clicks)
|
||||||
return keymap.on_key_pressed(click_prefixes[((clicks - 1) % 3) + 1] .. button:sub(1,1) .. "click", x, y, clicks)
|
return not keymap.on_key_pressed(click_prefixes[((clicks - 1) % 3) + 1] .. button:sub(1,1) .. "click", x, y, clicks)
|
||||||
|
keymap.on_key_pressed(button:sub(1,1) .. "click", x, y, clicks)
|
||||||
end
|
end
|
||||||
|
|
||||||
function keymap.on_key_released(k)
|
function keymap.on_key_released(k)
|
||||||
|
@ -202,9 +203,9 @@ keymap.add_direct {
|
||||||
["pageup"] = "doc:move-to-previous-page",
|
["pageup"] = "doc:move-to-previous-page",
|
||||||
["pagedown"] = "doc:move-to-next-page",
|
["pagedown"] = "doc:move-to-next-page",
|
||||||
|
|
||||||
["shift+lclick"] = "doc:select-to-cursor",
|
["shift+slclick"] = "doc:select-to-cursor",
|
||||||
["ctrl+lclick"] = "doc:split-cursor",
|
["ctrl+slclick"] = "doc:split-cursor",
|
||||||
["lclick"] = "doc:set-cursor",
|
["slclick"] = "doc:set-cursor",
|
||||||
["dlclick"] = "doc:set-cursor-word",
|
["dlclick"] = "doc:set-cursor-word",
|
||||||
["tlclick"] = "doc:set-cursor-line",
|
["tlclick"] = "doc:set-cursor-line",
|
||||||
["shift+left"] = "doc:select-to-previous-char",
|
["shift+left"] = "doc:select-to-previous-char",
|
||||||
|
|
Loading…
Reference in New Issue