Saturday, November 12, 2022

Re: Emulate keyboard keys through Vim that the OS interpret it.

On 2022-11-12 03:05, Nicolas wrote:
> Is it possible to emulate keyboard keys through Vim Editor so that the
> OS interprets them?
>
> example: Is is possible to emulate Windows Key(VK_LWIN)+R keys?
>
> VK_LWIN as defined here
> https://learn.microsoft.com/fr-fr/windows/win32/inputdev/virtual-key-codes

The interpretation of keys goes in the other direction: first Windows
interprets a keypress, then it passes on the possibly-remapped key to
Vim or whatever other application has focus, and _that_ application
interprets what it got from Windows.

But Windows+R is just the Run command, so you could emulate it by the :!
command in Vim.

There are some differences in the implementation details between :! and
Windows+R, so if you really want to you could use the excellent and free
Autohotkey <https://www.autohotkey.com/> to sense when you press :! (or
any other chosen combination) in a Vim window and pass Widows+R to the OS.

Stan Brown
Tehachapi, CA, USA
https://BrownMath.com

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/f4a3f5ac-1406-6b23-c7f8-c604e1f91a2d%40fastmail.fm.

No comments:

Post a Comment