[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools] Re: Problem with Canvas widget in SWT

Try adding a listener for KeyDown on your canvas.  Your listener does not
need to do anything, it just needs to exist.

"Lawrence Kesteloot" <lk@xxxxxxxxxxx> wrote in message
news:9tdu2c$6nm$1@xxxxxxxxxxxxxxxx
>
> (This is stand-alone SWT on Windows.)
>
> I've got a Shell widget which contains a Combo box and a Canvas.
> I (illegally) pass the Canvas's HWND to a bit of native code that
> draws into it.  All this works fine, and the native code even
> gets the mouse events, redraw events, etc.  The problem is that
> it doesn't get the keyboard events.
>
> I don't know enough about Windows event handling to know what's
> going on, but I suspect it has to do with the Shell not passing
> on keyboard events because they're being redirected to the Combo
> box (which has input focus).  How do I tell either the Shell or
> the Canvas that keystrokes are allowed to be received by the
> Canvas?
>
> (The goal is to use a text editor written in C as an editor
> plugin in Eclipse.)
>
> Lawrence
>
>