Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /////////////////////////////////////////////////////////////////
- //Cursor controls
- case 'H': //set Caret position to top left corner of screen
- xCaret=0;
- yCaret=0;
- break;
- case 'A': //move caret 1 row up unless it is on the first line
- if(yCaret>0)
- --yCaret;
- break;
- case 'B': //move caret 1 row down unless it is on the last line
- if(yCaret<cyBuffer)
- ++yCaret;
- break;
- case 'C': //move caret 1 column forward unless it is on the last column
- if(xCaret < cxBuffer)
- ++xCaret;
- break;
- case 'D': //move caret 1 column backwards unless it is on the first column
- if(xCaret > 0)
- --xCaret;
- break;
- //Erasing Text
- case 'K': //Erase from the current cursor position to the end of the current line
- tmpXCaret = xCaret;
- xCaret = cxBuffer;
- while(xCaret != tmpXCaret){
- SendMessage(hwnd, WM_CHAR, '\b', 1);
- }
- break;
- case 'J': //Erase the screen from the current line down to the bottom of the screen
- tmpYCaret = yCaret;
- yCaret = cyBuffer;
- while(yCaret != tmpYCaret){
- if(xCaret == 0)
- yCaret--;
- else
- SendMessage(hwnd, WM_CHAR, '\b', 1);
- }
- break;
- ////////////////////////////////////////////////////////////////////
Add Comment
Please, Sign In to add comment