-
Notifications
You must be signed in to change notification settings - Fork 14
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
Re: Insane numbers of combos for fixing numpad nav and media arrows #49
Comments
I just did the Fn+arrow key fix in AHK for the Windows version of Kinto, because that is still an issue in Windows. But I didn't have to replicate the GTK Numpad nav keys fix since that isn't an issue in Windows (or KDE either). Although with GUI Linux apps coming to Windows with WSL2, it may become an issue at some point. And of course the Windows version is half as long because I didn't have to compensate for the lack of Super key in terminals. |
I think you're probably about to tell me I should do a modmap. Perhaps a multipurpose modmap like the |
Looks like adding lines to Kinto's conditional modmaps works (haven't tried a multipurpose modmap), but of course there is a problem with remapping the keypad keys like this. It means the keypad can't be used as a numeric keypad anymore. The keys will act as nav keys at all times. Remapping the media functions is no big deal since the media functions are separate from the base arrow key functionality. So the remap is only invoked on the keys while using Fn. That seems to work great. Now the question is how to do it in AHK.
In order to make this work without breaking keypad number entry, there would need to be alternate labels in |
How is this related to the numlock issue? |
Unless I'm mistaken, the keypad keys only have one name in the key list. KP1, KP2, KP3, and so on. With the arrow keys, the Fn key makes the key emit a different key code, so it's like they are actually different physical keys. I can remap just the media functions that only appear in combination with the Fn key, as shown. The remap doesn't affect the base arrow key functionality. But when I remap the KP* keys to their navigation counterparts, the keypad can no longer act as a numeric keypad, regardless of the Numlock status. It always acts like nav keys if I activate that remap. Except the 5 key, since it has no nav function. There is no KP_PAGE_UP, KP_HOME, etc. that can be remapped separately from the numeric function of the keys. |
You may have noticed that my PR about this has the "base key" lines all commented out. Because uncommenting those lines sacrifices the numeric keypad, turning it into only nav keys. So the keys are only remapped to "real" PgUp/PgDn/Home/End keys when used with a modifier key or combination of modifiers. And yes, that means I can't use the keypad keys as PgUp/PgDn/Home/End in GTK apps as long as these base key lines are commented out. GTK just completely ignores them. Their key codes are different from "real" PgUp/PgDn/Home/End keys.
|
And it would need to work for just the key alone. Which, as far as I can tell, means that the specific Numlock OFF function of each keypad key needs to have its own name that can be referred to directly.
|
This is interesting. I will have to go back to an older version of Ubuntu or something to verify this, but it appears that newer GNOME apps in the GNOME 42+ era, presumably all finally using GTK4, don't have the issue anymore of ignoring the Numpad nav keys. If that applies to everything ported to or newly built in GTK4, there's much less of a reason for my "fixes" for that particular issue. The migration seems to be happening fairly quickly. It was definitely still an issue back when I created the original PR. Hugely irritating since my keyboard had no "real" PgUp/PgDn/Home/End keys anywhere besides the keypad, and I couldn't test shortcuts like Ctrl+PgUp/PgDn. They just wouldn't work. I nearly went crazy before I realized everything worked fine with an external keyboard with the "real" nav keys. It was only the Numpad nav keys that weren't working as expected. At the time, I tested the issue and verified the issue with multiple external keyboards with Numpads, and with multiple computers running different distros with GTK apps. I just haven't bothered to redo those tests for several months, and it looks like things have changed significantly. |
I thought the problem was just that the software isn't taking into account the status, why is the following not all that is needed? modmap("numlock OFF", {
K("KP9"): K("Page_Up"),
K("KP3"): K("Page_Down"),
K("KP7"): K("Home"),
K("KP1"): K("End"),
K("KP8"): K("Up"),
K("KP2"): K("Down"),
K("KP4"): K("Left"),
K("KP6"): K("Right") },
when = numlock_off
) I assume you'd only need a single modmap to couter-act the "default" behavior... (whatever it is) So it's possible my above example is backwards. |
No, think that would do it. But we're still talking about a theoretical solution until [I] write the code to make the OK, well, I didn't think about it like that. Remapping the individual keys with Aside from being distracted by Would those And then, in another
Instead of:
Correct? So like with the remapped modifiers, if I want (physical) Alt+key to do something in Kinto, I have to remember that it's actually (logical) RC+key after the remap. Or, you'd need to include the Hope I have all that clear in my mind. I can confirm that at least one app that I know is still GTK3-based is still having this issue when my remaps are inactive. GNOME Terminal. They are replacing it with GNOME Console at some point, which is being created on GTK4. (Still in beta.) So any app that remains on GTK3 will always have this issue with the keypad nav keys. On any keyboard. And once again I'd need to go back to an older GNOME desktop install with more older GTK3 apps to be certain, but I think the actual heart of the issue was that they keypad nav keys wouldn't work as part of any combos, even as innocuous as Shift. As in, they would work as expected until I tried to pair them with any modifier key as a "shortcut". So I think the fact that I wasn't remapping the "base" keys on the keypad wasn't really a big problem. GNOME Terminal does something that seems to comply with the KP_Prior label when I hit the 9 key with Numlock OFF, rather than typing some odd sequence like I forgot how annoying it was to troubleshoot this in the first place. 😩 |
That's what modmaps do... they happen before any of the other processing and rewrite the keys entirely.. it's as if KP1 is now the END key and always has been...
Yes, after the modmap happens there is no more KP9... only page_up...
You may have lost me here.
The nice thing about being so low-level though is you can just run
Yes, but it's such a trivial feature. I'd focus on figuring that out rather than building 200 lines of complex mappings... |
I see now. So it's a "There is no Dana, only Zuuuuuul," type situation.
Sorry, bad assumptions. So there would not be a simple way to refer to the original key name anymore, in reference to its
At the time the most advanced thing I knew to look at was
Yes, well. The "complex" things are already done, and from my perspective they were merely tedious, rather than beyond my capacity to understand. But I can at least replace the "media arrows" stuff now with a simple optional (disabled by default) modmap, thanks to your prodding. I think I even have a line on how to do the same thing in AHK. So I can fix up the Windows PR with a much simpler version. I'll have to get back into Windows and test my new assumptions. Just to clear something up, if I wanted to leave the base function of say, the media arrow keys alone (i.e., retain the Fn+Play/Stop/Prev/Next), but remap those functions to PgUp/PgDn/Home/End only when used with at least one modifier key, could that be done with a currently available modmap |
Think I just replaced about a hundred lines of AHK shortcuts with seven lines. Found the right syntax that seems to produce a #If !WinActive("ahk_group remotes") && media_arrows_fix = 1
; Fix for media functions on laptop arrow keys
$Media_Play_Pause::PgUp
$Media_Stop::PgDn
$Media_Prev::Home
$Media_Next::End
#If As opposed to: $Media_Play_Pause::Send, {PgUp} Which would just work with the base key, not when adding modifiers. |
@joshgoebel
First posted in rbreaves/kinto#499
This is really something that is specific to the way Kinto currently remaps the modifier keys, plus the way GTK apps refuse to respect any Numpad nav keys, and then finally the Acer keyboard I have that places media functions on the Fn+arrow keys instead of PgUp/PgDn/Home/End. The PR for Linux is actually a combination of solutions for the two different problems I was having.
Now, one thing to understand is that all I've really done is remapped the shortcut combinations back to what they would have been had the user not been using Kinto. BUT, this is not necessarily correct. It just means that if those physical keys actually did something in Linux with Kinto disabled, they would continue to do whatever that is when Kinto is active. With the bonus that simple things like Shift+Numpad_PgUp actually works in GTK apps like a normal Shift+PgUp, and so on.
I'm interested in any ideas you have to consolidate this with some kind of generic "ignore" functionality that would cover all the combos. But with the shortcuts all laid out like this statically, someone can easily change just one of the specific remap groups to get their Numpad nav or media keys to do what they expect. If this was all lumped into some small algorithm, that would not be so easy.
Or, maybe you have some idea about a way to remap the base keys this is dealing with in such a way that all the individual remaps are no longer necessary. Get the Numpad nav keys to be recognized by everything regardless of any associated combo as the "real" nav keys you'd find on a full keyboard, between the QWERTY section and the Numpad.
Same with the arrow keys. If there could be a basic remap that just said, "Hey, these media functions are actually PgUp/PgDn/Home/End" that might solve the problem.
I hope we're on the same page with what the actual problem is that I'm solving by doing this. Funky GTK apps, and funky keyboards that don't put the right functions on the arrow keys. These remaps made both of those issues go away for me.
The text was updated successfully, but these errors were encountered: