Skip to content
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

Tridactyl 'eats' the first keypress event for keys used in a bind after the bind is triggered #4958

Open
alanoliveira opened this issue Mar 30, 2024 · 1 comment
Labels

Comments

@alanoliveira
Copy link

Brief description of the problem:

If we create a bind for a key X on mode Y changing the mode to Z (bind --mode=Y X mode Z), the first time we press X on mode Z the keypress event is suppressed.

I found this issue when I tried to create a gi bind on the ruby on rails exception screen to focus the rails web-console.
As console is not a input field, but a span that listen to keypress events, I have to focus the element then change the mode to ignore.
When I started to type I noticed it was ignoring the first time I press g and i.

Steps to reproduce:

  1. add the following config
bind --mode=normal e mode ignore
js ['keydown', 'keypress', 'keyup'].forEach(evt => document.addEventListener(evt, (e) => console.log(e.type)))
  1. open the js console
  2. press e 3 times in normal mode

Expected behavior

  • 1 time: Tridactyl handles the map and nothing shows on console
  • 2 time: all events are logged
  • 3 time: all events are logged

Actual behavior

  • 1 time: Tridactyl handles the map and nothing shows on console
  • 2 time: the keypress event is not logged
  • 3 time: all events are logged

Environment

  • Tridactyl version: 1.24.0
  • Firefox version: 124.0.1 (64-bit)
@bovine3dom
Copy link
Member

This a great issue, thank you. It probably explains a whole number of bugs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants