I'm guessing the only way to do this is with some third party modules?
You can use them with the GUI toolkits (eg Tkinter).
Gribouillis
Posting Maven
2,786 posts since Jul 2008
Reputation Points: 1,044
Solved Threads: 691
does it say how in the documentation? I tried that with an Entry(self) and when I tried stating if the variable I had assigned to it == F1 "how ever I hit the F1 button" nothing happened, it just wouldn't accept the input from the key "while writing the program, not user end."
Here is an exemple, adapted from an old forum post, to show you how to bind the F1 key
from functools import partial
from Tkinter import *
def fonction(text, event):
text.insert(END,'ok ')
def bind(wid):
wid.bind('<F1>',partial(fonction, wid))
def unbind(wid):
wid.unbind('<F1>')
root = Tk()
text = Text(root)
text.pack()
b1 = Button(root,text="Bind",command=partial(bind, text))
b2 = Button(root,text="Unbind",command=partial(unbind, text))
b1.pack()
b2.pack()
b1.invoke()
text.focus_set()
root.mainloop()
Also read this http://www.pythonware.com/library/tkinter/introduction/events-and-bindings.htm
Gribouillis
Posting Maven
2,786 posts since Jul 2008
Reputation Points: 1,044
Solved Threads: 691