Fix bug in parsing key stroke direction.
Update function name.