← Back to team overview

aesthete-team team mailing list archive

Re: Definitions defining key presses

 

Phil Weir wrote:

I noticed that when trying to use the new factorial definition, I had to
click the factorial option (Discrete->Factorial), rather than just type the
more intuitive ! directly.

Although it shouldn't be too hard to add this shortcut directly into the
code, would it not be better to have the key press defined in the definition
file? That way people can create their own set of definitions with their own
set of key presses, and not have to interact directly with the base code.

Of course, this functionality may be there already and I may have just
missed it. If that's the case, how would one go about adding keypresses to
the definition files.


Good thinking - nope, it's not added yet, but should be. A basic setup could
entail an entry in GlyphMaker that takes a string key combination as
parsable by gtk.accelerator_parse [
http://www.pygtk.org/docs/pygtk/class-gtkaccelgroup.html#function-gtk--accelerator-parse]
and sticks a node<key combination="!"/>  into the XML. It would be a
good
prompt to begin moving combination handling over to a GTK managed
AccelGroup, rather than manually through if statements.


I was originally thinking of a multi-line XML node, but it looks like gtk.accelerator_parse allows for things like "<Shift><Alt>f". Useful.

Getting rid of the if statements would be good, at least for the definition keypresses.

Combinations using Super are currently reserved for phrase-handled actions
(e.g. Super+Right in a subscript turns it to a differentiation, in a
superscript it turns an exponent into an index).

P


Good to know.

Chris.



References