def SystemHotkeys(): global toggle if keyboard.is_pressed("f8"): print("Kernel running " + str(Kernel.running)) time.sleep(0.5) if keyboard.is_pressed("f3"): CrashHandler.CrashHandler("User_Started_Screen_Of_Death", True) if keyboard.is_pressed("f4"): Kernel.Prepare_For_shutdown() Kernel.Shutdown() if keyboard.is_pressed("f5"): try: Doc = open("Cos/doc.txt", "r") Doc_Contents = Doc.read() print(Doc_Contents) Doc.close() except FileExistsError: print("Could not find file") time.sleep(0.5) if keyboard.is_pressed("f2"): if toggle: toggle = False print("hotkey input") time.sleep(0.5) if not toggle: toggle = True print("text input") Kernel.Do_Input = True if toggle: Kernel.Read_Keyboard()
def ScreenOfDeath(Text, Error_Code): print(colored(str(Text), "red"), Error_Code) input() Kernel.Prepare_For_shutdown() Kernel.Shutdown()