Added distribution term and made window active when launched

added the code distribution termis under BSD Licence and updated code
to make window active when launched and edited docsting of Keyevent
method.