I am really grateful to have a UHK forum!
Here’s the use case for what I’m trying to do.
- I want to map Mod + T to open a new chrome tab, and
- Shift + Mod + T to undo a recently closed tab.
I have a uhk v2, and am having some issues implementing the above use case:
- I mapped “Mod + T” to be “Ctrl + Tab”
- I expected pressing “Shift” + “Mod + T” to perform: “Shift + Ctrl + Tab”. However, this isn’t what happens, and pressing this keyboard combo doesn’t do anything.
- I get the same behavior even if I do this in the Mouse layer or some layer other than Mod.
The strange thing is that something similar to this works sometimes when I do the following (on the base layer):
- Map Base layer + “Tiny-key-on-bottom-right” to “Ctrl + Tab”
- Pressing “Shift” + “Tiny-key-on-bottom-right” outputs “Shift + Ctrl + Tab” sometimes, and other times it doesn’t do anything.
Are there some restrictions to adding modifier keys to remapped keys on different layers that I’m not aware of? I thought that they would be composable?
Has anyone else seen this behavior? And if so, any fixes or workarounds?
Hi Nazmul, and welcome to the forum!
The UHK should compose modifiers as expected.
Do you have a Shift layer set up? If so, your UHK may activate the Shift layer when pressing Shift before Mod.
Are you running the latest 9.2.3 firmware?
If my comment doesn’t help, please share your configuration.
Thank you for the warm welcome! The forum is a great idea for UHK enthusiasts; thanks for setting it up.
I don’t have a Shift layer set up. Upgrading to the latest 9.2.3 firmware seems to have fixed it
One more update. The old behavior comes back intermittently. I think it is because my Mod key also serves as the Enter key. I think this is just confusing the keyboard about what I am intending to do. I haven’t tried it yet, but I think if I remove the Enter key function (when pressed) from the Mod key (when held down) then it might resolve this issue.
I am not 100% what your problem is. But when you can really pinpoint where it goes “wrong” I am pretty sure that a good solution can be found. I got some great tips in the thread Change wait time for secondary key/ role? which might give you also a good starting point to define the two functions of a key, so that it works for your use case.
Feel free to follow up with the exact steps to reproduce the issue, and please include your configuration, and I’ll look into it.
Thanks for looking into it László. Here are the repro steps.
In the base layer:
- Set the Mod scancode to Enter. Set the secondary role to Mod.
In the Mod layer:
- Set the “small right bottom key” scancode to LCtrl + Tab. Set secondary role to None.
Start Chrome or VScode.
- Open a few tabs.
- Press Mod + “small right button”. This should move through your tabs from left to right.
- Press Shift + Mod + “small right button”. This should move through your tabs from right to left.
In my case, this works sometimes and other times it does not.
The mentioned mappings work reliably for me, compose with Shift as expected, and I cannot reproduce this issue.
Do you possibly have a Shift layer? If so, when pressing Shift first, you may inadvertently switch to the Shift layer, interfering with this mapping.
Here’s a screenshot of Agent. It doesn’t look like I have a Shift layer.
Anything I can do explicitly to ensure this? Reset the keyboard & purge any Shift layers?
Please share your configuration, and I’ll try to reproduce the issue.
UserConfiguration.json file: uhk v2 user configuration for issue repro · GitHub
Thank you for trying to repro the issue
I had another insight into reproducing the issue.
Open Vscode or Chrome. Open a few tabs.
- Press & Hold Shift
- Then Press & Hold Mod
- Then Press & Release “small right bottom key”
And nothing happens.
Hopefully this will help w/ the UserConfiguration.json file.
I still can’t reproduce the issue using your configuration, Nazmul. I’ve tried it in Chrome and Visual Studio Code on Linux, and it works reliably for me.
Please try it on other computers; others are welcome to reproduce it, too.
Thanks for testing it László. I appreciate it.
I’ve found that on mine, on 2 different Linux computers the behavior is the same. If I start w/ the Shift key pressed, it doesn’t work. However, when I start w/ the Mod key pressed first, then press Shift and “small right bottom key”, it works. So I don’t know if that is a clue?
Strange because, for me, every combination works.
If anyone else can test Nazmul’s configuration, that’d be much appreciated.
That is strange. I have two UHK v2 keyboards that behave the same exact way. I have them both connected to linux computers (running Pop OS). Maybe there’s something in my linux configuration that might have an impact . Anyway, for now I have just remapped those functions to a separate layer.