Can anyone tell me how to detect when the hardware keyboard is used and when 开发者_运维技巧the soft-key-pad is used? Or is there any event which tells that the hardware keypad is shown.
As of Mango, the hardware keyboard detection can now be done - see:
IsKeyboardDeployed - http://msdn.microsoft.com/en-us/library/microsoft.phone.info.devicestatus.iskeyboarddeployed(v=VS.92).aspx
IsKeyboardPresent - http://msdn.microsoft.com/en-us/library/microsoft.phone.info.devicestatus.iskeyboardpresent%28v=VS.92%29.aspx
KeyboardDeployedChanged - http://msdn.microsoft.com/en-us/library/microsoft.phone.info.devicestatus.keyboarddeployedchanged(v=VS.92).aspx
from Is there any way to detect if there's a hardware keyboard on the phone?
There isn't currently anything exposed to reliably detect this.
Jaime Rodriguez explores a partial solution here and advises against using it in summary.
Guessing if the SIP is visible in a Windows Phone application
Mostly people want to detect this to customise layout to make accept / cancel type functions accessible. In that respect, the Application Bar can be used successfully.
精彩评论