Closed bobi32 closed 5 years ago
Can you please split the scroll stuff in a separate commit/pull request? This part is good I think
Wrt using X11 libs, I'm against, as I don't use X so that most likely won't work here.
Doesn't libxkbcommon provide something like that?
I just realized I let an unused include to libX11 in germinal.c
, it might have confused you but the PR only makes use of GDK functions, as is.
BTW I opened another PR as requested.
Rebased and squashed, thanks !
Will probably cut a new release soon
You’re welcome, and thanks to you!
By the way, you may want to update README.md accordingly ;)
It is now possible to:
zoom in with
<Ctrl><Scroll up>
zoom out with
<Ctrl><Scroll down>
if the numeric line
<0>
is input with<Shift modifier>
, reset zoom with<Ctrl><0>
in addition to current<Ctrl><Shift><0>
, very much like most web browsers do. This is done by— given that the<Shift>
modifier of a keypress is not set— computing the keypress value if the modifier were set in order to check it. I see two alternatives to this behavior, investigated in the two first commits of this PR:testing the
event->hardware_keycode
value; this, however, depends on the translation from keyboard scancodes to X keycodes, and checkinggrep -r AE10 /usr/share/X11/xkb/keycodes/*
reveals that the keycode for the very key we want to check may vary a lot, thus is not reliable at all;computing the keyboard scancode back from the X keycode; however this seems to be only doable by adding and making use of the X11 library, and the computation involved may not be negligible.
As a side effect, the PR also removes garbage being written to prompt when inadvertently using
<Ctrl><Scroll {up,down}>
.