Allow command/control-click/wheel

e.g. urxvt
This commit is contained in:
Junegunn Choi 2014-03-07 17:30:44 +09:00
parent 27d3b52843
commit bbf4567dd8
2 changed files with 8 additions and 7 deletions

View File

@ -102,8 +102,9 @@ The following readline key bindings should also work as expected.
If you enable multi-select mode with `-m` option, you can select multiple items
with TAB or Shift-TAB key.
You can also use mouse. Double-click on an item to select it or shift-click to
select multiple items. Use mouse wheel to move the cursor up and down.
You can also use mouse. Double-click on an item to select it or shift-click (or
ctrl-click) to select multiple items. Use mouse wheel to move the cursor up and
down.
### Extended-search mode

10
fzf
View File

@ -7,7 +7,7 @@
# / __/ / /_/ __/
# /_/ /___/_/ Fuzzy finder for your shell
#
# Version: 0.8.0 (March 6, 2014)
# Version: 0.8.0 (March 7, 2014)
#
# Author: Junegunn Choi
# URL: https://github.com/junegunn/fzf
@ -754,14 +754,14 @@ class FZF
def get_mouse
case ord = read_nb
when 32, 36, # mouse-down / shift-mouse-down
35, 39 # mouse-up / shift-mouse-up
when 32, 36, 40, 48, # mouse-down / shift / cmd / ctrl
35, 39, 43, 51 # mouse-up / shift / cmd / ctrl
x = read_nb - 33
y = read_nb - 33
{ :event => (ord % 2 == 0 ? :click : :release),
:x => x, :y => y, :shift => ord >= 36 }
when 96, 100, # scroll-up / shift-scroll-up
97, 101 # scroll-down / shift-scroll-down
when 96, 100, 104, 112, # scroll-up / shift / cmd / ctrl
97, 101, 105, 113 # scroll-down / shift / cmd / ctrl
read_nb(2)
{ :event => :scroll, :diff => (ord % 2 == 0 ? -1 : 1), :shift => ord >= 100 }
else