Skip to content

Instantly share code, notes, and snippets.

@dmn001
Last active April 12, 2026 11:56
Show Gist options
  • Select an option

  • Save dmn001/3ec1ffa635524bd1c213dc7f7585199d to your computer and use it in GitHub Desktop.

Select an option

Save dmn001/3ec1ffa635524bd1c213dc7f7585199d to your computer and use it in GitHub Desktop.
A Python script to paste text from clipboard char by char (updated shortcut to backtick)
import keyboard
import pyperclip
import time
def handle_press(event):
# Retrieve clipboard text
text = pyperclip.paste()
if text:
# A tiny delay prevents the OS from mixing the hotkey with the pasted text
time.sleep(0.05)
keyboard.write(text)
# suppress=True here is more likely to work when using the specific key hook
keyboard.on_press_key('`', handle_press, suppress=True)
print("Active. Press '`' to paste. Press 'Ctrl+Esc' to stop.")
# Changed to Ctrl+Esc to avoid potential conflicts with the backtick hook
keyboard.wait('ctrl+esc')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment