Updated for touch

resolved issues between touch control and keyboard control