Added cursor position to maskInput call from the onChange event.
Removed unused call to getCursorPosition from onKeyDown event.