如何在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

相关文章

shell脚本自动删除30天以前的文件(最新推荐)

《shell脚本自动删除30天以前的文件(最新推荐)》该文章介绍了如何使用Shell脚本自动删除指定目录下30天以前的文件,并通过crontab设置定时任务,此外,还提供了如何使用Shell脚本删除E... 目录shell脚本自动删除30天以前的文件linux按照日期定时删除elasticsearch索引s

Go Mongox轻松实现MongoDB的时间字段自动填充

《GoMongox轻松实现MongoDB的时间字段自动填充》这篇文章主要为大家详细介绍了Go语言如何使用mongox库,在插入和更新数据时自动填充时间字段,从而提升开发效率并减少重复代码,需要的可以... 目录前言时间字段填充规则Mongox 的安装使用 Mongox 进行插入操作使用 Mongox 进行更

Windows设置nginx启动端口的方法

《Windows设置nginx启动端口的方法》在服务器配置与开发过程中,nginx作为一款高效的HTTP和反向代理服务器,被广泛应用,而在Windows系统中,合理设置nginx的启动端口,是确保其正... 目录一、为什么要设置 nginx 启动端口二、设置步骤三、常见问题及解决一、为什么要设置 nginx

C语言中自动与强制转换全解析

《C语言中自动与强制转换全解析》在编写C程序时,类型转换是确保数据正确性和一致性的关键环节,无论是隐式转换还是显式转换,都各有特点和应用场景,本文将详细探讨C语言中的类型转换机制,帮助您更好地理解并在... 目录类型转换的重要性自动类型转换(隐式转换)强制类型转换(显式转换)常见错误与注意事项总结与建议类型

在 Windows 上安装 DeepSeek 的完整指南(最新推荐)

《在Windows上安装DeepSeek的完整指南(最新推荐)》在Windows上安装DeepSeek的完整指南,包括下载和安装Ollama、下载DeepSeekRXNUMX模型、运行Deep... 目录在www.chinasem.cn Windows 上安装 DeepSeek 的完整指南步骤 1:下载并安装

IDEA如何让控制台自动换行

《IDEA如何让控制台自动换行》本文介绍了如何在IDEA中设置控制台自动换行,具体步骤为:File-Settings-Editor-General-Console,然后勾选Usesoftwrapsin... 目录IDEA如何让控制台自http://www.chinasem.cn动换行操作流http://www

vscode保存代码时自动eslint格式化图文教程

《vscode保存代码时自动eslint格式化图文教程》:本文主要介绍vscode保存代码时自动eslint格式化的相关资料,包括打开设置文件并复制特定内容,文中通过代码介绍的非常详细,需要的朋友... 目录1、点击设置2、选择远程--->点击右上角打开设置3、会弹出settings.json文件,将以下内

Python脚本实现自动删除C盘临时文件夹

《Python脚本实现自动删除C盘临时文件夹》在日常使用电脑的过程中,临时文件夹往往会积累大量的无用数据,占用宝贵的磁盘空间,下面我们就来看看Python如何通过脚本实现自动删除C盘临时文件夹吧... 目录一、准备工作二、python脚本编写三、脚本解析四、运行脚本五、案例演示六、注意事项七、总结在日常使用

windows系统下shutdown重启关机命令超详细教程

《windows系统下shutdown重启关机命令超详细教程》shutdown命令是一个强大的工具,允许你通过命令行快速完成关机、重启或注销操作,本文将为你详细解析shutdown命令的使用方法,并提... 目录一、shutdown 命令简介二、shutdown 命令的基本用法三、远程关机与重启四、实际应用

SpringBoot项目启动后自动加载系统配置的多种实现方式

《SpringBoot项目启动后自动加载系统配置的多种实现方式》:本文主要介绍SpringBoot项目启动后自动加载系统配置的多种实现方式,并通过代码示例讲解的非常详细,对大家的学习或工作有一定的... 目录1. 使用 CommandLineRunner实现方式:2. 使用 ApplicationRunne