.NET Framework Developer Center > .NET Development Forums > .NET Base Class Library > How do I detect whether touchscreen or mouse?
Ask a questionAsk a question
 

QuestionHow do I detect whether touchscreen or mouse?

  • Thursday, November 05, 2009 5:16 PMtairon Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi, I hope this is the right forum for this question.

    Is there anyway to detect if the user is using touchscreen or mouse on XP/Vista/Windows 7?

    I found the StylusAsyncPlugin examples which is supposed to work with xp tablet or vista+. but the App is not using forms and I can't find a way to make it work without it.

    I'm using the XNA framework and .net 3.5 no Forms or xaml.

    /Christoffer

All Replies

  • Saturday, November 07, 2009 8:21 AMJai Mallesh Babu Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi Tairon,

    See if this code project sample helps for touchscreen events:

    Touchscreen Keyboard UserControl:
    http://www.codeproject.com/KB/miscctrl/touchscreenkeyboard.aspx

    Regards,
    Jai
    • Marked As Answer byeryangMSFT, ModeratorThursday, November 12, 2009 7:38 AM
    • Unmarked As Answer bytairon Thursday, November 19, 2009 1:18 PM
    •  
  • Thursday, November 19, 2009 1:28 PMtairon Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi Jai,

    Thank you for your reply. Sadly it does not help. In the mentioned project there using form controls with mouse click events.
    I'm using XNA and the problem is that XNA doesn't recieve that your touching the screen unless your moving your finger(draging). At least this is what happens on the test device I'm using, a ASUS eeetop. So the only way I've managed to get clicks working on the thouchscreen is by detecting when the "mouse" moved and setting that as a click. And doing that doesn't work very well when using a mouse.

    regards,
    Christoffer
  • Wednesday, November 25, 2009 10:20 AMeryangMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Hi,

    For XNA issue, you may post it at http://forums.xna.com/forums/50.aspx where you will get quicker and better support.

     

    Thanks,

    Eric


    Please remember to mark helpful replies as answers and unmark them if they provide no help.