locked
Metro app which responds to keydown events in background? (global hotkey event)

    Question

  • Hi,

    i want to build a application which implements a function when the user presses a hotkey (i've done this in regular c# before). i've been looking into the background tasks and such but those do not seem suited to what i want to do.

    Basically what i want to create is a metro app which registers a global hotkey.

    It should respond to that event no matter if its in the foreground or not.

    is this possible?

    Thursday, August 30, 2012 8:46 AM

Answers

  • No it is not.

    You cannot affect the system with an app.  The app is sandboxed.  You can certainly catch keys for just your app, but never will it be allowed to grab keys for the system.  This is called a key logger and is a tool that hackers use to steal personal information.

    -Jeff


    Jeff Sanders (MSFT)

    Thursday, August 30, 2012 6:34 PM
    Moderator

All replies

  • No it is not.

    You cannot affect the system with an app.  The app is sandboxed.  You can certainly catch keys for just your app, but never will it be allowed to grab keys for the system.  This is called a key logger and is a tool that hackers use to steal personal information.

    -Jeff


    Jeff Sanders (MSFT)

    Thursday, August 30, 2012 6:34 PM
    Moderator
  • I've been looking for a way to do this for some time now. Jeff, I would greatly appreciate it if you let your guys know we'd love a way to have hotkeys sent from the desktop to an app docked on the current window. I.E. having a video in a docked Windows Store App docked.

    Use Case:

    1. User has a Windows 8 App docked on the side which is playing a video while the user is working on the desktop.
    2. The user needs to pause the video, but doesn't want to take their hands off the keyboard (many people still don't have touchscreens and grabbing the mouse is very annoying)
    3. The user presses Win-1 or something and the video pauses without changing the foreground window.

    You can allow Win-(1-6) to be utilized by developers as hotkeys for apps (which also means having Windows Store Apps as docked apps has a purpose for desktop users so there's a slight amount of integration between the two. Such as a desktop screen capture Windows Store App which you just run and you can start making a video. There's SO MANY possibilities and it would mean that many apps aren't completely useless.

    In the future, I'd eventually like to see a lot more safe integration between desktop apps and Windows Store apps so users who have desktops for pure productivity purposes can utilize apps as well. Docked apps are only good if you have a REASON to need both applications. If you guys can come up with something, you've got yourself a TON of hardcore developers.

    Best Regards,
    Levi Fuller

    Wednesday, November 6, 2013 3:19 AM