324 views
in Embedded Wizard Studio by

Hello team,

        Now , i have a problem.

       I tried to use hardbutton to change what I needed .

 if ( IsHardButtonDown )
    peq_gain_1++;
  else
    peq_gain_1 = 0;

  if ( DeviceObject == 0 )
    return 0;

  #ifdef _ApplicationDeviceClass__Updatepeq_gain_1_

    ApplicationDeviceClass__Updatepeq_gain_1( DeviceObject, (XInt32)peq_gain_1 );

  #endif

   It can use userbutton control the peq_gain_1, State increase 1 .

  My question:  if i want to use keyboard ("S") instead of hardbutton,and I split the access button into two functions(EwBspGetCharacter() and  EwBspReadCharacter()),it can useful for my project, My code is as follows :

 if (  EwBspReadCharacter()==0x53 )
    peq_gain_1++;
  else
    peq_gain_1 = 0;

  if ( DeviceObject == 0 )
    return 0;

  #ifdef _ApplicationDeviceClass__Updatepeq_gain_1_

    ApplicationDeviceClass__Updatepeq_gain_1( DeviceObject, (XInt32)peq_gain_1 );

  #endif

  So,Where am I wrong ?Causes the "S" key to be pressed to be out of control.

Best regards,

Tonny

by
To  add:  Not to add a (Key Press Handler) to the software ,i want to Through external operations .

1 Answer

0 votes
by

Hello Tonny,

the hardbutton within the example DeviceIntegration is used to demonstrate how to provide some data from a GPIO to the GUI application. It is not intended to show how to adapt some keyboard to the GUI.

In order to insert key events, please have a look to the main loop, there you will find the processing of the key events. You can adapt the function EwGetKeyCommand() according to your needs.

This makes it much more easier to integrate that with your GUI application - and you can use key events within the Prototyper.

Best regards,

Manfred.

Embedded Wizard Website | Privacy Policy | Imprint

...