read keyboard keys
-
hi i have to read the keys pressed in keyboard and send that to a drive. how to receve the keys pressed using vc++. pls help me
Arise Awake Stop Not Till ur Goal is Reached.
-
hi i have to read the keys pressed in keyboard and send that to a drive. how to receve the keys pressed using vc++. pls help me
Arise Awake Stop Not Till ur Goal is Reached.
Hi, If I understand your question correctly, try using one of these _getch, _getche Get a character from the console without echo (_getch) or with echo (_getche).
int _getch( void ); int _getche( void );
Example/* GETCH.C: This program reads characters from * the keyboard until it receives a 'Y' or 'y'. */ #include #include void main( void ) { int ch; _cputs( "Type 'Y' when finished typing keys: " ); do { ch = _getch(); ch = toupper( ch ); } while( ch != 'Y' ); _putch( ch ); _putch( '\r' ); /* Carriage return */ _putch( '\n' ); /* Line feed */ }
_kbhit Checks the console for keyboard input. int _kbhit( void ); Example/* KBHIT.C: This program loops until the user * presses a key. If _kbhit returns nonzero, a * keystroke is waiting in the buffer. The program * can call _getch or _getche to get the keystroke. */ #include #include void main( void ) { /* Display message until key is pressed. */ while( !_kbhit() ) _cputs( "Hit me!! " ); /* Use _getch to throw key away. */ printf( "\nKey struck was '%c'\n", _getch() ); _getch(); }
Or have a look at SendKeys in C++[^] Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's..... :) :)Programm3r My Blog: ^_^
-
hi i have to read the keys pressed in keyboard and send that to a drive. how to receve the keys pressed using vc++. pls help me
Arise Awake Stop Not Till ur Goal is Reached.
If you want to write a
Key Logger
, you might want to start by stating so, and searching Google for Key Logger source code. In the simplest form, you would create a Keyboard Hook (in a DLL), and intercept keyboard events and write them to a file. In the more robust and professional forms, you use a Window Message Hook and pay attention to keyboard-related and mouse-button-related events so that you can correctly capture user input from several sources (on-screen keyboards, enhanced keypads, buttons that trigger text macros, voice recognition/dictation, mouse gesture systems, Accessibility aids/applications like Dasher[^], etc.) I believe that far too many so-called "key loggers" are written by amateurs that think that the only way to get a character into an edit control is by pressing a key on a keyboard. Nothing is worse than bad software masquerading as security. (Well, maybe except for the companies that use them!) Peace!-=- James
Please rate this message - let me know if I helped or not! * * *
If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong!
Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road!
See DeleteFXPFiles -
hi i have to read the keys pressed in keyboard and send that to a drive. how to receve the keys pressed using vc++. pls help me
Arise Awake Stop Not Till ur Goal is Reached.