Add some checks to handle cursor

- Add some checks to handle cursor.
Handle the cut and paste event of context menu

- Handle the cut and paste event of context menu.