Skip to content
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

default app level keyboard shortcut not working under visual mode #67

Closed
kindadolf opened this issue Jun 10, 2021 · 2 comments
Closed

Comments

@kindadolf
Copy link

Thanks so much for the contribution. I love it overall. I do have an issue with triggering some useful keyboard shortcuts that originally comes with some apps. for example, in PowerPoint, if I select a word using the following vim command 'vw'. It goes from normal to visual mode as expected. However, If I now want to bold the selected text by pressing 'Ctrl + b', it doesn't work as expected. I believe it works under normal mode if I choose to ignore all unused keys in your setting. but there is no such corresponding setting under visual mode. Can you please enable that?

@rcmdnk
Copy link
Owner

rcmdnk commented Jun 10, 2021

It seems difficult problem because
Ctrl+b is an one of common move shortuct keys of Vim.
In Normal/Visual modes, these movement shortcuts keys are enabled.

Maybe we can implement a key bind which disable vim_ahk for one time.
(Like Ctrl+o to enable normal mode in Vim, but reversed)

Although it may take a time to see such a new function,
if you want to fix a.s.a.p.,
here is a manual fix procedure:

#If WinActive("ahk_exe POWERPNT.exe") and (Vim.State.StrIsInCurrentVimMode("Visual"))
^b:: Send, ^b
#If

This overwrites Ctrl+b behavior in Visual mode on PoerPoint.
If you want to enable Ctrl+b to change the bold status for all apps,
please try following code:

#If  Vim.IsVimGroup() and (Vim.State.StrIsInCurrentVimMode("Visual"))
^b:: Send, ^b
#If

@kindadolf
Copy link
Author

Thanks for the suggestion and explanation, really appreciate it. Before seeing you comments, I ended up just commenting out the ^b shortcut entirely at file vim_move.ahk. I decided to do that since I usually use gg to go to the top anyway. (let me know if ^b does anything different from gg though)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants