www.webdeveloper.com
Results 1 to 4 of 4

Thread: Monitoring keystrokes with a unfocused window?

Hybrid View

  1. #1
    Join Date
    Aug 2013
    Posts
    2

    Monitoring keystrokes with a unfocused window?

    Hello programmers.

    Is it possible to monitor keystrokes if a browser has been minimized? Or will I need to learn C++ or something similar, and make a program, to do this?

    My idea is that I want to have a site running in the background while I'm playing a game and still be able to monitor if the person presses the F1 button on his keyboard and then play a sound.

  2. #2
    Join Date
    Jun 2008
    Posts
    106
    No, it is not. The key press would not get sent to the browser.

    You could use AutoHotKey for that.

  3. #3
    Join Date
    Aug 2013
    Posts
    2
    So I looked over autohotkey and it sounds like it might be what I'm looking for. But if you can answer a few questions I would be greatful.

    Will the program make the browser pop up/become active when a keystroke is passed to the browser?

    Can the script be run on the users computer without him having to do anything?

    Can I make the program target my site only or will it affect the browser even if the user switches to another website?

  4. #4
    Join Date
    Jun 2008
    Posts
    106
    Quote Originally Posted by stras77 View Post
    Will the program make the browser pop up/become active when a keystroke is passed to the browser?
    Oh, you still want to pass it to the browser? AutoHotKey (AHK) can send a key silently to the browser. Not sure how it would be received though, never tested it.



    Quote Originally Posted by stras77 View Post
    Can the script be run on the users computer without him having to do anything?
    The user would need to download it, if that's what you're asking. I'm pretty sure you can't do it any other way, though, meaning without them downloading something.



    Quote Originally Posted by stras77 View Post
    Can I make the program target my site only or will it affect the browser even if the user switches to another website?
    Hmm... not sure. You'd have to test a little. I could test a little, too, just to make sure I'm giving you a plausible idea, lol.
    I know AHK can silently send keys to another window, but sending it to a specific tab, I don't think so. I don't know of a way to switch tabs with AHK because I'm not sure if AHK has image recognition or not. Would need testing.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles