Updates to key press

Made changes to key press handling.