kindaVim.docs icon indicating copy to clipboard operation
kindaVim.docs copied to clipboard

Dash switching to normal mode changes page

Open Husky22 opened this issue 2 years ago • 9 comments

At first thanks for making kindaVim! Its a really neat app!

But everytime I press esc to switch to normal mode in Dash.app it goes to the previous page in alphabetic order. I dont think that is intended. I have mapped my capslock key to esc - maybe that Information is useful.

Husky22 avatar Sep 20 '22 12:09 Husky22

i used Dash daily and it works fine here. caps lock mapped to escape also.

  1. does kV enter Normal Mode at all or just Dash goes to the previous page?
  2. any other tool that could take precedence running? Hammerspoon, BTT, Karabiner-Elements, etc.?

godbout avatar Sep 20 '22 12:09 godbout

https://user-images.githubusercontent.com/121373/191262143-ca26f19e-997b-4685-b202-6681f9682c4d.mp4

godbout avatar Sep 20 '22 12:09 godbout

Yes its possible for me to go into normal mode. While I was trying to capture a video for you I realized that somehow everytime I click escape a left button press gets triggered. Ill have a look into that. I am using Karabiner elements maybe the answer lies here! But thanks alot already for your quick response :)

Husky22 avatar Sep 20 '22 12:09 Husky22

Yes its possible for me to go into normal mode. While I was trying to capture a video for you I realized that somehow everytime I click escape a left button press gets triggered. Ill have a look into that. I am using Karabiner elements maybe the answer lies here! But thanks alot already for your quick response :)

my pleasure. yeah, probably best to get rid of the extra left click first. please reopen if at later stage you think this is still a kV issue. enjoy the ride.

godbout avatar Sep 20 '22 12:09 godbout

Ok it only happens when kV is active. Looking at my keypresses after kV turned off I couldnt see the left click anymore. I also updated to latest version (41)

Husky22 avatar Sep 20 '22 13:09 Husky22

kV doesn't generate any mouse click tho.

  1. have you tried quitting Karabiner-Elements?
  2. does it happen only with Dash?

there's zero code in kV that generates mouse click, so i would assume that it comes from some other automated tools?

godbout avatar Sep 20 '22 13:09 godbout

also:

  1. do you have any tool that remaps some key combinations to a left click?
  2. what's your macOS keyboard shortcut to go back to a previous page (especially in Dash)

godbout avatar Sep 20 '22 13:09 godbout

Sorry I wasnt being clear. It triggers a left arrow button click - not a mouse click. And it happens everywhere not just Dash. Even after quitting Karabiner Elements it is still happening. I checked and I dont see any tool that is doing remaps on a general basis. I am using a modified german keyboard layout but that doesnt trigger a left arrow click on esc. I also tested using a standard german keyboard layout and it still happens. In Dash my keyboard shortcut to go back is the left arrow.

Husky22 avatar Sep 20 '22 14:09 Husky22

Sorry I wasnt being clear. It triggers a left arrow button click - not a mouse click.

oh, a key press 😂️

In Dash my keyboard shortcut to go back is the left arrow.

ok, so that's one of the issue.

here's what's happening:

when you enter Normal Mode in Vim, the block cursor moves to the previous character. when a text field is not Accessible, kV generates a left key press instead to achieve the same effect. see below:

https://user-images.githubusercontent.com/121373/191287051-053b8f7f-23a5-431b-87e3-1309728cc7ef.mp4

kV detects whether a field is of a text type or not, and only generates a left key press if it's one, else it doesn't.

there's one type of field tho that can be both: WebViews. in Mail, the composer is a WebView. but in Safari, a page is a WebView too.

i think i've made an exception that if a WebView is in Safari, a left key shouldn't be generated. Dash is mostly a browser, and i'm pretty sure it's a WebView too. because there's no exception, kV generates a left key press. because your backward is map to a left key press, Dash goes back a page.

i'll check and confirm this, will keep you updated, and will fix. i've never noticed myself because sound is off on my laptop usually, so i never heard the "bip".

godbout avatar Sep 20 '22 14:09 godbout

i'll check and confirm this, will keep you updated, and will fix. i've never noticed myself because sound is off on my laptop usually, so i never heard the "bip".

confirmed. the exception is not specifically for Safari, it's for WebViews that are not web pages (where their AX URL starts with http). Dash WebViews return a dfile URL. so it's clear where the issue lies. just need to find a proper solution.

godbout avatar Sep 26 '22 07:09 godbout

should be ok now in kV42: https://github.com/godbout/kindaVim.docs/releases/tag/42

if all fine with you, let's close the issue. thanks!

godbout avatar Sep 30 '22 11:09 godbout

Perfect Thanks alot!

Husky22 avatar Oct 12 '22 16:10 Husky22