added functionality for left, right, and tab keys