in reply to tty in Tk app
You can use the Key or KeyPress descriptor and bind it to an event just like a button. Just eval the input to a system call.
I technically think that Tk may be a bad method to accomplish what you are trying to do.. It would probably be a better Idea to install Apache and run it through a web page via CGI using passwork protection.
If you need help with the Syntax..
http://www.foo.be/docs/tpj/issues/vol2_3/tpj0203-0006.html