CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Dec 2008
    Posts
    4

    Talking "Baby Entertainment" program

    Howdy, Y'all!

    I'm new here. I'm also new to VB .net 3.5 SP1 programming, but not new to programming in general.

    I want to make a program for my baby daughter. She likes to sit on Daddy's lap and mash the keyboard. Unfortunately, this can produce undesired results for Daddy! So, what I want to do, is create a program that captures ALL keystrokes (Including and especially the Windows key, the Alt-Menu Key), and play a neat noise and maybe flash a neat graphic on the screen.

    I've begun with a very simple thing like this:

    Code:
    Public Class Form1
    
        Private Sub TextBox1_KeyDown(ByVal sender As Object, ByVal bubba As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
    
            If bubba.KeyCode = Keys.F1 Then
                My.Computer.Audio.Play("c:\wav\falling.wav", AudioPlayMode.Background)
            End If
    
        End Sub
    
    End Class
    The problem with this simple code is that when the Windows key is depressed or the Alt-Menu key, it takes the focus away from the VB form itself. I don't want this. How can I capture/prevent that behavior?

    I found an earlier post, from 2001, but it consisted of Graham bringing up a debate on "Why you shouldn't assume you know more than the user". In this case, the user is either myself, who knows exactly what I want, or my daughter, who quite frankly, doesn't. (Or, if she does, she can't tell me, unfortunately!) hehe!

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: "Baby Entertainment" program

    We can't post code that performs KEY LOGGING, as it's against the AUP.

    I'd suggest another keyboard for her (that isn't plugged in.)

    Then you can do random things that she THINKS she's causing, and entertain herself.
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    Join Date
    Dec 2008
    Posts
    4

    Question Re: "Baby Entertainment" program

    Ha ha!

    She is smarter than that. She knows that the OTHER keyboard is the REAL keyboard (Made the mistake of using both simultaneously).


    Who is the AUP?

  4. #4
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: "Baby Entertainment" program

    At the bottom of every page:

    Acceptable Use Policy
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  5. #5
    Join Date
    Dec 2008
    Posts
    4

    Re: "Baby Entertainment" program

    OK.

    Well, I understand you don't want to help bad people. Quite frustrating to hit a dead end after registering. Too bad I'm just a guy who wants to entertain his kid.

    I guess I'll have to go find some 1337 h4x70r forums to learn this.

  6. #6
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: "Baby Entertainment" program

    Easier to teach her NOT to touch something, then to possibly help design the next-best key-logger to hit the markets
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  7. #7
    Join Date
    Jun 2005
    Location
    JHB South Africa
    Posts
    3,772

    Re: "Baby Entertainment" program

    Quote Originally Posted by schmeckendeugler View Post
    OK.

    Well, I understand you don't want to help bad people. Quite frustrating to hit a dead end after registering. Too bad I'm just a guy who wants to entertain his kid.

    I guess I'll have to go find some 1337 h4x70r forums to learn this.
    Don't give up so quickly .... There are other methods to do what you want ...

    I did a quick search and picked up these two threads...

    Disable Windows ctrl, Alt, del Keys... & How to show my project on the "Top Layer" ...

    Check out HannesTheGreat's posts in those two threads... I'm sure you will be able to use that code as is and simply add the play/ draw stuff in yourself...

    Search Functions return a lot of good info often..

    Gremmy..
    Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
    WPF Articles : 3D Animation 1 , 2 , 3
    Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
    Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
    All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured