Skip to content

Commit

Permalink
Allow command/control-click/wheel
Browse files Browse the repository at this point in the history
e.g. urxvt
  • Loading branch information
junegunn committed Mar 7, 2014
1 parent 27d3b52 commit bbf4567
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 5 additions & 5 deletions fzf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit bbf4567

Please sign in to comment.