Touch based Input

Touch based input is now added along with preprocessor directives for
detecting touch based and key based devices, also some refactoring is
done.