adding wrapping for cursor keys in all modes