PowerShell hotkeys, use it inside the script, how?
Colleagues, prompt how it is possible within a Powershell script to process hotkeys when running the script (creating your own). D. run the script, press ctrl+1 and we have some action going on (in advance of us envisaged), i.e. in the script we need to catch the hotkeys, how can I do that?
Complement question as an example: there is a user who works with text, and it needs some constant pieces of text to insert, a lot of these pieces, I paste these pieces to see on hot keys. ie, a file to be formed with the pieces or even push them into variables, and then invoke hotkey in the active window (not Powerline, and programs), the specific need at the moment, a piece of text.
brown_Kuvalis49 answered on March 12th 20 at 08:10
need more information. describe the usage scenario of this functionality in more detail.
while I could think only this: run the script, it gives out menus and hot keys we can select the menu items. but it is not necessary to intercept hotkeys. it just can be made to respond to typed characters:
1. Press 1 for this option
2. Press 2 for this option
Q. Press Q to quit
mabel.Jakubowski answered on March 12th 20 at 08:12
You do not truly understand the process of functioning hotkeys.
When you press a combination of any of key event is generated, for which Nikolay Petyukh gave a link.
This event is passed to the active window. In the script the window just yet.
You can handle user input (if being run interactively) or system events, available to all processes in the system.