← Back to team overview

kicad-developers team mailing list archive

Re: Testing for hotkeys patch

 

I'll try this later today, but I'm suspicious it'll work. I don't have 
trouble capturing any other special keys (tab itself even works on both 
Linux and OS X), and it's not just ignoring tab, the whole application 
is *freezing* when I press tab. I can't even drag the windows around, 
it's completely solid. Also I should add that it happens even if I never 
bind the EVT_CHAR handler - the dialog just does not like to receive Tab 
when there's nothing in its tab order, for some reason.

The easiest solution may be to create an invisible component that exists 
in the tab order...

On Fri, Jan 08, 2016 at 09:21:12AM +0100, jp charras wrote:
> Le 08/01/2016 03:15, Chris Pavlina a écrit :
> > Here's a new patch. It fixes all previously mentioned bugs. In 
> > particular, I have moved import/export back out into the menu to solve 
> > the ambiguity issue.
> > 
> > However, I've uncovered a new bug. On Windows, if you try to select Tab 
> > as a hotkey, the entire thing freezes up solid. This appears to be 
> > related to it attempting to find the next item in an empty tab order.
> > 
> > A grotty fix is to add any tab-orderable item, such as a wxTextCtrl, 
> > into the dialog.
> > 
> > I'm currently investigating a proper solution to this. Anybody with 
> > Windows development experience is very much welcome to help me out here 
> > - I have no idea what is going on with this in Windows, and it's hard to 
> > debug because Windows builds take so long on my system...
> > 
> > I've tried turning off wxTAB_TRAVERSAL; that doesn't help (including a 
> > grotty test hooking the wxDialog constructor to keep it from ever 
> > putting that option in)...
> > 
> > On Thu, Jan 07, 2016 at 09:53:58AM -0500, Wayne Stambaugh wrote:
> >> Chris,
> 
> To capture special keys like tab, return and some others, you could try
> to use both wxEVT_CHAR and wxEVT_CHAR_HOOK.
> 
> However, because all key events are captured, you have to filter some
> keys (especially modifier keys)
> 
> Something like (from widgets/widget_hotkey_list.cpp):
> 
>         SetMinClientSize( GetClientSize() );
> 
>         panel->Bind( wxEVT_CHAR, &HK_PROMPT_DIALOG::OnChar, this );
>         panel->Bind( wxEVT_CHAR_HOOK, &HK_PROMPT_DIALOG::OnChar, this );
>     }
> 
>     void OnChar( wxKeyEvent& aEvent )
>     {
>         m_event = aEvent;
> 
>         switch( m_event.GetKeyCode() )
>         {
>             case WXK_NONE:
>             case WXK_SHIFT:
>             case WXK_ALT:
>             case WXK_CONTROL:
>                 return;
> 
>             default:
>                 break;
>         }
> 
>         EndFlexible( wxID_OK );
>     }
> 
> 
> 
> -- 
> Jean-Pierre CHARRAS
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp


References