J'etais bien bloquer sur ce problème moi aussi.
Voici un petit soluce, qui fonctionne avec Pocket PC.
il y a un composant qui s'appelle
Microsoft.WindowsCE.Forms.HardwareButtonvoici un exemple
private
Microsoft.WindowsCE.Forms.HardwareButton hwb1, hwb4;
private
void HBConfig(){
try
{
hwb1 = new Microsoft.WindowsCE.Forms.HardwareButton();
hwb4 = new Microsoft.WindowsCE.Forms.HardwareButton();
hwb1.AssociatedControl = this;
hwb4.AssociatedControl = this;
hwb1.HardwareKey = Microsoft.WindowsCE.Forms.HardwareKeys.ApplicationKey2;
hwb4.HardwareKey = Microsoft.WindowsCE.Forms.HardwareKeys.ApplicationKey3;
}
catch (System.Exception exc)
{
MessageBox.Show(exc.Message + " Check if the hardware button is physically available on this device.");
}
}
et avec un gestionnaire d'évènement classique type KeyDown tu récupère l'info.
les applycationkey
1 le petit bouton sur la gauche.
2 celui avec une sorte de grille dessiner dessus
3 celui avec la page
4 l'enveloppe
5 la maison
6 petit bouton a gauche
les
e.KeyCode ca doit etre ca
1 -> 193
2 -> 194
3 -> 195
4 -> 196
5 -> 197
6 -> 198
Je pense que cela devrais fonctionner pour un smatphone.
pour plus d'infos
[ Lien ]