Thread: Some suggestions about keyboard input ?

  1. #1
    Registered User
    Join Date
    Feb 2009

    Some suggestions about keyboard input ?

    At my university, me and a couple of friends were given a task to write remote control application, something like radmin but it should be more simple. I am working on the part getting the keys the user types on the keyboard, something like keylogger. The whole thing must be done in PURE C.
    The problem is this: How can i make keylogger-like program in C ? I know that there are some libraries for C++, i looked at some API at the microsoft page, but is there some other way to do it ? And if there isn't, can I implement those APIs in my C code ?

  2. #2
    Registered User
    Join Date
    Sep 2004
    You don't need a keylogger type application for this. When your remote control application has the focus, it will get all keyboard and mouse input. The only thing a keylogger would do is allow you to get keyboard input even when your application does not have the focus, and this doesn't make sense.

  3. #3
    Registered User
    Join Date
    Feb 2009
    I know what you are trying to say, but the project for me is to build a keylogger in pure C.
    I also know that i can use GetKeyboardState() and the similar APIs in C++, but i just want to know: is there some other way ?

  4. #4
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    segmentation fault
    As bithub just pointed out, if you want to write an app ala radmin, you will be completely wasting your time trying to figure out how to write a keylogger, since just using the normal IO methods will work fine.

    This is like saying, "I want to go to the store", and when someone says, "Well, you could use your car, it's sitting outside," you say "No, no, first I need to build a snowmobile from available parts and find a route using the river that will get me there without falling thru the ice". One the one hand, you could be at the store already, on the other, you will be lucky to get out of the house this week. And, by the time you are done, you could submit your code to a "most ridiculous solution to a simple problem" contest. Honestly.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How do I input an unbuffered character via the keyboard???
    By Michael_in_Ohio in forum C Programming
    Replies: 1
    Last Post: 03-23-2008, 12:00 PM
  2. Using low-level keyboard for input
    By hdragon in forum C++ Programming
    Replies: 25
    Last Post: 12-24-2007, 02:13 PM
  3. Stealing Keyboard input
    By zort15 in forum C++ Programming
    Replies: 2
    Last Post: 04-16-2007, 02:22 PM
  4. Catching All Keyboard Input
    By nigma in forum C Programming
    Replies: 6
    Last Post: 06-11-2005, 02:35 AM
  5. Keyboard Input
    By Unregistered in forum C++ Programming
    Replies: 5
    Last Post: 07-29-2002, 11:41 AM