← Back to team overview

kicad-developers team mailing list archive

Re: Re: TODO.txt item L1)

 

The hot key implementation is defined in WinEDA_DrawPanel: :OnKeyEvent( )
so the DrawPanel would need the focus not the main frame window in order
to restore normal hot key functionality. wxWidgets events get passed up
the stack from child to parent unless Skip() is called in the event
handler. It's crucial to remember this relationship to get the keyboard
input directed to the correct window. Otherwise, the user will be
forced to click on the window to move the focus which typically is not
obvious to the user. It may make sense to force the focus to the draw
panel any time the main window receives the focus to prevent this behavior.

Wayne

A good way to solve this could be in the main window to have a Get Focus Event handler that give the focus to its WinEDA_DrawPanel.
With this handler, the current layer_widget code should work.
--
Jean-Pierre CHARRAS



Thanks to both of you!

I am very hopeful and optimistic that this is a path likely to succeed.

------------

A related solution comes to mind from your ideas, maybe a few less lines is below. Do you think this would work: ?

pass in an *additional* argument to the LAYER_WIDGET constructor, declared as
wxWindow* passFocusToThis


then call passFocusToThis->SetFocus() in passOnFocus()

When instantiating, use WinEDA_DrawPanel as passFocusToThis.

Dick








References