Open marcelpaulo opened 9 years ago
My gut instinct is that we're not detecting the keydown
event as [
because of the keyboard layout, and so google is catching it and focusing their input with it instead. Which keyboard layout are you using?
I'm using Portuguese (Brazil)
:
You nailed it ! Just to confirm, I tested this:
English (US)
and checked which key was generated when pressing ]
: it was \
Portuguese (Brazil)
goNext
to \\
]]
on the Google page, and the goNext
action was run@marcelpaulo: Could you go here, click in the bottom right frame, and let us know what keyboard events are generated (if any) when you type ]
?
Here they are @smblott-github:
Sorry, @marcelpaulo. Was ]]
mapped on the options page for that?
Edit: I'm guessing this has something to do with the logic here.
Here's the mapping on the options page, @smblott-github:
Thanks, @marcelpaulo. It does indeed look like it's this logic which is at fault. Changing my own keyboard layout to Portuguese, I get the same keydown
, keyup
events, with no keypress
. Hmm, not what can be done...
When this Chromium issue is resolved, we can stop using keypress
altogether, reliably get the key from keydown
and all this pain will go away.
Until then, we could hook up some mechanism that 'learns' which keydown
s corollate with which keypress
es as the user types in textboxes, but that's kinda clunky and unreliable. And it's hard to deal with users that regularly switch locales. I don't really like this idea, but it would fix things for some users.
[[
and]]
are activating insert mode:I tried mapping
goNext
togn
, for instance, and it doesn't activate insert mode.