-
Notifications
You must be signed in to change notification settings - Fork 26
Add a new config setting to change the keys used to select labels #65
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
base: main
Are you sure you want to change the base?
Conversation
8647f46 to
25e2366
Compare
|
Update: I added a second bugfix to #63, so I've rebased these changes onto that as well. |
This fails tests because we still use the field now called key_data to store display data.
25e2366 to
33aa039
Compare
|
Rebased onto main again. |
|
I see what you're trying to accomplish. Whilst I don't have a use for it, it's not a bad idea. I think it would be easier to test and introduce less code if you were to just have two |
|
Wouldnt it make more sense to just introduce a "show_uppercase" option? |
|
Just going to uppercase does sound like a much easier idea, and I did consider it early on. I think I did it this way for two reasons. One is because the code accepts Unicode characters for the labels, and this way let me avoid having to figure out how multi-byte characters keys are handled here. And depending on how the Unicode support works (and what international keyboards people use), I can imagine cases where you actually might want to choose a different character (like ß, which is traditionally capitalized as SS). And re: @moverest, just having a second |
|
No worries. I also happen to have started a new job recently which means I'm not spending a lot of time on the project at the moment either. I will spend more time eventually. |
(My other two PRs are minor and probably-uncontroversial bug fixes. This one is a significant enhancement that includes some design decisions.)
I find that it's easier to read capital letters at a glance when using tile mode, so I want my labels to show capital letters. But if I set
mode_tile.label_symbols=ABCD..., I have to press shift to select a target.This PR introduces a second, optional configuration option for tiling and floating modes, which I named
keys. If it is empty, no behavior changes. If it is set, it must be the same length aslabel_symbols, and it represents the keys to listen for to select the corresponding symbols.So if
mode_tile.label_symbols=ABCDEandmode_tile.keys=abcde, the tile will display labels likeAA BA CA, but will listen for regular, lowercase keyboard keys.To achieve this result without interfering with UTF-8 symbols, I added a new field to
label_symbols_tthat represents the keys (and renamed.datato.symbols), and changed several of thelabel_symbol_*functions to refer explicitly to keys.One potential issue here is that I did not name static methods as nicely as I could have; two of the new helpers for setting up label symbols don't start with
label_symbol_.I'm not sure looking at the individual commits will be very helpful to understand these changes more than looking at the total diff. Maybe dc14caf would be useful, though. That's my initial implementation, without as many renames to confuse the diff. But several of the later commits swap the meaning/effect of the options/fields, so it doesn't really look like the final version.
(Also, note that the first commit here is the commit from #63.)