How to detect physical keyboard? RRS feed

  • Question

  • bool keyboardattached = new KeyboardCapabilities().KeyboardPresent == 1; always returns true.  Using MS surface RT.

    If this doesn't work, what are we suppose to use to detect the presence of a physical keyboard?

    Monday, December 23, 2013 8:08 PM

All replies

  • KeyboardPresent basically passes through what the driver reports and so may have false positives on some systems.

    There isn't a good direct way to tell, but depending on why you need to know there may be indirect ways.


    Tuesday, December 24, 2013 12:53 AM
  • I want one of my textboxes to go IsReadOnly=true when there is NOT a physical keyboard present. When there is a keyboard present, the said textbox.isreadonly = false.
    Tuesday, December 24, 2013 2:37 AM
  • That is what you're trying to do not why: you'll need to step back a bit further to look at the scenario at a higher level to see if there is another way to achieve the overall without directly detecting keyboard presence.


    Friday, December 27, 2013 12:56 AM
  • Well, since MS only used braindead bloggers and facebookers to test out the virtual keyboard, they decided to make the keyboard so big that it covers almost everything on the screen.  Furthermore, since MS has decided to stop supporting productivity apps and would rather go all in for braindead bloggers and facebookers, they don't allow us to customize the size of the virtual keyboard.

    For our LOB app allows our engineers to do inspections and do calculations in the field without having to reference 3,000+ page long manuals.  But since the damn keyboard covers up everything important, we have decided unanimously that the virtual keyboard must go.  I've built a custom keyboard that fits nicely with our app.  Bloggers may not like it, but us engineers love it.  Sure, I could make the textboxes isreadonly.  But we need to be able to work with the app back in the office with a physical keyboard.  Right now, we have an on/off switch.  I'm just looking for a way to make the whole thing automatic.

    Friday, December 27, 2013 4:31 PM