HardwareButton Class doesn't work - red and green telefon buttons  
Author Message
eiger





PostPosted: .NET Compact Framework, HardwareButton Class doesn't work - red and green telefon buttons Top

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;

hwbIdea = new HardwareButton();

hwbIdea.AssociatedControl = this;

hwbIdea.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) == hwbIdea.HardwareKey)

break;

}

switch (e.KeyCode)

{


.....

What is going wrong

How can I catch the red and green telefon button

eiger (frustrated)



Smart Device Development11  
 
 
timg_msft





PostPosted: .NET Compact Framework, HardwareButton Class doesn't work - red and green telefon buttons Top

This forum is intended to deal with issues directly related to the .NET Compact Framework.

It appears that this question can better be answered by someone on one of the newsgroups for Windows Mobile or Windows CE. In order to get a quicker and more accurate response, please consider reposting this question to one of the following newsgroups:

Windows Mobile API:

microsoft.public.pocketpc.developer

microsoft.public.smartphone.developer

Windows CE API:

microsoft.public.windowsce.embedded

General programming (not VisualStudio related):

microsoft.public.windowsce.embedded

microsoft.public.windowsce.app.development

Native compilers:

microsoft.public.windowsce.embedded.vc

ActiveSync:

microsoft.public.pocketpc.activesync