Exemplo n.º 1
0
                        print("type is {}, key is [{}], action is {}".format(
                            ACTION_TYPE[typeForAction], key, action))

                    #윈도우 키입력 신호 발생
                    if ACTION_TYPE[typeForAction] == "KEYIN":
                        PressKey(int(action, 0))
                        ReleaseKey(int(action, 0))

                    #지정된 명령어 실행
                    elif ACTION_TYPE[typeForAction] == "EXEC":
                        subprocess.Popen(
                            action, creationflags=subprocess.DETACHED_PROCESS)

                    #노트 연주
                    elif ACTION_TYPE[typeForAction] == "NOTE":
                        lp.playNote(int(action, 0), 112, 0.1)

                    #음성파일 연주
                    elif ACTION_TYPE[typeForAction] == "WAVE":
                        winsound.PlaySound(action, winsound.SND_FILENAME)

                    #현재 프로그램 기능으로 사용할 항목
                    elif ACTION_TYPE[typeForAction] == "SPECIAL":
                        if key == "15336":
                            doloop = False
                            raise KeyboardInterrupt
                    else:
                        pass

                except KeyError as e:
                    if DEBUG is True: