Capslock-CopyPaste is a productivity-boosting AutoHotkey v2 script that transforms the often-unused CapsLock key into a smart Copy & Paste shortcut — with visual feedback and intelligent clipboard protection.
| Action | Shortcut | What It Does |
|---|---|---|
| 📋 Copy | Single press CapsLock |
Copies selected text/files (Ctrl+C) |
| 📌 Paste | Double press CapsLock |
Pastes clipboard content (Ctrl+V) |
| 🔠 Toggle CapsLock | Shift + CapsLock |
Turns original CapsLock on/off |
| 🔄 Untoggle CapsLock | CapsLock (while toggled on) |
Turns CapsLock back off gracefully |
Every action shows an auto-vanishing tooltip near your cursor so you always know what happened:
| Tooltip | Duration | Meaning |
|---|---|---|
| 📋 Copied! | 500ms | ✅ Copy successful |
| 📌 Pasted! | 500ms | ✅ Paste successful |
| 🚫 Blocked! | 800ms | |
| ❌ Nothing to paste! | 800ms | ❌ Clipboard is empty |
| ❌ Nothing copied! | 800ms | ❌ No content was selected to copy |
The script intelligently prevents unwanted clipboard content:
- 🚫 Blocks browser internal URLs — Accidentally copying
about:blank,chrome://newtab,edge://, etc. won't overwrite your clipboard - 🖼️ Preserves all clipboard formats — Uses
ClipboardAll()to protect images, files, and rich-text (not just plain text) - 🔄 Auto-restore — If a copy is blocked or fails, your previous clipboard content is automatically restored
about:blank, about:newtab, chrome://, edge://, brave://, opera://, vivaldi://, firefox:
Uses a precise 300ms timer with A_PriorHotkey and A_TimeSincePriorHotkey to accurately distinguish between single and double taps — no accidental triggers. A KeyWait guard ensures the physical key is fully released before sending Ctrl+C, preventing modifier interference.
Automatically requests Administrator privileges on startup so the shortcut works across all applications, including elevated system windows.
When CapsLock is toggled on via Shift + CapsLock, pressing CapsLock alone will not trigger copy/paste — it will simply turn CapsLock back off. This prevents accidental clipboard operations while typing in uppercase.
⚠️ You need AutoHotkey v2.0+ installed on your Windows PC.
- 📥 Download the
Capslock-CopyPaste.ahkfile from this repository ▶️ Double-click the file to run it — it will auto-request admin privileges- ✅ Done! Start using
CapsLockas your Copy/Paste key
Want it to run automatically when Windows starts?
- Press
Win + Ron your keyboard - Type
shell:startupand press Enter - Copy the
Capslock-CopyPaste.ahkfile into the folder that opens - That's it! The script will now start automatically on every boot
💡 Tip: Make sure the script has Administrator privileges for it to work in all windows. You can create a shortcut to the
.ahkfile, go to Properties → Shortcut → Advanced, and check "Run as administrator".
┌──────────────────────┐
│ Press CapsLock │
└──────────┬───────────┘
│
┌──────────▼───────────┐
│ Is CapsLock │
│ toggled ON? │
└──────────┬───────────┘
│ │
YES NO
│ │
┌────────▼──────┐ ┌──▼───────────────┐
│ Turn it OFF │ │ Wait 300ms... │
│ (no copy/ │ │ Is it a double │
│ paste) │ │ tap? │
└───────────────┘ └──────────┬───────┘
│ │
NO YES
│ │
┌────────▼──────┐ ┌──▼───────────┐
│ 📋 COPY │ │ 📌 PASTE │
│ (Ctrl+C) │ │ (Ctrl+V) │
│ │ │ │
│ → KeyWait │ │ → Check if │
│ → Check if │ │ clipboard │
│ blocked │ │ is empty │
│ → Tooltip │ │ → Tooltip │
└───────────────┘ └───────────────┘
Capslock-CopyPaste/
├── 📄 Capslock-CopyPaste.ahk ← Main script
└── 📖 README.md ← You are here!
- 📂 Repository: github.com/mogdho/Capslock-CopyPaste
Mogdho Paul
🔗 GitHub: github.com/mogdho 📂 Source: Capslock-CopyPaste