如何在Windows中自动键入带双倍空格的句点

2023-11-07 08:59

本文主要是介绍如何在Windows中自动键入带双倍空格的句点,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

00_lead_image_automatically_typing_a_period

Most smartphones have a feature in which you can double tap the spacebar to insert a period. Wouldn’t it be nice if you could do that on your Windows PC too? We’ll show you how you can.

大多数智能手机都有一项功能,您可以双击空格键以插入句点。 如果您也可以在Windows PC上做到这一点,这不是很好吗? 我们将向您展示如何做到。

We’re going to create an AutoHotkey script to insert a period followed by a space when you double tap on the space bar. AutoHotkey is a free, open-source program that allows you to automate repetitive tasks in Windows. It uses a scripting language that was originally designed to create keyboard shortcuts, or hotkeys, but it evolved into a scripting language that allows you to automate almost anything—no programming knowledge required.

我们将创建一个AutoHotkey脚本,当您在空格键上双击时插入一个句点,后跟一个空格。 AutoHotkey是一个免费的开放源代码程序,可让您在Windows中自动执行重复性任务。 它使用一种脚本语言,该脚本语言最初旨在创建键盘快捷键或热键,但后来演变为一种脚本语言,使您几乎可以自动化所有内容,而无需编程知识。

If you’re curious, check out our beginner’s guide to AutoHotkey to learn more about it. But even if you’ve never used it before, you should be able to follow the steps below easily.

如果您好奇,请查看我们的AutoHotkey初学者指南以了解更多信息。 但是,即使您以前从未使用过它,也应该可以轻松地遵循以下步骤。

Download AutoHotkey, install it using the Express Installation, and restart your PC. Then, right-click on any empty area of the desktop and go to New > AutoHotkey Script.

下载AutoHotkey ,使用快速安装进行安装,然后重新启动PC。 然后,右键单击桌面上的任何空白区域,然后转到“新建”>“ AutoHotkey脚本”。

01_creating_a_new_autohotkey_script

A file with the extension .ahk is created on your desktop. Rename the file, making sure to keep the .ahk extension. You can also move it wherever you want on your PC—put it in a safe place, because you’ll need to keep the script as long as you want this feature.

在您的桌面上创建扩展名为.ahk的文件。 重命名文件,确保保留.ahk扩展名。 您还可以将其移动到PC上的任何位置,将其放在安全的地方,因为只要需要此功能,就需要保留脚本。

Then, right-click on the file and select “Edit Script” from the popup menu.

然后,右键单击该文件,然后从弹出菜单中选择“编辑脚本”。

02_selecting_edit_script

We will use what’s called a “hotstring” to replace two spaces with a period followed by a space. This will work in any program, any time you type two spaces.

我们将使用所谓的“ hotstring”将两个空格替换为一个句点,后跟一个空格。 每当您键入两个空格时,该命令均可在任何程序中使用。

When you select Edit Script, the script file you created opens in the default text editor, which in our case is Notepad. There are some lines automatically added to the beginning of the file. Put the cursor at the end and add the following text on a new line. You can just copy and paste the text.

选择“编辑脚本”后,创建的脚本文件将在默认文本编辑器(在我们的情况下为记事本)中打开。 有些行自动添加到文件的开头。 将光标放在末尾,然后在新行中添加以下文本。 您可以只复制并粘贴文本。

:*:  ::{NumpadDot}{space}

Here’s what this line does:

这行的内容如下:

  • The asterisk (*) between the first pair of colons is an option that indicates an ending character is not required. This means that as soon as you type two spaces, they will be replaced by a period followed by a space.

    第一对冒号之间的星号( * )是一个选项,指示不需要结尾字符。 这意味着,一旦您键入两个空格,它们就会被句号后跟一个空格所代替。

  • There are two spaces between the next pair of colons. This indicates what you type to insert the replacement text.

    下一对冒号之间有两个空格。 这表明您键入要插入替换文本的内容。
  • The pair of colons after the two spaces is just a divider between the activating action (the two spaces) and what the action executes (replacing the two spaces with a period and a space).

    两个空格后面的一对冒号只是激活动作(两个空格)和动作执行内容(用句点和空格替换两个空格)之间的分隔线。
  • The items in brackets after the last colon are the characters that will replace the two spaces.

    最后一个冒号后面方括号中的项目是将替换两个空格的字符。
03_entering_autohotkey_command

Press Ctrl+S to save the script file and then click the “X” button in the upper-right corner of the window to close the text editor.

按Ctrl + S保存脚本文件,然后单击窗口右上角的“ X”按钮以关闭文本编辑器。

04_closing_notepad

Double-click on the script file to run the script.

双击脚本文件以运行脚本。

05_double_clicking_on_script_file

Now, in any program where you can type text, such as text editors, word processors, and browsers, you can double-tap the space bar to type a period and a space. You may have to test the speed at which you need to double-tap the space bar for this to work.

现在,在任何可以键入文本的程序中,例如文本编辑器,文字处理器和浏览器,都可以点按两次空格键以键入句点和空格。 您可能需要测试双击空格键才能使其正常工作的速度。

05a_automatically_typing_a_period

You can edit the script at any time by right-clicking on the script file and selecting Edit Script, just like when you first created the script. You can also edit the script by right-clicking the AutoHotkey icon in the system tray and selecting “Edit This Script” from the popup menu. If you change the script, or add additional actions to it, use the “Reload This Script” option on the popup menu on the system tray icon to run the revised script without having to exit and re-run the script.

您可以随时通过右键单击脚本文件并选择“编辑脚本”来编辑脚本,就像您首次创建脚本一样。 您还可以通过右键单击系统任务栏中的AutoHotkey图标并从弹出菜单中选择“编辑此脚本”来编辑脚本。 如果更改脚本或对其添加其他操作,请使用系统任务栏图标弹出菜单上的“重新加载此脚本”选项来运行修改后的脚本,而不必退出并重新运行该脚本。

06_reloading_script

If you want your AutoHotkey script to run automatically when Windows starts, you can create a shortcut and put that shortcut in the Startup folder. Right-click on the .ahk script file and select “Create shortcut” from the popup menu.

如果希望Windows启动时自动运行 AutoHotkey脚本,则可以创建一个快捷方式并将该快捷方式放入“启动”文件夹中。 右键单击.ahk脚本文件,然后从弹出菜单中选择“创建快捷方式”。

09_selecting_create_shortcut

Select the new shortcut and press Ctrl+C to copy it.

选择新的快捷方式,然后按Ctrl + C进行复制。

10_copying_shortcut

Press Windows+R on your keyboard to open the Run dialog box, type shell:startup in the Open box, and click “OK” to open the Startup folder.

在键盘上按Windows + R打开“运行”对话框,在“打开”框中键入shell:startup ,然后单击“确定”以打开“启动”文件夹。

NOTE: When you add a shortcut to the shell:startup folder, it will only launch when you are logged into the current account. If you want the shortcut to launch whenever any user logs in, type shell:common startup in the Open box on the Run dialog box.

注意:将快捷方式添加到shell:startup文件夹时,仅当您登录到当前帐户时,它才会启动。 如果希望在任何用户登录时启动快捷方式,请在“运行”对话框的“打开”框中键入shell:common startup

11_opening_startup_folder

Press Ctrl+V to paste the shortcut into the Startup folder. Now, your AutoHotkey script will always run when Windows starts and you’ll be able to type two spaces to insert a period followed by a space.

按Ctrl + V将快捷方式粘贴到“启动”文件夹中。 现在,您的AutoHotkey脚本将始终在Windows启动时运行,并且您将能够键入两个空格以在句号后插入一个空格。

12_autohotkey_script_in_startup

Again, to learn more about using scripts in Windows with AutoHotkey, read our beginner’s guide to using an AutoHotkey script.

同样,要了解有关在Windows中将脚本与AutoHotkey结合使用的更多信息,请阅读有关使用AutoHotkey脚本的初学者指南 。

翻译自: https://www.howtogeek.com/289862/how-to-automatically-type-a-period-with-a-double-space-in-windows/

这篇关于如何在Windows中自动键入带双倍空格的句点的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/362578

相关文章

Windows系统宽带限制如何解除?

《Windows系统宽带限制如何解除?》有不少用户反映电脑网速慢得情况,可能是宽带速度被限制的原因,只需解除限制即可,具体该如何操作呢?本文就跟大家一起来看看Windows系统解除网络限制的操作方法吧... 有不少用户反映电脑网速慢得情况,可能是宽带速度被限制的原因,只需解除限制即可,具体该如何操作呢?本文

windows和Linux使用命令行计算文件的MD5值

《windows和Linux使用命令行计算文件的MD5值》在Windows和Linux系统中,您可以使用命令行(终端或命令提示符)来计算文件的MD5值,文章介绍了在Windows和Linux/macO... 目录在Windows上:在linux或MACOS上:总结在Windows上:可以使用certuti

Python实现微信自动锁定工具

《Python实现微信自动锁定工具》在数字化办公时代,微信已成为职场沟通的重要工具,但临时离开时忘记锁屏可能导致敏感信息泄露,下面我们就来看看如何使用Python打造一个微信自动锁定工具吧... 目录引言:当微信隐私遇到自动化守护效果展示核心功能全景图技术亮点深度解析1. 无操作检测引擎2. 微信路径智能获

Windows 上如果忘记了 MySQL 密码 重置密码的两种方法

《Windows上如果忘记了MySQL密码重置密码的两种方法》:本文主要介绍Windows上如果忘记了MySQL密码重置密码的两种方法,本文通过两种方法结合实例代码给大家介绍的非常详细,感... 目录方法 1:以跳过权限验证模式启动 mysql 并重置密码方法 2:使用 my.ini 文件的临时配置在 Wi

Windows Docker端口占用错误及解决方案总结

《WindowsDocker端口占用错误及解决方案总结》在Windows环境下使用Docker容器时,端口占用错误是开发和运维中常见且棘手的问题,本文将深入剖析该问题的成因,介绍如何通过查看端口分配... 目录引言Windows docker 端口占用错误及解决方案汇总端口冲突形成原因解析诊断当前端口情况解

IDEA自动生成注释模板的配置教程

《IDEA自动生成注释模板的配置教程》本文介绍了如何在IntelliJIDEA中配置类和方法的注释模板,包括自动生成项目名称、包名、日期和时间等内容,以及如何定制参数和返回值的注释格式,需要的朋友可以... 目录项目场景配置方法类注释模板定义类开头的注释步骤类注释效果方法注释模板定义方法开头的注释步骤方法注

pytorch自动求梯度autograd的实现

《pytorch自动求梯度autograd的实现》autograd是一个自动微分引擎,它可以自动计算张量的梯度,本文主要介绍了pytorch自动求梯度autograd的实现,具有一定的参考价值,感兴趣... autograd是pytorch构建神经网络的核心。在 PyTorch 中,结合以下代码例子,当你

Python如何自动生成环境依赖包requirements

《Python如何自动生成环境依赖包requirements》:本文主要介绍Python如何自动生成环境依赖包requirements问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑... 目录生成当前 python 环境 安装的所有依赖包1、命令2、常见问题只生成当前 项目 的所有依赖包1、

MySQL中动态生成SQL语句去掉所有字段的空格的操作方法

《MySQL中动态生成SQL语句去掉所有字段的空格的操作方法》在数据库管理过程中,我们常常会遇到需要对表中字段进行清洗和整理的情况,本文将详细介绍如何在MySQL中动态生成SQL语句来去掉所有字段的空... 目录在mysql中动态生成SQL语句去掉所有字段的空格准备工作原理分析动态生成SQL语句在MySQL

Redis在windows环境下如何启动

《Redis在windows环境下如何启动》:本文主要介绍Redis在windows环境下如何启动的实现方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录Redis在Windows环境下启动1.在redis的安装目录下2.输入·redis-server.exe