Skip to content

Instantly share code, notes, and snippets.

@RakeshChouhan
Last active September 14, 2019 17:50
Show Gist options
  • Save RakeshChouhan/e1e7aeb5aa04a95f98b7bf0da1c241f4 to your computer and use it in GitHub Desktop.
Save RakeshChouhan/e1e7aeb5aa04a95f98b7bf0da1c241f4 to your computer and use it in GitHub Desktop.
Python program to register keyboard shortcuts for the selected clipboard text
# these hotkey and abbreviation works on all the application like chrome or any other tool
import pyperclip as p
import webbrowser as w
import keyboard as k
k.add_hotkey('shift+w', lambda: w.open_new_tab(p.paste()))
k.add_hotkey('shift+m', lambda: w.open_new_tab('https://www.google.com/search?q='+p.paste()))
# abbreviation
k.add_abbreviation('@help','stackoverflow.com')
@RakeshChouhan
Copy link
Author

Python program to create shortcuts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment