Kakoune: Change scroll speed?

Created on 4 Aug 2019  路  11Comments  路  Source: mawww/kakoune

Is it possible to change how many lines kakoune scrolls per mouse scroll event? I didn't find any related config option or issue mentioning something like this. Right now kakoune scrolls by three lines per scroll event.

Most helpful comment

That would be a good idea. "Number of lines to scroll per scroll-click" is generally a GUI toolkit setting (although it happens to be kind of a mess on Linux right now), so it definitely makes sense to leave it up to the UI.

All 11 comments

Currently this is hard-coded, see line 140 of src/input_handler.cc
(or just search in that file for Key::Modifiers::MouseWheelDown).

I can see that it makes sense to scroll three lines per mouse event when using an actual mouse wheel and a terminal that doesn't support a setting like this but I'm using a touch pad, not a mouse wheel. Currently kakoune scrolls three times as fast as all the other programs I'm using, which is a bit annoying. I also cannot control the scroll position to the exact line I may want by just using the touch pad.
Is there interest in changing the default value or making this configurable?

I think it makes sense to create a UI option for the amount of lines scrolled.

However, what behaviour do you suggest to handle accurate scrolling? Prevent scrolling when the mouse cursor is already hovering main selection?

The xterm mouse protocol just sends "mouse scroll up" and "mouse scroll down" events, corresponding to the clicks of a "clicky" mouse wheel, or the synthetic "clicky" events generated for smooth-scrolling input devices. So Kakoune doesn't have access to "smooth" events, and can't do anything about them.

I didn't mean to suggest any kind of "accurate" or "smooth" scrolling in a sense that that would somehow increase the resolution to better than one line. I was suggesting changing the hardcoded 3 and -3 to 1 and -1 (which is likely not going to happen) or to make these values configurable so I can change it to 1 in my config.

I guess it could make sense to make this configurable, however I think it would be good to have that as a UI-side option, as non-terminal UIs could want to handle smooth scrolling events "intelligently".

That means we should change to mouse wheel keys to more general "scroll " keys so that the UI can chose what to put in . Then add a 'ncurses_scroll_line_count' ui_option value.

How does that sound ?

That would be a good idea. "Number of lines to scroll per scroll-click" is generally a GUI toolkit setting (although it happens to be kind of a mess on Linux right now), so it definitely makes sense to leave it up to the UI.

A new UI option sounds good. I'm looking forward to this change 馃槃.

b1f5639d8 heh

I've been using this feature for a while now and it's working as expected. Thank you very much for implementing it!

No problem, you are welcome.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

valerdi picture valerdi  路  4Comments

a12l picture a12l  路  3Comments

radare picture radare  路  3Comments

vbauerster picture vbauerster  路  3Comments

lenormf picture lenormf  路  4Comments