Thread: locking mouse and keyboard in C

  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
    39,661
    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.

  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,981

  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, 06:27 PM
  3. Game Design Topic #2 - Keyboard or Mouse?
    By TechWins in forum Game Programming
    Replies: 4
    Last Post: 10-08-2002, 03:34 PM
  4. Mouse & keyboard deactivate for some seconds?
    By JoJo in forum Windows Programming
    Replies: 0
    Last Post: 09-08-2001, 12:18 PM
  5. Replies: 0
    Last Post: 09-08-2001, 06:51 AM