c# ctrl-c 转义符_如何在Windows命令提示符下启用CTRL + C / Ctrl + V进行粘贴

c# ctrl-c 转义符

c# ctrl-c 转义符

One of the more irritating problems with the Windows command prompt is that you can’t paste anything into the window using the keyboard easily—it requires using the mouse. Here’s how to fix that problem.

Windows命令提示符更令人烦恼的问题之一是,您无法使用键盘轻松地将任何内容粘贴到窗口中-它需要使用鼠标。 这是解决此问题的方法。

The solution, as with many Windows shortcomings, is to use a quick AutoHotkey script to enable pasting from the keyboard. What it actually does is take the clipboard contents and use the SendInput function to send the keystrokes really quickly to the console window.

与许多Windows缺点一样,该解决方案是使用快速的AutoHotkey脚本来启用从键盘的粘贴。 它实际上所做的是获取剪贴板内容,并使用SendInput函数将击键真正快速地发送到控制台窗口。

But first… here’s another way to do it.

但是首先……这是另一种方法。

在Windows 10中启用CTRL + C和CTRL + V (Enabling CTRL + C and CTRL + V in Windows 10)

All you have to do to get copy and paste working in Windows 10 is to right-click on the command prompt’s title bar, choose Properties…

要在Windows 10中进行复制和粘贴,您要做的就是右键单击命令提示符的标题栏,选择“属性”。

And then click “Enable new Ctrl key shortcuts”. You’ll probably have to click the “Enable experimental console features” checkbox first though.

然后单击“启用新的Ctrl键快捷方式”。 不过,您可能必须先单击“启用实验性控制台功能”复选框。

And now you can copy and paste in the command prompt.

现在,您可以复制并粘贴到命令提示符中。

从键盘粘贴的替代内置方式(Windows 10、8、7或Vista) (The Alternate Built-In Way to Paste from the Keyboard (Windows 10, 8, 7, or Vista))

There is actually a way to paste something using the keyboard, but it’s not terribly convenient to use. What you’ll have to do is use the Alt+Space keyboard combination to bring up the window menu, then hit the E key, and then the P key. This will trigger the menus and paste into the console.

实际上,有一种使用键盘粘贴内容的方法,但是使用起来并不十分方便。 您需要做的是使用Alt + Space键盘组合调出窗口菜单,然后按E键,再按P键。 这将触发菜单并粘贴到控制台中。

image

Once you get used to doing it, it really isn’t so bad… but who wants to use a different combination for one application than the rest of Windows?

一旦习惯了,它确实还不错……但是谁愿意为一个应用程序使用与其他Windows不同的组合呢?

AutoHotkey脚本Ctrl + V令人敬畏 (The AutoHotkey Script Ctrl+V Awesomeness)

You’ll need to first make sure that you’ve got AutoHotkey installed, and then create a new AutoHotkey script or add the following to your existing script. We’ve also provided a download in case there are any formatting problems.

您首先需要确保已安装AutoHotkey ,然后创建新的AutoHotkey脚本或将以下内容添加到现有脚本中。 如果出现任何格式问题,我们还提供了下载。

#IfWinActive ahk_class ConsoleWindowClass ^V:: SendInput {Raw}%clipboard% return #IfWinActive

#IfWinActive ahk_class ConsoleWindowClass ^ V :: SendInput {原始}%clipboard%返回#IfWinActive

What this script does is simply use the SendInput function to send the data into the window, which is a lot faster than any other method.

该脚本所做的只是使用SendInput函数将数据发送到窗口中,这比任何其他方法都快得多。

image

Note: the script doesn’t paste line breaks very well. If you’ve got a better solution for that, feel free to let us know in the comments and we’ll update the post.

注意:脚本不能很好地粘贴换行符。 如果您有更好的解决方案,请随时在评论中告知我们,我们将更新帖子。

可下载的AutoHotkey脚本 (Downloadable AutoHotkey Script)

Simply grab the script, save it anywhere, and then double-click on it to start it. You can kill it through the tray icon if you want—if you’d like to hide the tray icon, add #NoTrayIcon to the top of the script.

只需抓取脚本,将其保存在任何位置,然后双击以启动它。 您可以根据需要通过任务栏图标杀死它-如果要隐藏任务栏图标,请在脚本顶部添加#NoTrayIcon。

Download the PasteCommandPrompt AutoHotkey Script from howtogeek.com

从howtogeek.com下载PasteCommandPrompt AutoHotkey脚本

翻译自: https://www.howtogeek.com/howto/25590/how-to-enable-ctrlv-for-pasting-in-the-windows-command-prompt/

c# ctrl-c 转义符

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值