vimium-c icon indicating copy to clipboard operation
vimium-c copied to clipboard

Ignore modifiers when in LinkHints mode

Open sommerper opened this issue 2 years ago • 7 comments

What command or commands

LinkHints

Would it be possible to ignore modifiers when in LinkHints mode? I admit I have an edge case because of my zmk keyboard with home row modifiers activated. But for the certain keys that also act as shift and control the modifier action is also considered even though it was released shortly before.

For example:

  1. I activate LinkHints mode and press e to go to a new page.
  2. Because ctrl is active while I hold e down and released shortly before I get the new page in a new window. What should have happened it that it should have opened the link in the current window.

I'm thinking the ctrl keyup and e keydown are too close together for Vimium to register?

image

So would it be possible to either add an option to ignore modifiers in LinkHints mode or maybe improve the timing recognition so this doesn't happen?

Browser and OS

  • Browser name: Chrome
  • OS name: Linux Vimium C [1.99.99], Google Chrome 114, Linux.

Thank you for a wonderful extension!

sommerper avatar Aug 04 '23 08:08 sommerper

Sorry I haven't got why there's a Ctrl key just before the e key.

As for how to respond on Ctrl/Shift/Alt keys in LinkHints mode, Vimium C has a different behavior from Vimium:

  1. In Vimium C, LinkHints only acts on "keydown" events of Ctrl/Shift/Alt keys
    1. for example, a Ctrl keydown event will change LinkHint's sub-mode; when the Ctrl key gets released, the new mode is still there
    1. while the original Vimium will revert such sub-mode changes on a next Ctrl keyup event

There's no parameter to change this behavior.

gdh1995 avatar Aug 05 '23 18:08 gdh1995

Ah, that's too bad because it forces me to go back to Vimium 🙁. But thanks for the explanation!

sommerper avatar Aug 14 '23 08:08 sommerper

Hello, as for #992 mentioned a similar issue, now I decide to add a parameter to make LinkHints ignore those modifier keys (on certain conditions).

BTW, why is there a Ctrl key released before e being pressed? And what did you mean by with home row modifiers activated?

gdh1995 avatar Aug 17 '23 15:08 gdh1995

It's nice of you to investigate the issue but I have to admit I'm in the minority with this...

The reason ctrl is pressed before e is because e acts as ctrl when held down.

If I press and hold e and then press s it will register ctrl + s.

If I press and release e it will register e. But while e is in the down state ctrl is registered and if nothing else is pressed it will release ctrl and register e.

It's hard to explain. This video does a decent job https://youtu.be/yiwUjLaebuw?t=199 or you can read more about it here: https://precondition.github.io/home-row-mods

It's a feature of programmable keyboards.

sommerper avatar Aug 17 '23 22:08 sommerper

ok,thank you for the detailed explanation.

Then, it seems LinkHints should ignore the ctrl key at all (the small time delta is hard to detect using the current architecture of Vimium C).

---Original--- From: @.> Date: Fri, Aug 18, 2023 06:47 AM To: @.>; Cc: "Dahan @.>;"State @.>; Subject: Re: [gdh1995/vimium-c] Ignore modifiers when in LinkHints mode (Issue#988)

It's nice of you to investigate the issue but I have to admit I'm in the minority with this...

The reason ctrl is pressed before e is because e acts as ctrl when held down.

If I press and hold e and then press s it will register ctrl + s.

If I press and release e it will register e. But while e is in the down state ctrl is registered and if nothing else is pressed it will release ctrl and register e.

It's hard to explain. This video does a decent job https://youtu.be/yiwUjLaebuw?t=199 or you can read more about it here: https://precondition.github.io/home-row-mods

It's a feature of programmable keyboards.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you modified the open/close state.Message ID: @.***>

gdh1995 avatar Aug 18 '23 01:08 gdh1995

Is there any other modifier key (alt/meta/shift) which may be mixed with a letter key?

---Original--- From: @.> Date: Fri, Aug 18, 2023 06:47 AM To: @.>; Cc: "Dahan @.>;"State @.>; Subject: Re: [gdh1995/vimium-c] Ignore modifiers when in LinkHints mode (Issue#988)

It's nice of you to investigate the issue but I have to admit I'm in the minority with this...

The reason ctrl is pressed before e is because e acts as ctrl when held down.

If I press and hold e and then press s it will register ctrl + s.

If I press and release e it will register e. But while e is in the down state ctrl is registered and if nothing else is pressed it will release ctrl and register e.

It's hard to explain. This video does a decent job https://youtu.be/yiwUjLaebuw?t=199 or you can read more about it here: https://precondition.github.io/home-row-mods

It's a feature of programmable keyboards.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you modified the open/close state.Message ID: @.***>

gdh1995 avatar Aug 18 '23 01:08 gdh1995

The modifiers that can be used for this are:

  • Left Shift
  • Right Shift
  • Left Control
  • Right Control
  • Left Alt
  • Right Alt
  • Left GUI (Windows / Command / Meta)
  • Right GUI (Windows / Command / Meta)

Shown here: https://zmk.dev/docs/codes/modifiers

sommerper avatar Aug 18 '23 07:08 sommerper