New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add secondary action for zoomin #2956
base: master
Are you sure you want to change the base?
Conversation
I would normally whinge about screwing with peoples muscle memory if changing default keybindings, but the only two apps I have found that still use Also personally I don't use zoom so I don't care either way. |
I don't use zoom either, but have a few other PRs that affect zoom behavior. I also figure 4-6 years should be long enough to wait to fix an issue that has affected more than one person (#596 and #1712). |
No because Seriously, I understand the point and that the equal sign is easier to type than the plus on a US keyboard layout. Interestingly, on a German layout it's vice versa. Regardless, what I'm wondering about and what I don't understand is that the Gnome HIGs suggest Until this PR I wasn't aware of |
@eht16 Maybe Geany could accept both as well? Is there a way to have two keybindings for the same action, or would another action need to be added? |
That is what I was thinking about, to have both shortcuts by default and (probably) only one can be edited. I guess this is not possible right now but a second hard-coded keybinding can be added easily probably. The more relevant question is - do we want this or is switching to |
If German keyboards won't work with this, it's just trading one problem for another. (We'd be changing it to something else in six years.) I don't know how to program this, but maybe... if either |
I guess nobody else (chrome, firefox etc) read the Gnome HIG. Probably best not to add a hard coded action for any keybinding, some user is guaranteed to have a problem with it on an Elbonian keyboard [Dilbert reference]. Instead add a second keybinding action defaulting to |
Okay, I'll add a second zoom action (but not in the menu) and update this PR. |
3690f7c
to
24c9852
Compare
Why cut copy paste? All discussion has been about zoom. |
So I can assign both ctrl+c/v and ctrl+shift+c/v to copy/paste. Since I was adding a second keybinding for zoom, figured I might as well add cut/copy/paste. Now that I'm thinking about it... I really need three for paste... ctrl+u... because nano... |
Okay, three for paste would be too much... I'll remove cut/copy/paste and put them in a plugin... Should zoom out also have a second action or just zoom in? |
Keybindings are a linear search through the list, whilst adding each additional one is immaterial, if each one isn't actively challenged then they keep adding until keyboard operation becomes slow. Since nobody has complained about zoom out lets leave it out for now.
Geany isn't Nano, if a nanoist wants to change their keybinding thats fine, but its not up to Geany to provide equivalences for every editor out there, thats plugin territory, see |
Okay. Will remove it.
Yes. I already talked myself into putting it into a plugin. |
Just a note, every key goes through the search, and its actually keys that are not keybindings that take the longest since they search the whole list exhaustively. |
So each key pressed to type a sentence in the editor has to go through the keybinding search? Couldn't it be implemented as a jump table? So it would take constant time to locate the correct response? |
AFAICT yes.
There are 2^21 Unicode code points multiplied by 2^(the number of modifiers), so no. A hash table might possibly be a solution, just "somebody" has to do it and make sure all the special cases in this are covered. |
Keyboards don't create unicode code points. That's what the IME is for. Only keycodes that can actually be generated need to be checked. Most keyboards have fewer than 128 keys. The modifier keys could be checked separately. So you'd have a jump plus a few comparisons to find the right response. |
|
You are right, keyval is not always a code point, although often coincidentally the value happens to be the same 😄. But keyval does use at least 25 bits (see cyrillic or armenian in
Not true, some non-asian keyboards have up to 4 values per keycap, see French or probably @eht16's German keyboard. And also which values? As you can see in Thats why I suggest a hash table (or binary tree), key is combined Keyboards are a real pain, see also #1368 for another saga. |
Looks like it. Glad someone else is willing to manage it. |
Not tested, but looks good. |
2860587
to
fb454d0
Compare
Force push because confused branches/changes. |
fb454d0
to
8b6aa87
Compare
This PR adds secondary actions for zoomin so that a second keybinding can be assigned. This allows both
<primary>plus
and<primary>equal
to be used for zooming in, which potentially resolves #596 and #1712.