如何在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上使用qemu安装ubuntu24.04服务器的详细指南

《在Windows上使用qemu安装ubuntu24.04服务器的详细指南》本文介绍了在Windows上使用QEMU安装Ubuntu24.04的全流程:安装QEMU、准备ISO镜像、创建虚拟磁盘、配置... 目录1. 安装QEMU环境2. 准备Ubuntu 24.04镜像3. 启动QEMU安装Ubuntu4

Windows下C++使用SQLitede的操作过程

《Windows下C++使用SQLitede的操作过程》本文介绍了Windows下C++使用SQLite的安装配置、CppSQLite库封装优势、核心功能(如数据库连接、事务管理)、跨平台支持及性能优... 目录Windows下C++使用SQLite1、安装2、代码示例CppSQLite:C++轻松操作SQ

一文详解MySQL如何设置自动备份任务

《一文详解MySQL如何设置自动备份任务》设置自动备份任务可以确保你的数据库定期备份,防止数据丢失,下面我们就来详细介绍一下如何使用Bash脚本和Cron任务在Linux系统上设置MySQL数据库的自... 目录1. 编写备份脚本1.1 创建并编辑备份脚本1.2 给予脚本执行权限2. 设置 Cron 任务2

基于Python实现一个Windows Tree命令工具

《基于Python实现一个WindowsTree命令工具》今天想要在Windows平台的CMD命令终端窗口中使用像Linux下的tree命令,打印一下目录结构层级树,然而还真有tree命令,但是发现... 目录引言实现代码使用说明可用选项示例用法功能特点添加到环境变量方法一:创建批处理文件并添加到PATH1

MyBatis Plus 中 update_time 字段自动填充失效的原因分析及解决方案(最新整理)

《MyBatisPlus中update_time字段自动填充失效的原因分析及解决方案(最新整理)》在使用MyBatisPlus时,通常我们会在数据库表中设置create_time和update... 目录前言一、问题现象二、原因分析三、总结:常见原因与解决方法对照表四、推荐写法前言在使用 MyBATis

Windows的CMD窗口如何查看并杀死nginx进程

《Windows的CMD窗口如何查看并杀死nginx进程》:本文主要介绍Windows的CMD窗口如何查看并杀死nginx进程问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地... 目录Windows的CMD窗口查看并杀死nginx进程开启nginx查看nginx进程停止nginx服务

Python使用smtplib库开发一个邮件自动发送工具

《Python使用smtplib库开发一个邮件自动发送工具》在现代软件开发中,自动化邮件发送是一个非常实用的功能,无论是系统通知、营销邮件、还是日常工作报告,Python的smtplib库都能帮助我们... 目录代码实现与知识点解析1. 导入必要的库2. 配置邮件服务器参数3. 创建邮件发送类4. 实现邮件

Windows 系统下 Nginx 的配置步骤详解

《Windows系统下Nginx的配置步骤详解》Nginx是一款功能强大的软件,在互联网领域有广泛应用,简单来说,它就像一个聪明的交通指挥员,能让网站运行得更高效、更稳定,:本文主要介绍W... 目录一、为什么要用 Nginx二、Windows 系统下 Nginx 的配置步骤1. 下载 Nginx2. 解压

windows系统上如何进行maven安装和配置方式

《windows系统上如何进行maven安装和配置方式》:本文主要介绍windows系统上如何进行maven安装和配置方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不... 目录1. Maven 简介2. maven的下载与安装2.1 下载 Maven2.2 Maven安装2.

使用Python实现Windows系统垃圾清理

《使用Python实现Windows系统垃圾清理》Windows自带的磁盘清理工具功能有限,无法深度清理各类垃圾文件,所以本文为大家介绍了如何使用Python+PyQt5开发一个Windows系统垃圾... 目录一、开发背景与工具概述1.1 为什么需要专业清理工具1.2 工具设计理念二、工具核心功能解析2.