godbout / kindaVim.docs

Ultimate Vim Mode for macOS
https://kindavim.app
642 stars 4 forks source link

Does not work when using with Colemak software layout #12

Closed jandamm closed 2 years ago

jandamm commented 2 years ago

The app always uses the keys printed on the key instead of the key that is inserted. So I would have to use this plugin with QWERTY instead of COLEMAK.

godbout commented 2 years ago

indeed. that makes the app pretty useless to you i reckon. i remember dealing with this a year ago when i started and it was a ducking nightmare and i decided to stick to English US layout for now and i forgot about it. adding this to the roadmap. thanks. no ETA though sorry. that's gonna be a tough one.

jandamm commented 2 years ago

Most of the time I use an external keyboard with a native Colemak layout where it works.

This issue exists in some other apps as well. For example Keyboard Maestro.

Maybe you can reach out to the developer of BTT. This app has solved this issue. From my understanding it gets the input key and applies the software side mapping again.

godbout commented 2 years ago

Most of the time I use an external keyboard with a native Colemak layout where it works.

ah. thanks for letting me know. that will help.

This issue exists in some other apps as well. For example Keyboard Maestro.

Maybe you can reach out to the developer of BTT. This app has solved this issue. From my understanding it gets the input key and applies the software side mapping again.

ok, good to know. yes, that's exactly BTT's specialty. in kV the KeyCombination part is in its own separated wrapper/package so it'll be fine working on this without affecting the rest of the app. it's easy to "translate" a KeyCode into a character (so the overlay window would show the correct character you're typing on your Colemak keyboard) but the other way around is not easy. macOS requires a you to post a KeyCode rather than a character. anyways i'll investigate, probably in a couple of weeks. that's definitely something that needs to be fixed. thanks for reporting.

godbout commented 2 years ago

gonna start exploring this one. fingers crossed! ✌️ (<- like this but crossed.)

godbout commented 2 years ago

gonna start exploring this one. fingers crossed! ✌️ (<- like this but crossed.)

🤞️ what a dumbass LMAO

godbout commented 2 years ago

i'm getting something 💫️💫️💫️

i was already wrapping the ugly Apple Events with my own beautiful KeyCombinations—vimKey included™. so all i need to do* now is generating those KeyCombinations—vimKey included™ from the characters typed.

*although some keys don't generate characters. and also i'll need to pay attention to accénts, and your weird ß (no judgment). seems some key codes change according to keyboard layouts but some are always fixed. anyways, some research to do before getting this proper, but this looks good. this is on top of my list now. i'm thinking i should get something good in about two to three weeks.

godbout commented 2 years ago

funny story. first testing this has been an absolute fucking nightmare. kept switching from English US to French keyboard. wanted to open tabs in Xcode and ended up quitting. wants to go back to previous change and i log out. fucking hell. then i can't log in anymore... try super slowly, same thing. then i thought maybe it's the keyboard? had to translate my password to AZERTY and it worked LMAO. actually that's not funny.

jandamm commented 2 years ago

Try logging into a remote server via vnc which has a different keyboard layout than the one your currently using.

If this isn't enough fun - use a keyboard which has a different hardware layout than the software layout the computer has your on and is again different than the layout the vnc machine is using 👍

Keyboard layouts are awesome 👏

godbout commented 2 years ago

nein, danke.

godbout commented 2 years ago

@jandamm a few questions:

  1. what's the software keyboard layout when you plug in your physical Colemak keyboard?
  2. what's your workflow? like when/how often do you switch the software keyboard layout? (and why?)
  3. how are you
jandamm commented 2 years ago
  1. I either use my ErgoDoxEZ with Colemak + US or when I use the internal keyboard it's US with Colemak.
  2. I switch it automatically whenever I (un-)plug my external keyboard. Which is basically switching from desk to couch.
  3. Fine enough to battle with keyboard layouts 😅
godbout commented 2 years ago
  1. are you trying to kill me
  2. what color is your couch tho
  3. from my experience that requires a high level of fitness

i currently have the Accessibility Strategy working (when you see a block cursor when entering kV Normal Mode) but for the Keyboard Strategy (key mapping) it's more hardcore. i'll also have to handle the times when you switch from your desk to your couch. i think that'll require some extra testing. i don't have BDSM keyboards myself. i'll probably make a release for everyone that will work with the Accessibility Strategy (so no change for normal people), but i may need you to test more thoroughly your setup. if i do a beta of the beta, you willing to do some extra squats?

jandamm commented 2 years ago
  1. Don't worry about the hardware keyboard. As far as macOS is concerned it is just a US layout. (So everything works there)
  2. gray or grey - depending on your preference

Sure I can try a beta²

godbout commented 2 years ago

sorry i meant a be'a, of course.

can you try this? kindaVim-MacCall.zip

godbout commented 2 years ago

if you say it works and the next 1b11 is botched it's your fault tho.

jandamm commented 2 years ago

Looks good to me. Using o, ce, and other things is working. It crashes in Catalyst apps (iMessage, Craft, ...). But I think the previous be'a did that as well.

godbout commented 2 years ago

Looks good to me. Using o, ce, and other things is working.

GREAT>

It crashes in Catalyst apps (iMessage, Craft, ...). But I think the previous be'a did that as well.

oh. had no idea. definitely not worth 3US a month. i'm able to reproduce. also i'm seeing only now that for Catalyst apps kV is using key mapping, which means it can't read the text, which means you'll get a subpar experience. not cool and strange. i assumed Catalyst apps to be like Native ones. will investigate. danke!

edit: also some moves don't seem to be working properly (ce, cw) in key mapping, or for whatever reason O doesn't create a line above in Craft, while it does in other apps that are using key mapping. so i guess there's more investigation to be done on Catalyst apps. back to it.

godbout commented 2 years ago

It crashes in Catalyst apps (iMessage, Craft, ...). But I think the previous be'a did that as well.

if you're able to reproduce yourself let me know how you get it to crash tho. would help. thanks.

jandamm commented 2 years ago

For me it's enough to:

godbout commented 2 years ago

yeah this is fixed in be’a 11: https://github.com/godbout/kindaVim.theapp/releases/tag/1b.11

i’ll update you on the rest a bit later.

godbout commented 2 years ago

and yeah i forgot to mention the fix in the change log 👍🏼

godbout commented 2 years ago

ok, so.

  1. the Accessibility API with Catalyst apps is widely inconsistent. sometimes it says you can't manipulate the text (Podcasts), sometimes it says you can but then crashes later (iMessage), sometimes It just Works™ (App Store, Music). i've added a double layer of cushions (gray) in case the AX API is lying, so crashes are (should be) gone. but you'll see that in iMessage you're stuck with the Keyboard Strategy, so you can't have all the Vim love. which is not cool. the fact that it works in App Store and Music tells me it's possible, so probably a bug in iMessage/Podcasts or Catalyst itself. don't know. will report (my AX engine is full of feedback numbers sent to Apple... ☹️) and will try to find a work around coz they never answer.
  2. for Craft, the text is just not accessible. they use a big AXGroup with everything inside. so impossible to grab caret location, text, selection etc etc. but even worse, they seem to be doing some extra magic so even the Keyboard Strategy doesn't work properly (like the return key is skipped, which is why you can't do O). i've contacted them to see if there's something they can do regarding making the text accessible. i haven't said anything about a potential blindness condition that i may have for which i would need to access the text through a screen reader. let's see.

i'll add handling Catalyst apps better in the roadmap. i saw that Apple is rebuilding Music as a macOS native app rather than Catalyst (https://9to5mac.com/2021/12/16/apple-is-rebuilding-apple-music-as-a-full-native-app-with-macos-12-2-beta/). i really hope it's a trend. even as a user i find Catalyst apps subpar. really not consistent with macOS. usually impossible to handle keyboard shortcuts properly (like their new menu bar and control center).

i'll close this issue regarding the Colemak keyboard and will open others for the rest if necessary. thanks for the feedback!

godbout commented 2 years ago

btw the various Keyboard Layouts are handled for everything except the Keyboard Shortcut to enter kV Normal Mode. that one is not translated. i think it doesn't make sense as a shortcut is more a position than letters. (although the UI could/should be updated.)

jandamm commented 2 years ago

Sounds good, thanks 👍

godbout commented 2 years ago

just for info Craft said they're not supporting Accessibility at all for now but they're planning to implement it.

godbout commented 1 year ago

@jandamm still using kV and/or with Colemak layout? seems changes are needed on my key combination system and wanna make sure it's still work with your layout.

jandamm commented 1 year ago

Sorry I don't use kV anymore.

I still think it's a great piece of software but it's the rough edges when using it with other software which also uses vim like keys or the ESC key.

It's a bit like using emacs with evil. It works just fine but then one plugin is not mapped and you're out of luck.

godbout commented 1 year ago

no worries. thanks for taking the time to answer!

yeah i see your point, and i even agree. unfortunately, even working full time on this, i don't think there's a way to avoid the rough edges. it comes with the nature of the project. gonna be appealing to a certain type of users (like me), and not to a lot of others.

thanks again!