View Full Version : Graphics???
Hey I'm new to C++, and I have a question.
I have gotten my hands on graph.h
I wanted to know how to be able to move objects using the arrow keys.
I have been able to move things in a vector with the conio.h getch() command, but it doesn't work in graphics...
Does anyone know how to do this?
For that You gotta Trap Keys.
Understand some concepts:
first of all all the data thats is typed goes to a keyboard buffer,through port 0x60.the data that forms the input through keyboard.
each time you press a key there are two things that are generated.
for each key there is an individual scan code.but ascii codes may be common.
here are few basic scan codes of the keys that you frequently require in your program.(all of these keys have ascii code=0)
3)UP ARROW KEY 72
4)DOWN ARROW KEY 80
and here's the fucntion that you can use to help yourself out.(you willl be able to use this in graphics.,provided you have sufficient knowledge on how to define your own outtextxy(x,y,"XXXX") like functions.
union REGS i,o;
i.h.ah=0; /*SERVICE ROUTINE ZERO.*/
int86(21,&i,&o); //interrupt 21 inregs and outregs
the above stuff can be grasped easily i hope.
currently i am busy with my Z-DOS launch so i may may not be able to reply to your querries on time,but i will if i find some time.(which after a couple of days i hope i will;))
also you can use the above stuff to make a GUI without a mouse.
But mouse makes it all more flexible.
are you familiar?
I haven't yet tried it but i'l ltake a look. Thanks!
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.