Skip to main content

Start/stop functions/methods with hotkeys!

Project description

Start/stop functions/methods with hotkeys!

$pip install pykeycontrol

from pykeycontrol import StopStart

from time import sleep

def testest2():

    startstop = StopStart(hotkey_enable="ctrl+alt+p",

                          hotkey_disable="ctrl+alt+o",

                          hotkey_hc_exit="ctrl+alt+e", )

    startstop.reset_all_hotkeys().add_hotkeys()

    startstop.stop = False

    while startstop.stop is False:

        print('baba')

        sleep(1)

		

		

		

class NewClass:

    def __init__(self):

        self.startstop = StopStart(hotkey_enable="ctrl+alt+p",

                                   hotkey_disable="ctrl+alt+o",

                                   hotkey_hc_exit="ctrl+alt+e", )

        self.startstop.add_hotkeys()

        self.startstop.stop = False

    def testest(self):

        while self.startstop.stop is False:

            print('baba')

            sleep(1)

			

			

testest2()

baba

baba

baba

baba

baba

HARDCORE EXIT! FTW!

Process finished with exit code 1   #"ctrl+alt+e"



nac=NewClass()

nac.testest()

baba

baba

baba

baba

baba

baba

baba

baba

Disabled! #"ctrl+alt+o"

Project details


Release history Release notifications | RSS feed

This version

0.10

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pykeycontrol-0.10.tar.gz (3.3 kB view hashes)

Uploaded Source

Built Distribution

pykeycontrol-0.10-py3-none-any.whl (4.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page