G
Guest
Hi,
I am trying to get access to the red and green phoen buttons. I thought that
the HardwareButton class would do the job. I am trying my code in the
emulator and on a device but this doesn't work as I expected.
I am using CF 2.0 SP1 beta on WM5.0.
On my device I can catch Appkey 1 - 4 (calender, contacts, camera,
recorder), but not the red and green buttons.
Using the WIndows Mobile 5.0 Pocket PC Phone emulator I can only catch
Appkey 2 which is the calender button.
The buttons on the left and right side return no Appkey values:
left top: e.KeyCode RButton | MButton | Space
left bottom: e.KeyCode Back | Space
on the right: 121
The other buttons I cannot catch (contacts, red, green)
Here is some code:
private void HBConfig()
{
int j;
j = 0;
try
{
HardwareKeys hk = HardwareKeys.ApplicationKey1;
for (int i = 0; i < 6; i++)
{
j = i;
hwb = new HardwareButton();
hwb.AssociatedControl = this;
hwb.HardwareKey = hk + i;
}
}
catch (Exception exc)
{
MessageBox.Show(exc.Message + " Check if the hardware " +
"button is physically available on this device. Stopped at "+(j+1));
}
}
private void ButtonKeyDown(object sender, KeyEventArgs e)
{
for(int i=0;i<6;i++)
{
if(((HardwareKeys)e.KeyCode) == hwb.HardwareKey)
break;
}
switch (e.KeyCode)
{
......
What is going wrong?
How can I catch the red and green telefon button ?
I am trying to get access to the red and green phoen buttons. I thought that
the HardwareButton class would do the job. I am trying my code in the
emulator and on a device but this doesn't work as I expected.
I am using CF 2.0 SP1 beta on WM5.0.
On my device I can catch Appkey 1 - 4 (calender, contacts, camera,
recorder), but not the red and green buttons.
Using the WIndows Mobile 5.0 Pocket PC Phone emulator I can only catch
Appkey 2 which is the calender button.
The buttons on the left and right side return no Appkey values:
left top: e.KeyCode RButton | MButton | Space
left bottom: e.KeyCode Back | Space
on the right: 121
The other buttons I cannot catch (contacts, red, green)
Here is some code:
private void HBConfig()
{
int j;
j = 0;
try
{
HardwareKeys hk = HardwareKeys.ApplicationKey1;
for (int i = 0; i < 6; i++)
{
j = i;
hwb = new HardwareButton();
hwb.AssociatedControl = this;
hwb.HardwareKey = hk + i;
}
}
catch (Exception exc)
{
MessageBox.Show(exc.Message + " Check if the hardware " +
"button is physically available on this device. Stopped at "+(j+1));
}
}
private void ButtonKeyDown(object sender, KeyEventArgs e)
{
for(int i=0;i<6;i++)
{
if(((HardwareKeys)e.KeyCode) == hwb.HardwareKey)
break;
}
switch (e.KeyCode)
{
......
What is going wrong?
How can I catch the red and green telefon button ?