How to know if a phone running a XNA application has a keyboard?
For the purpose of a game which must respect MS' TRC, I need to know if a phone has a physical keyboard to handle it.
How can I know it? Here is an integrated function which permit to know it?
Thanks,
K开发者_如何学JAVAiTe
There is no way to detect if a phone has a physical keyboard. To an application, the physical and virtual keyboards are the same.
All devices will have a physical back button and you must handle this appropriately in your game. (i.e. show the menu at the appropriate times.)
Regarding the discussion about testing on hardware. There are a number of different hardware devices being used for early testing. Some (from Samsung) have physical keyboards.
I'm not sure what your needs are for this requirement, and I agree with Matt's observations.
Reading between the lines, I sense you are developing a game which can be controlled better by a hardware keyboard if present.
My suggestions if this is the case, and acknowledging Matt's obervsations, is to have a physical keyboard mode of play which the user can activate through a settings feature which you provide in your app.
I thought the TRC requirements for WP7 was that an application or game cannot rely on a functionality of a physical keyboard, i.e., it has work with the on-screen keyboard.
Peter Torr on the WP7 forums has said that the OS will reacts to the hardware keyboard being slide-out, e.g., will hide the on-screen keyboard, however the event is not available to 3rd party developers.
I have quickly searched MSDN, specially the GamerServices
namespace and cannot find any way that you could detect the hardware capabilities. Perhaps have a look at GamePad.GetCapabilities
, not sure if you there is any useful information.
Question: I did not know there were devices with hardware keyboard available at the moment? How are testing this?
精彩评论