locked
Detect input method (metro style app)

    Question

  • Is there a way to check if the user is using mouse&keyboard instead of touch input?

    Why am I asking? I want to create two views (XAML declarations of the same views) of my Metro style app. One optimized for touch (default) and the other optimized for more mouse&keyboard friendly input.

    Thanks.

    Wednesday, January 11, 2012 10:54 PM

Answers

  • Hi Paul,

    You can find out about the current devices with the Windows.Devices.Input classes.

    You cannot make the assumptions you are suggesting based on the presence of a hardware keyboard. If you do want to change the UI, I would switch based on the presence or absence of a touch screen rather than a presence or absence of a keyboard.

    The laptop I am using now (from about when Windows 7 came out) has a touch screen and a keyboard. My slate has an optional keyboard. My desktop has a touch screen and a keyboard. It is likely that there will be more touch screens in the future than not.

    --Rob

    • Marked as answer by Paul_X Thursday, January 12, 2012 1:59 PM
    Thursday, January 12, 2012 8:06 AM
    Owner

All replies

  • Mouse, keyboard, and touch input are not exclusive. Users may mix and match. You can monitor what the user has used previously, but you can't tell what they are going to use.

    --Rob

    Wednesday, January 11, 2012 11:09 PM
    Owner
  • Thanks for your reply.

    I am working on a onlinebanking app.

    I was thinking about the millions of millions of Laptops and PC _today_ that don't have touch and won't automatically get touch with Win8 (would be great though). Personally, I think it makes to sense to offer them a "tailored" experience as well

    Other scenarios: Dockingstation usage, generally at work & home with a bigger (non-touch)screen.

    Even if they mix and match, it's not like my application would turn to DOS-mode ;) They will be still able to touch and interact (still metro controls).

    Would be great if there would an API for "keyboard detection".

    Thanks,

    Paul

     

    Thursday, January 12, 2012 7:21 AM
  • Hi Paul,

    You can find out about the current devices with the Windows.Devices.Input classes.

    You cannot make the assumptions you are suggesting based on the presence of a hardware keyboard. If you do want to change the UI, I would switch based on the presence or absence of a touch screen rather than a presence or absence of a keyboard.

    The laptop I am using now (from about when Windows 7 came out) has a touch screen and a keyboard. My slate has an optional keyboard. My desktop has a touch screen and a keyboard. It is likely that there will be more touch screens in the future than not.

    --Rob

    • Marked as answer by Paul_X Thursday, January 12, 2012 1:59 PM
    Thursday, January 12, 2012 8:06 AM
    Owner
  • Thank you, this was good advice!

    Thursday, January 12, 2012 1:59 PM