hydra icon indicating copy to clipboard operation
hydra copied to clipboard

how to keep the hydra open whilst scrolling the mouse

Open zcaudate opened this issue 5 years ago • 4 comments

I wanted to be able to keep the hydra open whilst moving around in the buffer so have defined the movement keys to the hydra. However, I'm not sure what to do with mouse keys.

I'd like to have mouse clicks and scrolling available so that browsing the buffer with the mouse is possible without affecting the hydra. How can i bind those keys to the hydra?

(defhydra+ e/menu-fn::git-menu ()
  ("<prior>" scroll-up-command)
  ("<next>" scroll-down-command)
  ("<up>" previous-line)
  ("<left>" left-char)
  ("<right>" right-char)
  ("<down>" next-line)
  ("C-<up>" previous-paragraph)
  ("C-<down>" next-paragraph)
  ;;(down-mouse-1 mouse-drag-region)
  ("<wheel-up>" e/scroll-down-one)
  ("<wheel-down>" e/scroll-up-one))

zcaudate avatar Dec 18 '20 18:12 zcaudate

okay... now I feel kind of stupid. In this case, setting :exit nil :foreign-keys run to the hydra solves it.

zcaudate avatar Dec 18 '20 18:12 zcaudate

Actually, the :foreign-keys run setting works for all keys. I was hoping to restrict it to just the arrows and the mouse.

zcaudate avatar Dec 18 '20 19:12 zcaudate

A way might be to add those mouse keys to hydra-base-map before defining any hydrae

bestlem avatar Jun 19 '22 17:06 bestlem

@bestlem have you tried? does it work?

zcaudate avatar Jun 20 '22 00:06 zcaudate