Aren’t you tired of writing inputs in text mode? Well now you can write them in graphic mode too! Without the input() function!!!!
HOW IT WORKS: Apparently, each key value such as KEY_OK is actually a variable set to an integer! That means you can cycle through a list of numbers and detect if each key is pressed! Isn’t that amazing?
from kandinsky import fill_rect as rct,draw_string as txt from ion import keydown from time import sleep KEYS=[18,"a",19,"b",20,"c",21,"d",22,"e",23,"f",24,"g",25,"h",26,"i",27,"j",28,"k",29,"l",30,"m",31,"n",32,"o",33,"p",34,"q",36,"r",37,"s",38,"t",39,"u",40,"v",42,"w",43,"x",44,"y",45,"z",46," "] WHT,ORG=(255,255,255),(255,150,50) answer="" def dinput(): global answer if keydown(17): answer=answer[:-1] for i in range(len(KEYS)/2): if keydown(KEYS[i*2]): answer+=KEYS[i*2+1] break while True: rct(0,0,320,222,ORG) txt("DrawInput",115,50,WHT,ORG) txt("By squarepoint",90,70,WHT,ORG) txt("Input in graphic mode!",50,100,WHT,ORG) txt(answer,160-len(answer)*5,120,WHT,ORG) sleep(0.05) dinput()