I am developing a program to control a machine that will have only a keypad connected. I am using Python 2.7
and Tkinter 8.5
. I am using OptionMenu
s to allow user to do setup on machine.
When I run under Windows I am able to use arrow keys on keypad to traverse thru drop down list, then use key pad enter to pick option. This is not working on Linux (Debian Wheezy).
How do I bind KP_Enter
to behave as return key?
import Tkinter
def c(self, event):
event.b[".keysym"] = "<<space>>"
print "button invoked"
t = Tkinter.Tk()
b = Tkinter.OptionMenu(t, ".500", ".510", ".520",
".550", ".560", ".570", ".580", command=c)
t.bind("<KP_Enter>", c)
e = Tkinter.Entry()
e.pack()
b.pack(anchor=Tkinter.E)
t.mainloop()