1

The code

import time,os, keyboard
framedist = 3 #x Seconds, not x milliseconds
version = "1.0 prototype"
frames=[]

def frame(action):
    print(action)
    time.sleep(framedist)
    os.system("cls")
def createframe(action):
    frames.append(action)

print("WELCOME TO ASCII ANIMATON - prototype")
print("           PRESS ENTER                ")
print("\n\n\n\n\n\n\n\n\n\n\n\n\n\nHatcap St.")
keyboard.wait("enter")
os.system("cls")


while True:
    print("ANIMATION EDITOR    F5: Change framedist")
    print("")
   

part that doesn't work

   if keyboard.is_pressed("f5"):
        os.system("cls")
        framedist = int(input("Enter a number: "))

If F5 is pressed it's suppposed to give a input to a user, but doesn't work

C.Flance
  • 17
  • 1
  • 5
  • 3
    Which operating system? If Linux, which GUI manager and framework? Often, a keystroke that's captured by the larger OS can't be read by applications at all unless they've done the work to set up direct input capture (f/e, running in full screen mode, but that's OS-specific). And when your question is about a library that doesn't come with Python itself, be sure you specify where that library came from. – Charles Duffy Apr 17 '21 at 20:51
  • ...I'm assuming this is the library https://pypi.org/project/keyboard/ and adjusting tagging appropriately. Which OS this is still matters. – Charles Duffy Apr 17 '21 at 20:53
  • @CharlesDuffy Windows – C.Flance Apr 17 '21 at 20:56
  • Could you edit your question to make sure you have a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example)? We're going to need the context this is in (for example a loop, a function that isn't called, etc). – Jasmijn Apr 17 '21 at 20:58

0 Answers0