Skip to main content

shortcutkey

一个功能强大的快捷键管理工具,允许用户通过自定义快捷键快速打开、切换和管理指定的软件。

功能特性

  • 通过自定义快捷键快速打开指定软件
  • 智能窗口管理:当对应的程序已处于前台时,按快捷键将其最小化
  • 命令行交互式配置快捷键,支持搜索和分页浏览应用列表
  • 应用选择界面支持上下箭头键快速切换页面
  • 多语言支持,提供友好的用户界面
  • 开机自启动功能,无需手动启动
  • 后台运行模式,不干扰正常工作
  • 跨平台支持,兼容Windows、macOS和Linux
  • 详细的日志记录,便于问题排查

安装

pip3 install shortcutkey

权限授权提醒

macOS系统

在首次运行程序时,macOS会请求以下权限,请务必授予,否则程序可能无法正常工作:

  • 辅助功能权限:用于监听全局快捷键
  • 屏幕录制权限:用于检测当前活动窗口(部分功能需要)

请按照以下步骤授予权限:

  1. 打开系统偏好设置 → 安全性与隐私
  2. 选择"隐私"标签页
  3. 在左侧列表中选择"辅助功能",点击锁图标解锁并添加应用
  4. 在左侧列表中选择"屏幕录制",点击锁图标解锁并添加应用
  5. 重新启动应用以应用权限更改

Windows系统

  • 以管理员身份运行程序,确保快捷键监听功能正常工作

Linux系统

  • 可能需要安装xdotool工具以支持窗口管理功能
    # Ubuntu/Debian
    sudo apt-get install xdotool
    
    # CentOS/Fedora
    sudo yum install xdotool
    

使用方法

1. 启动程序

shortcutkey

程序将在后台运行,监听配置的快捷键。您可以在任务管理器或活动监视器中看到它在运行。

2. 配置快捷键

首次运行时,程序会引导您配置快捷键。您也可以通过以下方式重新配置:

shortcutkey --config

在配置界面中,您可以:

  • 通过输入应用程序的数字编号选择应用
  • 为每个应用指定自定义快捷键
  • 管理已配置的快捷键(添加、修改或删除)

3. 查看帮助

shortcutkey -h

配置文件

配置文件位于用户目录下的 .shortcutkey/config.yaml。您可以手动编辑此文件来修改快捷键配置。

日志文件位于用户目录下的 .shortcutkey/log/ 目录中,可以用于排查问题。

高级功能

智能窗口管理

当您按下快捷键时,如果对应的程序已经在前台运行,程序将自动将其最小化,实现快速切换和窗口管理。

开机自启动

程序提供开机自启动功能,您可以在配置过程中选择启用或禁用。

多语言支持

程序支持多种语言,将根据系统语言自动选择最合适的界面语言。

故障排除

快捷键无响应

  1. 检查是否已授予必要的系统权限(特别是macOS系统)
  2. 确认快捷键没有被其他程序占用
  3. 查看日志文件,了解可能的错误信息

窗口最小化功能不正常

  1. Windows系统:确保已安装pywin32库
  2. Linux系统:确保已安装xdotool工具
  3. 某些应用程序可能有特殊的窗口管理行为,可能不支持自动最小化

支持的系统

  • Windows 7/8/10/11
  • macOS 10.14及以上
  • Linux(主要发行版)

许可证

MIT

Metadata

Release files for shortcutkey 5.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for shortcutkey 5.0.0
File Size Uploaded
shortcutkey-5.0.0.tar.gz 30.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for shortcutkey 5.0.0
File Interpreter ABI Platform
shortcutkey-5.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 63.8 kB

Release files / shortcutkey-5.0.0.tar.gz

Download URL shortcutkey-5.0.0.tar.gz
Size 30.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ff587db331ac7c68da41e979195b6f5eaf73e57b87e797b6f40daf91d8837666
BLAKE2b-256 checksum
How to use checksums
d6d768827aca3f80a68444bfbd1e97b98f5a41812965437c34d984d5cdbfcf42
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.2

Release files / shortcutkey-5.0.0-py3-none-any.whl

Download URL shortcutkey-5.0.0-py3-none-any.whl
Size 33.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
21cec52570a7c425e6967c1d8da2aaa1d14ba60a9ec312d3d715a9aee1008c67
BLAKE2b-256 checksum
How to use checksums
6b9bbdd5f8984163c48ad2b5823b7a4496ffdb69919a00bec8e848fc37d71075
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.2

Release history Release notifications | RSS feed

This release

5.0.0 This release

2 release files

4.0.0

2 release files

3.0.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page