示例#1
0
def main():
    
    print ("Voice2Keyboard BETA. Written by Sinan Cetinkaya")
    print ("Check the config.ini for settings")
    print ("Translated to %s by %s" % (LANG, config.get(LANG, 'translator')))
    print (config.get(LANG, 'Registering_hotkeys'))
    GlobalHotKeys.register(HOTKEY_LISTEN, GlobalHotKeys.MOD_CONTROL | GlobalHotKeys.MOD_ALT, listen)
    GlobalHotKeys.register(HOTKEY_QUIT, GlobalHotKeys.MOD_CONTROL | GlobalHotKeys.MOD_ALT, quit)
    print (config.get(LANG, 'Ready'))
    GlobalHotKeys.listen()
示例#2
0
def main():
    logo()
    print("Checking for updates...")

    # check for update
    check_for_update()

    # P will stop message loop
    GlobalHotKeys.register(GlobalHotKeys.VK_P, "VK_P", 0, False)

    global versionCheck
    quitpls = 0
    start = 0
    while quitpls == 0:
        while start == 0:
            system('cls')
            logo()
            print(versionCheck)
            button_assignmend()
            print(
                "\nWrite 1-11 to assign a chatcode to F1-F11, 'c' for other keys, 's' to save, 'l' to load"
            )
            print(
                "'g' to start, 'q' to quit, when the chatbox only sort of 'blinks' press 'b'\n"
            )

            inputUser = input()
            if inputUser == "s":
                save_to_file()
            elif inputUser == "l":
                load_from_file()
            elif inputUser == "g":
                start = 1
            elif inputUser == "q":
                start = 1
                quitpls = 1
            elif inputUser == "b":
                configure_time()
            elif inputUser == "c":
                customHotkey()
            elif is_int(inputUser) and int(inputUser) > 0 and int(
                    inputUser) < 12:  # F12 not working
                liorkp("VK_F{}".format(inputUser))

            # start main loop
            if quitpls == 0 and start == 1:
                start = 0
                clipboard_tmp = pyper_paste(
                )  # save temporarly current clipboard
                GlobalHotKeys.listen()
                pyper_copy(clipboard_tmp)  # restore clipboard after spamming
        start = 1
     elif inputUser == "1":
         liorkp(1)
     elif inputUser == "2":
         liorkp(2)
     elif inputUser == "3":
         liorkp(3)
     elif inputUser == "4":
         liorkp(4)
     elif inputUser == "5":
         liorkp(5)
     elif inputUser == "6":
         liorkp(6)
     elif inputUser == "7":
         liorkp(7)
     elif inputUser == "8":
         liorkp(8)
     elif inputUser == "9":
         liorkp(9)
     elif inputUser == "10":
         liorkp(10)
     elif inputUser == "11":
         liorkp(11)
     """ F12 NOT working???
     elif inputUser == "12":
         liorkp(12)
     """
     # start main loop
     if quitpls == 0 and start == 1:
         start = 0
         GlobalHotKeys.listen()
 start = 1
from globalhotkeys import GlobalHotKeys


@GlobalHotKeys.register(GlobalHotKeys.VK_F1, GlobalHotKeys.MOD_SHIFT)
def hello_world():
    print "Hello World!"


@GlobalHotKeys.register(GlobalHotKeys.VK_F2)
def hello_world_2():
    print "Hello World again?"


# Q and ctrl will stop message loop
GlobalHotKeys.register(GlobalHotKeys.VK_Q, 0, False)
GlobalHotKeys.register(GlobalHotKeys.VK_C, GlobalHotKeys.MOD_CTRL, False)

# start main loop
GlobalHotKeys.listen()
示例#5
0
def main():
    print('请按Shift + F1 开始截图')
    thread = threading.Thread(target=app.run, args=('0.0.0.0', '5000'))
    thread.start()
    GlobalHotKeys.listen()