Last active
September 14, 2019 17:50
-
-
Save RakeshChouhan/e1e7aeb5aa04a95f98b7bf0da1c241f4 to your computer and use it in GitHub Desktop.
Python program to register keyboard shortcuts for the selected clipboard text
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Python program to create shortcuts