-
Notifications
You must be signed in to change notification settings - Fork 216
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
Word-wise text-navigation not working #16
Comments
I will take a look at this tomorrow, sorry for the delayed response. |
I just tested this out under sublime text and it appears to behave the same as macOS sublime text vs Ubuntu 18.04 sublime text. The way the alt and arrow keys are handled per app under Linux I believe is simply different than how macOS typically handles it for its applications (devs following stricter standards, using specific libraries, etc.). If someone can indicate to me otherwise, that there would be a reason to further pursue this by updating this file then please let me know, but I don't think there is much I can do to further Alt + arrow compatibility. I have just added kintox11, a C based program, that handles a lot better than xprop and can easily be sent a basic text file of terminal app names so it can output whether the user is using a term or gui based app. kintox11 could easily be extended to all support custom keymaps (symbol files) based on another set of criteria, perhaps looking for conf files with the application name itself.
** Updated ** |
Hello! I'm just entering the world of linux and ubuntu from a Mac OS and this project is saving me from so much keyboard grief! But I'm also experiencing this lack of word-wise text navigation. In VS Code on Mac OS (and all other GUI software) I'm used to I'm not sure exactly whether you were suggesting this was fixed, or going to be fixed, but I would love if there was a system-wide way of handling this. Many thanks for all your work on this so far! |
Same here, word navigation is the only thing I'm missing so far. Having this would be great. |
I'll re-open the issue and take another look at it since you are specifically mentioning the program you are having an issue with. I'll compare it with the macOS program of VS code, there may be a difference with specific apps, I just couldn't duplicate an issue in sublime text, but maybe we're not talking the exact some set of keys - either way I will take another look. |
That's really great, thanks so much! And just to clarify, this So ideally this would be system wide in Linux also, apart from in the Terminal which I realise is a special case. One more note that might help... The original key combo to do this in Ubuntu is |
As I was trying to explain earlier, making Alt + left/right a system-wide navigation feature will be exceedingly difficult, if not impossible on Linux due to the lack of consensus btwn developers on the platform. I have installed VS Code now under linux and tested this out and appears like Alt + Left/Right is dedicated already to terminal pane focus usage, but if you remove those keymaps you can then rebind the Ctrl + Left/Right keybindings to traverse words as you are wanting. I might include some default keybindings with the install of Kinto, but currently it is outside the scope of the project, which is to focus on fixing global keymap type issues. However including some default macOS like keymaps for specific apps during and after the install is something I may be interested in doing later - it's just a lot more effort since they'd all be one off efforts. It is apparent though that the Ctrl+Left/Right is overridden in VS Code by the Kinto remap effort to make Ctrl+Left/Right behave more like it does on macOS. ~/.config/Code/User/keybindings.json
|
I see, I don't think I understood that you were saying it wasn't possible earlier. And I agree that application specific keybindings is probably outside the scope of Kinto. But thank you for the help of VS Code, that certainly makes things better. However I still find it strange that there can be no way of word-wise navigation. It works with |
Deleting my overly long comment.. hmmm. Maybe there is something I can do here after all. Thanks for that link @owzim.. for some reason I was pretty certain there wasn't anything comparable but maybe.. maybe I was wrong about that. I will look into this more. And looking at the original sublime text config file I might not be breaking wordwise still, even though it supports traversing words already by default, even with alt. |
I am going to re-open this issue to give it more visibility in hopes that someone might have some ideas on how to fix the symbols and types files as I am beginning to think that this might actually have a solution it just escapes me at this time. This is one approach that I have seen and commented on in the past that appears to tackle it, but in the exact opposite way that I am solving it with Kinto. Kinto checks for when your focus window changes and the reset your keyboard layout, no key interception going on at all. This guy's approach intercepts every single keystroke and checks it against the app with the current focus and then decides whether or not to remap your key input. The approach works.. but comparatively it is a very brutefroce approach to make things work. I am not criticizing it, it should work in theory, but I also couldn't ever figure out how to get his script to actually run either. https://github.com/joeytwiddle/dotfiles/blob/master/.config/sxhkd/sxhkdrc To fix my approach these two files will need to updated or duplicated for testing, it'll probably be easier to duplicate them and get rid of the Ctrl remapping stuff while working out how to remap Alt + arrow keys. https://github.com/rbreaves/kinto/blob/master/.xkb/symbols/mac_gui And to repeat what I said in that thread for sxhkd. There is a 3rd file that'll be created in ~/.xkb/keymaps/kbd.mac.gui, it looks something like the following (depending on your keyboard type)
I have tried modifying them so that I have a level modifier for alt in the same manner I have one for control, but it just seems to fail to work. One of the many difficulties of working with xkb. 3rd option
|
Ok guys.. @owzim, @bravokiloecho, @cicloon, @Saduras and @probonobp the Alt key will now move the cursor to the left or right of the current word in the same manner as macOS. (works in VS Code and it still works in Sublime as sublime has support for both mappings by default) I am FINALLY closing this ticket!! lol Let me know though if what's in master, 1.0.5, doesn't solve it for you guys though and I'll reopen the ticket, but I am pretty sure this update knocks it out. And just to reference this interesting thread from 2015. They talked about this very solution way back then, but the people in the thread never really got it figured out and working sadly, they were headed in the right direction though. |
Hi @rbreaves, I'm so grateful to all your work and thinking on this issue; truly impressive. And apologies for being so slow on replying to this... I pulled the latest version from master and ran the install process again, however nothing seems to have changed wrt the alt + arrow keys for me. I had already setup the custom keybindings in VS Code (as you described) so it was working there before. But for example, in this textarea on Github, they don't work. Should it be working here, or were you just making a fix for VS Code? Apologies if I've misunderstood something. |
I’m up way too late, will have to look into it a bit later. Word-wise in browsers is not released yet, chrome is very problematic as it uses Alt arrows for back & forwards. VS Code should already be working in master & dev unless I did something wrong in the keyswap_service.sh file that copies the files over.. I did notice my dev machine I don’t think was updating the ~/.xkb on subsequent installs. Maybe delete that directory & reinstall. |
Manually deleting the |
@owzim, @bravokiloecho, @cicloon, @Saduras and @probonobp Another release 1.0.5-2 has just landed if any of you guys want to check it out. This directly addresses wordwise while using web browsers and still keeping the Cmd + Arrow keys working with Back and Forwards, just like macOS, while no text field is highlighted. Also fixed the installer to properly overwrite the .xkb directory this time. |
First of all thanks a lot for your work. I struggled for some time how to modify my keymaps and hotkeys to match the mac-style until I found your project which solved it quickly.
But unfortunately word-wise navigation (alt - left-arrow / alt - right arrow on mac) is not working for me. I saw the issue #2 where you already addressed this but it does not work for me.
I'm running Ubuntu 18.04 with x11 on a 2014 MacBook Pro.
Can you help me figure out why it's not working? Thanks!
The text was updated successfully, but these errors were encountered: