Typing modifiers along with a remapped key in a layer not working as expected

Hi,

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:

  1. I mapped “Mod + T” to be “Ctrl + Tab”
  2. 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.
  3. 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):

  1. Map Base layer + “Tiny-key-on-bottom-right” to “Ctrl + Tab”
  2. 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? :face_with_raised_eyebrow:

Has anyone else seen this behavior? And if so, any fixes or workarounds?

Thanks :pray:

1 Like

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.

Hi László

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 :+1:

Take care
Nazmul

1 Like

Hi László

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.

Thoughts?
Thanks
Nazmul

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:

  1. Set the Mod scancode to Enter. Set the secondary role to Mod.

In the Mod layer:

  1. 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.

Thanks
Nazmul

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?

Thanks
Nazmul

Please share your configuration, and I’ll try to reproduce the issue.

Here’s my UserConfiguration.json file: uhk v2 user configuration for issue repro · GitHub

Thank you for trying to repro the issue :pray:

Hi László

I had another insight into reproducing the issue.

Open Vscode or Chrome. Open a few tabs.

  1. Press & Hold Shift
  2. Then Press & Hold Mod
  3. Then Press & Release “small right bottom key”

And nothing happens.

Hopefully this will help w/ the UserConfiguration.json file.

Thanks
Nazmul

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?

Thanks
Nazmul

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 :thinking:. Anyway, for now I have just remapped those functions to a separate layer.

Thanks
Nazmul

Seems to work just fine…