+ 1
Can anyone tell how to move cursor using keyboard in turboc editor
3 Answers
+ 4
You can't read the Up key, Down key, etc in the Turbo C terminal as they are virtual keys.
But you may read 'w', 'a', 's' and 'd' for the same, and can try this :
while(true)
{
char c = getch();
if(c=='w') gotoxy(wherex(),wherey()-1);
if(c=='a') gotoxy(wherex()-1,wherey());
if(c=='s') gotoxy(wherex(),wherey()+1);
if(c=='d') gotoxy(wherex()+1,wherey());
}
+ 2
The print cursor? You can't control it from the keyboard, as Turbo C cannot read Virtual Keys in its terminal. You may control it in the program using gotoxy(x,y); defined in conio.h
+ 2
@Kinshuk Vasisht tq for answer but I want to control from keyboard...but gotoxy places it to some position which we specified.