pixel / hexedit

View and edit files in hexadecimal or in ASCII
http://rigaux.org/hexedit.html
GNU General Public License v2.0
98 stars 41 forks source link

Scrolling with mouse wheel #16

Open xypron opened 7 years ago

xypron commented 7 years ago

Scrolling with the mouse wheel does not work properly.

You might look at vim option mouse=a to understand how it can be fixed.

Best regards

Heinrich Schuchardt

rsaxvc commented 7 years ago

I just tried, and it seems to work for me. What are your terminal settings?

Or, do you mean the text selection wrapping including offsets instead of just hex or instead of just ASCII?

xypron commented 7 years ago

@rsaxvc

I am using KDE on Debian Stretch. I have set Mouse wheel scroll by 5 lines.

Yet I need several ticks on the mouse wheel to move a single line in hexedit.

My expectation is that the cursor moves by 5 lines for every tick.

The same can be achieved in vim by setting mouse=a.

Best regards

Heinrich

rsaxvc commented 7 years ago

"mouse=a" I think that just turns on mouse support in vim for all modes, I don't think that it should adjust anything related to scroll speed, just turn it on.

"I have set Mouse wheel scroll by 5 lines." - KDE has had a scroll-wheel speed setting for ages, but it gets complicated when connecting X11 mice to console programs...

hexedit is not directly aware of scroll wheels, it only uses curses. Somewhere between KDE and curses there is some logic to convert the speed of scrolling into some discrete events, and that is probably not working correctly. Or, it's possible that getch() is returning a key event hexedit does not know how to handle.

"Yet I need several ticks on the mouse wheel to move a single line in hexedit."

I think this means KDE/YourTerminal/curses is sending KEY_UP and KEY_DOWN(or related) codes, just not enough of them. If you run this commit https://github.com/rsaxvc/hexedit/commit/9dd0521f180f4e061aeae04a03ded2e3fc9e3eea, it'll print out what hexedit is receiving from ncurses.

Another thought is that implementing support for ncurses KEY_MOUSE should also be doable, though we'll need to make sure it doesn't interfere with platforms without it, who will continue to send KEY_UP/KEY_DOWN.

genpfault commented 7 years ago

On my Logitech G100s going through Xorg's libinput driver (the default on Stretch, I think) and "3 lines" in the KDE config page I get a Key:258/Key:259 every one (occasionally) or two (mostly) wheel notches.

rsaxvc commented 7 years ago

What terminal emulators are you each using?

On Aug 7, 2017 8:33 PM, "Charles Huber" notifications@github.com wrote:

On my Logitech G100s going through Xorg's libinput driver (the default on Stretch, I think) and "3 lines" in the KDE config page I get a Key:258/ Key:259 every one (occasionally) or two (mostly) wheel notches.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pixel/hexedit/issues/16#issuecomment-320825032, or mute the thread https://github.com/notifications/unsubscribe-auth/AAVS4LpuC1KTCv47vlTuM30zGvifangbks5sV7sEgaJpZM4OEmRK .

genpfault commented 7 years ago

The Konsole that Debian Stretch ships:

Konsole Version 16.12.0 Using:

  • KDE Frameworks 5.28.0
  • Qt 5.7.1 (built against 5.7.1)
  • The xcb windowing system
xypron commented 7 years ago

Same for me: KDE Konsole 16.12.0 on Debian Stretch

-- System Information:
Debian Release: 9.1 
  APT prefers stable
  APT policy: (100, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: arm64, armhf

Kernel: Linux 4.9.0-3-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_US.UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_US.UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages konsole depends on: 
ii  kio                   5.28.0-2
ii  konsole-kpart         4:16.12.0-4
ii  libc6                 2.24-11+deb9u1
ii  libkf5completion5     5.28.0-1
ii  libkf5configcore5     5.28.0-2
ii  libkf5configgui5      5.28.0-2
ii  libkf5configwidgets5  5.28.0-2
ii  libkf5coreaddons5     5.28.0-2
ii  libkf5crash5          5.28.0-1
ii  libkf5dbusaddons5     5.28.0-1
ii  libkf5i18n5           5.28.0-2
ii  libkf5iconthemes5     5.28.0-2
ii  libkf5kiowidgets5     5.28.0-2
ii  libkf5notifyconfig5   5.28.0-1
ii  libkf5widgetsaddons5  5.28.0-3
ii  libkf5windowsystem5   5.28.0-2
ii  libkf5xmlgui5         5.28.0-1
ii  libqt5core5a          5.7.1+dfsg-3+b1
ii  libqt5gui5            5.7.1+dfsg-3+b1
ii  libqt5widgets5        5.7.1+dfsg-3+b1
ii  libstdc++6            6.3.0-18