Advertisement

Help me killing the mouse pointer pls...

Started by May 24, 2002 07:45 PM
1 comment, last by Ragadast 22 years, 5 months ago
I know that after I check with kbhit() and getch() it returns a int. When you hit , it returns '\r', but what about backspace and the others? How do I check if they were hitted? I mean how do I know when, for example, the backspace button was hitted. It should return something, but I don't know what it does return. Ah, and I almost forgot, how do you get rid of the mouse pointer when you are using kbhit()? (I'm using BC++ under DOS). [edited by - Ragadast on May 24, 2002 8:56:50 PM] [edited by - Ragadast on May 25, 2002 9:00:11 PM]
This seems like a nice little explaination of several things that should help. Then you can use a program like the following:


    int main(int argc, char *argv[]){   char c = getch();   while (c != 27)   {      if (!c)      {         c = getch();         printf("0 %hu\n", c);      }      else         printf("%hu\n", c);      c = getch();   }   return(0);}    


That will run until you hit escape. For each key you press it will print a decimal number telling you the code for that key. So backspace, bs in the ascii chart, will give you an 8. Keys like f1 don't have ascii codes so you get an extended code. You will get a 0 first from getch() telling you it is an extended code and then the code telling you which key.

As for getting rid of the mouse pointer click on the button at the top to make the DOS window full screen. The mouse pointer will disappear. You can set properties in explorer for the exe to make it always run full screen. As long as you are running in a window you are effectively stuck with having a mouse pointer.

[edited by - LilBudyWizer on May 25, 2002 2:58:25 AM]
Keys to success: Ability, ambition and opportunity.
Advertisement
Thanks, i haven''t tested it all yet, but about making the mouse pointer disappear, It just disappears if I do not use full screen, when I run the program from DOS (it runs it in full screen mode), the mouse pointer does always appear.

This topic is closed to new replies.

Advertisement