locking mouse and keyboard in C

This is a discussion on locking mouse and keyboard in C within the C Programming forums, part of the General Programming Boards category; Hi all, I was wondering how you can disable the mouse and certain keys in C. I want to write ...

  1. #1
    noob lepricaun's Avatar
    Join Date
    Jul 2004
    Posts
    26

    locking mouse and keyboard in C

    Hi all,

    I was wondering how you can disable the mouse and certain keys in C.
    I want to write a program which has a lock. Meaning: if you enter the correct password, the mouse and keyboard are reacting again, but as long as it is locked, only the character keys and the <enter> key are possible to use, this to enter the password.

    I know these types of programs exist, but I want to write one for my own..

    Thanks in advance for replying
    The path of access leads to the tower of wisdom...
    __________________________________________________ ___________________

    Code:
    
    #include <stdio.h>
    
    int main(void)
    {
            const char buf[17]="Hello everybody!";
    	printf("%s\n",buf);
            return 0;
    }
    

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,824
    You need to say which OS/Compiler you're using
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    noob lepricaun's Avatar
    Join Date
    Jul 2004
    Posts
    26
    sorry, it is for windows 2k / XP, and i'm using dev-c++, i already know there are some API's that will do that, found the link here,
    but it isn't clear to me how they work
    The path of access leads to the tower of wisdom...
    __________________________________________________ ___________________

    Code:
    
    #include <stdio.h>
    
    int main(void)
    {
            const char buf[17]="Hello everybody!";
    	printf("%s\n",buf);
            return 0;
    }
    

  4. #4
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,701

  5. #5
    noob lepricaun's Avatar
    Join Date
    Jul 2004
    Posts
    26
    thanks, i'll have a look at it
    The path of access leads to the tower of wisdom...
    __________________________________________________ ___________________

    Code:
    
    #include <stdio.h>
    
    int main(void)
    {
            const char buf[17]="Hello everybody!";
    	printf("%s\n",buf);
            return 0;
    }
    

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Detecting keyboard and mouse in linux
    By sameer.nalwade in forum C Programming
    Replies: 3
    Last Post: 11-22-2008, 04:24 AM
  2. GLUT keyboard and mouse func separated
    By krappa in forum Game Programming
    Replies: 1
    Last Post: 04-20-2005, 07:27 PM
  3. Game Design Topic #2 - Keyboard or Mouse?
    By TechWins in forum Game Programming
    Replies: 4
    Last Post: 10-08-2002, 04:34 PM
  4. Mouse & keyboard deactivate for some seconds?
    By JoJo in forum Windows Programming
    Replies: 0
    Last Post: 09-08-2001, 01:18 PM
  5. Replies: 0
    Last Post: 09-08-2001, 07:51 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21