Guest User

Untitled

a guest
Jan 19th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. /////////////////////////////////////////////////////////////////
  2. //Cursor controls
  3. case 'H': //set Caret position to top left corner of screen
  4. xCaret=0;
  5. yCaret=0;
  6. break;
  7. case 'A': //move caret 1 row up unless it is on the first line
  8. if(yCaret>0)
  9. --yCaret;
  10. break;
  11. case 'B': //move caret 1 row down unless it is on the last line
  12. if(yCaret<cyBuffer)
  13. ++yCaret;
  14. break;
  15. case 'C': //move caret 1 column forward unless it is on the last column
  16. if(xCaret < cxBuffer)
  17. ++xCaret;
  18. break;
  19. case 'D': //move caret 1 column backwards unless it is on the first column
  20. if(xCaret > 0)
  21. --xCaret;
  22. break;
  23.  
  24. //Erasing Text
  25. case 'K': //Erase from the current cursor position to the end of the current line
  26. tmpXCaret = xCaret;
  27. xCaret = cxBuffer;
  28. while(xCaret != tmpXCaret){
  29. SendMessage(hwnd, WM_CHAR, '\b', 1);
  30. }
  31. break;
  32.  
  33. case 'J': //Erase the screen from the current line down to the bottom of the screen
  34. tmpYCaret = yCaret;
  35. yCaret = cyBuffer;
  36. while(yCaret != tmpYCaret){
  37. if(xCaret == 0)
  38. yCaret--;
  39. else
  40. SendMessage(hwnd, WM_CHAR, '\b', 1);
  41. }
  42. break;
  43.  
  44. ////////////////////////////////////////////////////////////////////
Add Comment
Please, Sign In to add comment