Jump to content

wrongly triggered event ?


manoj

Recommended Posts

Hi, I had implemented a top corner button one of my page to navigate across page... But I don't know why return key on the virtual_keyboard also does the same thing(which I never set).. 

This is the portion of code doing the button event response.

Thank you, trying my best to get used to uGFX B|.  VID_20170729_042327.3gp

Quote

switch (pe->type) {
            {
            case GEVENT_GWIN_BUTTON:
                if (((GEventGWinButton*)pe)->gwin == touch_button_df_pg) {

                        gwinDestroy(ghContainerPage0);
                        guiCreate();
                    //gwinPrintf(ghTextedit1, "fgdfg");
//                    createPagePage1();
//                    guiShowPage(1);
                
                    //(((GEventGWinButton*)pe)->gwin == ghButton1)    
                            
                    break;
                }
                
                else if (((GEventGWinButton*)pe)->gwin == ghButton1)  // main page
                    
                {
                        gwinHide(ghContainerPage1);
                        gwinDestroy(ghContainerPage1);
                        
                    createPagePage0();
                    guiShowPage(0);
                    break;
                }
                
            }

 

Link to comment
Share on other sites

Hello @manoj,

When using the virtual keyboard the keyboard input layer of the GINPUT gets enabled. When that is the case, keyboard events get distributed to the widget in focus. A widget can be focused by either clicking it or by using the arrow or tab keys of a keyboard to move the focus to the next widget in the widgets list. When a button has focus it can be clicked by pressing the enter or space key on a keyboard. This is most likely what is happening here.

I'm not sure whether that is a bug in the distribution of the keyboard events to a widget in focus or whether you're doing the visibility handling wrong. It's actually not that unlikely that this is a bug in the µGFX library. I'd recommend you to run some simple tests based on what I described above. Start with two push-buttons and a keyboard widget on the same page and then work your way from there.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...