On Thu, Dec 15, 2005 at 11:51:11AM +1300, Wilbert Knol wrote: > > > > An alternative way - used by gschem - would be to use a > > > combination of a keyboard hotkey (e.g. 'm' to move something) and > > > a mouse click (to select the object). This is really quick. once > > > you get the hang of it. > > > > PythonCAD now uses hotkeys. The first key is generally pressed > > with <alt>. > > I was wondering if it would be possible to leave out the 'alt' for > often-used operations. As an example: at present, to zoom in, I need > to press 'alt-m' and then 'z'., repeatedly. > > In pcb and gschem I can do this by just hammering 'z' a few times to > zoom up to the right level. > > Perhaps it makes sense to make these shortcut key bindings only for > items that are in the context menu.
Adding in handlers like what you're asking for is not impossible, it is just a matter of adjusting the 'key_press' event handling code. Right now, when you press a key like 'z', and the keyboard focus is in the DrawingArea, the handler changes the focus to the entry widget at the bottom of the screen and you'll see a 'z' typed there. If the keyboard focus is on the layer display, an unexpected entry box pops up with your 'z'. This entry box is part of the TreeView widget and lets you select one of the items displayed in the TreeView by typing in the name, but if you are not expecting the box to appear it is confusing. One problem I see with adding handlers like you describe would be you want to type an expression like 'a = 10' but there is a handler invoked when 'a' is typed, so the handler is called instead of you typing the expression on the entry box. Do pcb and/or gschem have some sort of entry widget where you can type commands? Art -- Man once surrendering his reason, has no remaining guard against absurdities the most monstrous, and like a ship without rudder, is the sport of every wind. -Thomas Jefferson to James Smith, 1822 _______________________________________________ PythonCAD mailing list [email protected] http://mail.python.org/mailman/listinfo/pythoncad
