Skip to content

Thanks for the inspiration and code! #21

@PySimpleGUI

Description

@PySimpleGUI

Hiya David. I wanted to take a moment to say "thank you" for being an inspiration and also for providing code that I used to make a new PySimpleHotKey program.

It's far from perfect, but it's turning out to be making a big impact already on my efficiency and abilities.

It's one thing to have a hotkey program that enables you to launch programs, etc, but it's entirely different when you've got complete control of that program and the actions. Being able to call PySimpleGUI code directly from the HotKey manager is AWESOME. Same with being able to control how it operates in the system tray.

There's a public version of it posted, and there's a private version I use. This is the private table settings that I'm using:

# Defintions of the hotkeys
DOCSTRING_SHORTCUT = 'ctrl+alt+shift+d'
DOCSTRING_TYPES_SHORTCUT = 'ctrl+alt+shift+f5'
KOLYA_SHORTCUT = 'alt+shift+k'
MILKA_SHORTCUT = 'ctrl+alt+shift+m'
POPUP_SHORTCUT = 'ctrl+alt+shift+f6'

# Special keys for PySimpleGUI to take action
POPUP_EMOJIS = '-POPUP EMOJIS-'

# dictionary that maps a hotkey to an action
hotkey_dict = {
    DOCSTRING_SHORTCUT :        (lambda :  sg.execute_py_file(r'DocstringTools\AlignDocstrings.py', '--clipboard', cwd='.')),
    DOCSTRING_TYPES_SHORTCUT :  (lambda :  sg.execute_py_file(r'DocstringTools\AddTypesToDocstring.py', cwd='.')),
    KOLYA_SHORTCUT:             (lambda: keyboard.write('Коля')),
    MILKA_SHORTCUT:             (lambda: keyboard.write('Милка')),
    POPUP_SHORTCUT:             (lambda: show_popup_at_cursor(POPUP_EMOJIS))
                }

You did a fantastic job of showing me a nice design pattern as well as providing a way to specify and parse the keystrokes.

I'm using this program to:

  • Insert text
  • Launch some utilities that work on the clipboard
  • Show a simple emoji chooser (sort of like pingmote, but much more direct)

The point I want to make is that anyone, regardless of skill level, can be a contributor to the greater good of the programming world. You don't have to be someone with decades of experience to have a substantial and positive impact. You did this with your pingmote program. Thank you for creating it and making it available to everyone.

I'll close with an example of your hotkey inspired emoji chooser that was used to add the little guy at the bottom:

46rLq4V29z

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions