From Inkscape Wiki
Revision as of 12:24, 11 April 2007 by St8Yqb (talk | contribs)
Jump to navigation Jump to search

As first discussed in InkscapeTamed, keyboard events are sent to the event context handlers (both global in event-context.c and tool-specific e.g. select-context.c) ONLY when the mouse is over the canvas.

Simple experiment: move a shape by arrows. This works while the mouse cursor is over the document window but stops as soon as you move mouse away from it, even if the document window still has focus. Global verbs like and - and ctrl-q always work. We cannot however make tool-specific shortcuts global verbs.

  • Mental writes:

Grabbing focus between widgets is accomplished via gtk_widget_grab_focus(). The widget will need to have the GTK_CAN_FOCUS flag set, however. I've taken care of the latter half in desktop.c now (setting the CAN_FOCUS widget flag).

I guess what remains is just determining when it would be appropriate to call gtk_widget_grab_focus() on the canvas widget.

  • bb writes:

I cannot make it work. I added

	gtk_widget_grab_focus (