Microsoft Developer Network > Página Inicial dos Fóruns > .NET Base Class Library > How do I detect whether touchscreen or mouse?
Fazer uma PerguntaFazer uma Pergunta
 

PerguntaHow do I detect whether touchscreen or mouse?

  • quinta-feira, 5 de novembro de 2009 17:16tairon Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    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

Todas as Respostas

  • sábado, 7 de novembro de 2009 8:21Jai Mallesh Babu Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    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
    • Marcado como RespostaeryangMSFT, Moderatorquinta-feira, 12 de novembro de 2009 7:38
    • Não Marcado como Respostatairon quinta-feira, 19 de novembro de 2009 13:18
    •  
  • quinta-feira, 19 de novembro de 2009 13:28tairon Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    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
  • quarta-feira, 25 de novembro de 2009 10:20eryangMSFT, ModeratorMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     

    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.