godbout / Scrolla.docs

Scroll with Vim motions under macOS
64 stars 0 forks source link

Feature request: use H/L or J/K to move between scrollable areas #24

Open zmre opened 1 month ago

zmre commented 1 month ago

I'd rather use my home row to move between scrollable areas than tab and shift-tab. I expect h/l probably work for horizontal scrolling (rarely a need for me) so am suggesting capital J/K as an alternative to tab for switching scrollable areas.

Alternatively -- and I almost just added this as a comment there -- making keys configurable per #18 would probably cover this feature request, too. If there are plans to do that, then this can probably be closed and consider this a +1 there. I put it in as a separate request as adding an alternate mapping is probably a quick change versus making a UI to customize shortcuts.

Thanks again for a great tool. (It would be perfect if it also worked with electron apps like Slack though I get there are technical reasons why this is difficult since those apps don't play nice with MacOS accessibility features.)

godbout commented 1 month ago

I'd rather use my home row to move between scrollable areas than tab and shift-tab.

had to check the doc 😂️ yeah i use kV on top of Scrolla so personally i enter Vim mode and use j/k. (same for navigating the Targets with Wooshy. Vim mode and j/k ftw.) you don't prefer using control n and control p over tab and shift-tab? way more useful in macOS. like for terminal history, UI dropdowns etc.

I expect h/l probably work for horizontal scrolling (rarely a need for me)

yes. i use those daily.

so am suggesting capital J/K as an alternative to tab for switching scrollable areas.

more on this below.

Alternatively -- and I almost just added this as a comment there -- making keys configurable per #18 would probably cover this feature request, too. If there are plans to do that, then this can probably be closed and consider this a +1 there. I put it in as a separate request as adding an alternate mapping is probably a quick change versus making a UI to customize shortcuts.

yeah i think the way to go is to allow people to remap all keys. BUT. 1) it's already doable with tools outside of Scrolla/Wooshy/kV, and especially done for that 2) if i do it (90% chance i'll do it) this has to be done properly, and for the three apps. which is why it's taking me so long to research and experiment.

adding hardcoded shortcuts in the apps depending on people's workflows is quite a big no no tho. with KE and Hammerspoon you can actually catch Scrolla's status and remap the keys however you want. see https://github.com/godbout/Scrolla.docs/issues/18#issuecomment-2106372899. that may be worth checking out for you in the short term.

Thanks again for a great tool. (It would be perfect if it also worked with electron apps like Slack though I get there are technical reasons why this is difficult since those apps don't play nice with MacOS accessibility features.)

yeah, can't do the magic if the apps don't play nice. but i'm thinking of a manual way. can you check my last two comments there and chip in?: https://github.com/godbout/Scrolla.docs/issues/16

would that be workable? basically using numbers to position the mouse kinda manually. i'm not expecting people having to type more than a sequence of three numbers max.

zmre commented 1 month ago

with KE and Hammerspoon you can actually catch Scrolla's status and remap the keys however you want

I saw your note about Hammerspoon and KE. Those are apps that I've tried but don't use and don't particularly want running on my machine all the time. I used to use skhd for key remapping and liked that, but currently don't run it either.

you don't prefer using control n and control p over tab and shift-tab?

Huh, I didn't think to try those. I use those shortcuts in many places. But when I feel like I'm in some sort of Normal Mode, I don't reach for the chords. I generally think of those when in some sort of Insert mode so for completions and such. To me, they aren't the intuitive choice here. Same thing with activating kindavim - by activating scrolls I put myself in Normal Mode of a sort. To then do it a second time feels odd to me.

can you check my last two comments there and chip in?

I will look.

godbout commented 1 month ago

I saw your note about Hammerspoon and KE. Those are apps that I've tried but don't use and don't particularly want running on my machine all the time. I used to use skhd for key remapping and liked that, but currently don't run it either.

thing is i've dealt with key mapping for kV and i can tell you that it's another project altogether. so no wonder apps like KE exist. i can't imagine doing a full custom remapping in kV/Ws/Sl itself... (still gonna try something good enough but yeah, if people were using KE that'd help a lot.)

Huh, I didn't think to try those. I use those shortcuts in many places. But when I feel like I'm in some sort of Normal Mode, I don't reach for the chords. I generally think of those when in some sort of Insert mode so for completions and such. To me, they aren't the intuitive choice here. Same thing with activating kindavim - by activating scrolls I put myself in Normal Mode of a sort. To then do it a second time feels odd to me.

interesting. i mostly always use j``k now with kV, but when i'm in the terminal i use j``k for navigating a clean history while i use control n``control p to navigating the history of the command i've started typing. fo me it's like they all go up or down. anyways. different people, different brains, need custom mapping lol (😭️)

I will look.

thanks. would be nice to have a clearer idea before i start the work.

zmre commented 1 month ago

I have a vim mode in command line so if I escape to it, then I navigate up and down with j/k, but if I'm in insert mode, I use ctrl-n/p. They both work the same but my brain is fairly well conditioned to reach for the right one at the right time.

On the remapping -- the KE problems should be way harder than what you face. You just need to swap out the keys you're listening for in-app to something variable that derives from a configuration with some set default. They have to intercept keys globally, prevent them from doing anything else and instead send something different to the OS. The number of race conditions and key listener priority stack bugs is mind boggling to think about.

Anyway, I'm replying on the other ticket right now. The tldr there: I think the subdividing approach is a good direction.

godbout commented 1 month ago

I have a vim mode in command line so if I escape to it, then I navigate up and down with j/k, but if I'm in insert mode, I use ctrl-n/p. They both work the same but my brain is fairly well conditioned to reach for the right one at the right time.

kinda same here, except i'm mostly never in insert mode 😂️ but i bind zsh-autosuggestions history to control n/p so i use both quite often.

On the remapping -- the KE problems should be way harder than what you face.

"logically" maybe. technically i'm not sure. at least with a virtual keyboard driver you have control as soon as the key are pressed. then you do whatever you want with it. with event taps like kV's even if you place yourself at the top of the event stream, an app started earlier (or later) can take over and grab events before you. (i'm not even talking about the bugs that prevent you to place the tap in different places in the stream, etc. all reported to Apple but hey, they're busy selling iPads lol.) i still haven't figured out even how to make kV behave properly on some specific keyboard layouts etc. 😴️

Anyway, I'm replying on the other ticket right now. The tldr there: I think the subdividing approach is a good direction.

👍️ thanks!