1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: Full keyboard capture in vb

Discussion in 'Software Development' started by Wondered2001, Oct 9, 2008.

Thread Status:
Not open for further replies.
Advertisement
  1. Wondered2001

    Wondered2001 Thread Starter

    Joined:
    Oct 9, 2008
    Messages:
    7
    Hi there, I've looked and cant find anything...maybe one of you do. Is there a way to have a VB program capture ALL keyboard input? I wrote a program to prevent my kids from randomly clicking things, which works unless they get the windows key which bypasses the whole point of the program. Eventually I will rewrite in VC++ so any help towards that would be appreciated as well
     
  2. -Fabez-

    -Fabez-

    Joined:
    Jul 28, 2008
    Messages:
    1,899
    Why do you want to make a global keyboard hook ?
     
  3. Wondered2001

    Wondered2001 Thread Starter

    Joined:
    Oct 9, 2008
    Messages:
    7
    I wrote a program to let my kids randomly click things, which works unless they get the windows key which bypasses the whole point of the program. not worried about catching multiple keys like ctrl/alt/delete, just dont want to keep having to barricade computer if I walk away from computer for a minute. can show coding to date if you're interested
     
  4. Wondered2001

    Wondered2001 Thread Starter

    Joined:
    Oct 9, 2008
    Messages:
    7
    btw, realizing potential for creating problems if code is given out... if you're not comfortable telling, I'm still looking on my own and eventually will make it work. Was hoping to finish before kids are old enough to help me is all ;-)
     
  5. -Fabez-

    -Fabez-

    Joined:
    Jul 28, 2008
    Messages:
    1,899
    Im comfortable telling you, I just dont fully get why you want to monitor all of the keys that are pressed on your computer.
     
  6. Wondered2001

    Wondered2001 Thread Starter

    Joined:
    Oct 9, 2008
    Messages:
    7
    sorry for delay in response. The program is supposed to let the kids hit any key on keyboard or click any button on mouse, without me worrying about them deleting the folder holding all their photos or who knows what. basically it puts a full screen image on screen that changes colors randomly when any key is hit, mouse wheel scrolled... whatever. It works great except for if the windows key is hit... it bypasses the whole program bringing up the taskbar and potentially lets em click on anything. I wrote it originaly to amuse daughter who found it fun, the 1yr old son has a definite passion for the keyboard and has literaly climbed stuff I couldnt to get past the barriers we put in his way. A little wordy, but hope reason is clearer. I did find a low level keyboard hook that should work, but if you have an easier way to catch the windows key I'd love to hear it.
     
  7. pvc_

    pvc_

    Joined:
    Feb 17, 2008
    Messages:
    484
    If you can currently get the key code for the Windows Key ( I dont know how you implemented the program that you have right now), then you can resize the form to get the focus back. Do a quick resize, and then maximize the windows again. Another good trick is to send a pop up message to the screen to get the focus back and get rid of the start menu.

    I usually code this kind of stuff in .net and to get the key code, I just use the Form_KeyDown event, and the "e" argument that is passed to it.
     
  8. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/757479