96 views
in GUI Development by
Hello EW:

I have a question about key handling.

I have a home screen with left and right keystroke handlers, and a container for switching displays for three subscreens, each of which also has left and right keystroke handlers for switching between them. When I left or right press slowly, the subscreen switches well, and when I left or right press quickly, the keystroke events are captured by the main screen's keystroke handler.

How can I avoid this phenomenon?

1 Answer

+1 vote
by
Hello,

based on the provided information it is difficult to deduce the cause of the described behavior. Please reduce your project to a minimal example demonstrating the behavior and upload the example here for further analysis.

Best regards

Paul Banach
by

Hello paul,

As the screenshot shows, I have a group screen with left and right keys to control the addition and subtraction of variable.

// TO DO: Write your code here ... 
//Init code
attachobserver OnSubCsreenChangeed, ^Application::Device.SubScreen;
postsignal OnSubCsreenChangeed; 

OnSubCsreenChangeed code:

sender; /* the method is called from the sender object */

switch(Application::Device.SubScreen)
{
  case Application::SubScreenType.FirstScreen : Group.Content = new Screen_xxxx::SubScreen1;
  case Application::SubScreenType.SecondScreen : Group.Content = new Screen_xxxx::SubScreen2;
  case Application::SubScreenType.ThirdScreen : Group.Content = new Screen_xxxx::SubScreen3;
  default:;
}

 

There are three different subscreens with left and right keystroke handlers.

When I simulate the project, sometimes the variable changes as I switch screens.

My guess is that in the process of switching screens, there may be only the main screen key handler left on the entire focus path.

Therefore, is it possible to disable the key handling function of the main screen in the init function of the subscreen, and enable it when exiting. What am I supposed to do?

 

by

Hello,

When I simulate the project, sometimes the variable changes as I switch screens.

I'm sorry but the provided description didn't help me to understand the problem. You can provide an example project for further analysis. Please keep it as simple as possible.

Therefore, is it possible to disable the key handling function of the main screen in the init function of the subscreen, and enable it when exiting. What am I supposed to do?

Possibly Disable a Key Handler provides the information you are looking for.

Best regards

Paul Banach

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...