You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

键盘C/Q键损坏的AutoHotkey脚本修复及功能适配咨询

AutoHotkey Script Solution for Broken C/Q Keys

Got it, let's fix this step by step. Your original script had gaps with modifier key handling and conflicting hotkeys, so here's a complete solution that covers all your requirements:

; 1. Right Ctrl + S/K to send C/Q (supports Shift/CapsLock)
#If GetKeyState("RCtrl", "P") && !GetKeyState("LCtrl", "P")
>^s::Send {Blind}c
>^k::Send {Blind}q
#If

; 2. Left Ctrl + Right Ctrl + S to trigger Ctrl+C (copy)
<^>^s::SendInput ^c

Breakdown of How This Works:

  • #If GetKeyState("RCtrl", "P") && !GetKeyState("LCtrl", "P"): This directive restricts the following hotkeys to activate only when Right Ctrl is pressed and Left Ctrl is not. This eliminates interference with your Left Ctrl+S/K shortcuts (like Ctrl+Save or Ctrl+Close tab) — they’ll work exactly as normal now.
  • >^s::Send {Blind}c / >^k::Send {Blind}q:
    • >^ explicitly targets the Right Ctrl modifier.
    • The {Blind} parameter preserves the state of other modifiers (Shift, CapsLock):
      • Press Right Ctrl + Shift + S → outputs uppercase C
      • Press Right Ctrl + S with CapsLock on → outputs uppercase C
      • Normal Right Ctrl + S → outputs lowercase C, matching your original need.
  • <^>^s::SendInput ^c: This hotkey triggers when both Left and Right Ctrl are held plus S, sending the standard Ctrl+C copy command. SendInput ensures fast, reliable execution.

Quick Test Checklist:

  1. Save this as a .ahk file and run it with AutoHotkey.
  2. Verify all cases work:
    • Right Ctrl + S → outputs C (case respects Shift/CapsLock)
    • Right Ctrl + K → outputs Q (case respects Shift/CapsLock)
    • Left Ctrl + S → triggers normal Ctrl+Save
    • Left Ctrl + K → triggers normal Ctrl+K (e.g., close browser tab)
    • Left Ctrl + Right Ctrl + S → triggers Ctrl+Copy
    • All other Left Ctrl combinations (Ctrl+A, Ctrl+V, etc.) stay functional

内容的提问来源于stack exchange,提问作者Xwtek

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.09 07:47:38