how can i do it, like how can i have it so it knows if have pushed like the right arrow instead of having them type r and enter it...
how can i do it, like how can i have it so it knows if have pushed like the right arrow instead of having them type r and enter it...
In order of learned:
HTML - Mastered
CSS - Enough to use
SSI - Mastered
PHP - Advanced
C/C++ - Current Project
getch() or virtual keys, read the FAQ.
Here's a windows method that's relatively simple:
-PreludeCode:#include <iostream> #include <climits> #include <windows.h> int main() { short esc = 0; while ( !esc ) { esc = GetAsyncKeyState ( VK_ESCAPE ); if ( GetAsyncKeyState ( VK_UP ) & SHRT_MAX ) std::cout<<"Up arrow is pressed\n"; else if ( GetAsyncKeyState ( VK_DOWN ) & SHRT_MAX ) std::cout<<"Down arrow is pressed\n"; else if ( GetAsyncKeyState ( VK_LEFT ) & SHRT_MAX ) std::cout<<"Left arrow is pressed\n"; else if ( GetAsyncKeyState ( VK_RIGHT ) & SHRT_MAX ) std::cout<<"Right arrow is pressed\n"; std::cout.flush(); } return EXIT_SUCCESS; }
My best code is written with the delete key.
thanx prelude, thats exactly what i need
In order of learned:
HTML - Mastered
CSS - Enough to use
SSI - Mastered
PHP - Advanced
C/C++ - Current Project