0

I am looking for a way to send specific text to clipboard with specific keys, this is the closest I got, I only cannot find how I can make one of those commands be a combination like ALT+D for example:

@echo off
color 0a
title KeyStrokeSim
goto Start

:Start
cls
echo Press D or F to continue...
choice /c df /n
if %errorlevel%==1 goto Finished1
if %errorlevel%==2 goto Finished2

:Finished1
echo|set /p=youpressedD|clip
goto Start

:Finished2
echo|set /p=youpressedF|clip
goto Start

It is needed for a large number of commands so i am avoiding the windows shortcut alternative. Thanks

Dio
  • 1
  • 1
    [This question](https://stackoverflow.com/questions/33771243/how-do-i-make-an-if-statement-based-on-which-keys-are-pressed-in-batch-or-powers) is related, with the general consensus of _use PowerShell_. You may find [this](https://www.robvanderwoude.com/userinput.php) page interesting too. – BDM Sep 10 '19 at 00:48
  • 1
    Short answer: [tag:batch-file] is the wrong choice for this since there are only a few commands to get user input ([`set /P`](https://ss64.com/nt/set.html) to prompt for text and [`choice`](https://ss64.com/nt/choice.html) for key presses), which do not allow specific key combinations (unless you find an adequate external tool)... – aschipfl Sep 10 '19 at 07:39

0 Answers0