コード例 #1
0
ファイル: v2k.py プロジェクト: sinancetinkaya/Voice2Keyboard
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
コード例 #3
0
def main():
    set_console_size(500, 1000, 80, 25)
    start_adb_server()
    show_devices()
    select_device()

    read_config_file()
    set_console_title()
    adb_start_tcpip_mode()
    show_help()
    # 设置全局截图热键,默认ALT + S
    GlobalHotKeys.register(get_hot_key()['key'],
                           get_hot_key()['mod_key'], adb_screenshot)
    start_global_key_thread()
    start_option()
コード例 #4
0
def set_global_hot_key(hot_key):
    global screenshot_hot_key
    screenshot_hot_key = hot_key
    try:
        t = GlobalHotKeys.register(get_hot_key()['key'],
                                   get_hot_key()['mod_key'], adb_screenshot)
        write_config()
        refresh()
    except:
        print_color('warning', '热键设置失败!')
        help_set_hot_key()
コード例 #5
0
        elif inputUser == 6:
            inputUser = 10
            while 0 > inputUser or 1 < inputUser:
                try:
                    inputUser = int(input("100 CM (1), Return (0)\n"))
                except:
                    print("Invalid Input")
                if inputUser == 0:
                    inputUser = 10
                    break
                elif inputUser == 1:
                    assign_button(button, "100 CM KP", "024f3f0100")


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

quitpls = 0
start = 0
while quitpls == 0:
    while start == 0:
        _ = os.system('cls')
        logo()
        print(version)
        button_assignmend()
        print(
            "Write 1-11 to assign a chatcode to F1-F11, Write 's' to start, 'q' to quit\n"
        )

        inputUser = input()
        if inputUser == "s":
コード例 #6
0
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()
コード例 #7
0
ファイル: gw2chatcodes.py プロジェクト: Smeat/gw2chatlink
    def on_hotkey(key_hist):
        # TODO: proper copy?
        item = Item(item_param.name, item_param.link)
        if item.get_amount() == 0:
            prev_num = 0
            for i in range(1, 4):
                key_str = key_to_str(key_hist[i])
                if not key_str.isdigit():
                    break
                prev_num += int(key_str) * 10**(i - 1)
            item.set_amount(prev_num)
        item_buf.append(item)
        copy_items(item_buf)

    ghk.register(key, func=on_hotkey)


if __name__ == "__main__":

    def esc_event(key_hist):
        item_buf.clear()
        send_notification("GW2 Item", "Buffer cleared")

    ghk.register(keyboard.Key.esc, func=esc_event)
    while running:
        selected_link = select_item(data_dict)
        if selected_link is not None:
            assign_hotkey(selected_link)
            time.sleep(0.1)
コード例 #8
0
ファイル: main.py プロジェクト: fcu-d0591821/MS_BOT
                continue
            if abs(info.dist) < 150:
                KeyPress(info.direction, abs(info.dist) / speed)
                KeyPress(CTRL, randomTime(200, 1500, 3))
        except KeyboardInterrupt:
            exit()
        except Exception as e:
            pass
            #print(e)

thread = threading.Thread(target=bot, daemon=True)
thread.start()

@GlobalHotKeys.register(GlobalHotKeys.VK_F2)
def toggle():
    global running
    global lx
    global ly
    global rx
    global ry

    if running:
        cv2.destroyAllWindows()
    else:
        lx, ly, rx, ry = getGamePos()

    running = not running
    print("Running:", running)

GlobalHotKeys.register(GlobalHotKeys.VK_C, GlobalHotKeys.MOD_CTRL, False)
GlobalHotKeys.listen()
コード例 #9
0
ファイル: v2k.py プロジェクト: sinancetinkaya/Voice2Keyboard
def quit():
    
    print (config.get(LANG, 'Unregistering_hotkeys'))
    GlobalHotKeys.register(HOTKEY_LISTEN, GlobalHotKeys.MOD_CONTROL | GlobalHotKeys.MOD_ALT, None)
    GlobalHotKeys.register(HOTKEY_QUIT, GlobalHotKeys.MOD_CONTROL | GlobalHotKeys.MOD_ALT, None)
    sys.exit(config.get(LANG, 'Bye'))