Here's the schema I've settled on:
<keybindings name="user-visible name for shortcut scheme">
<!-- a primary key binding (shown as shortcut for verb in GUI) --> <primary keyval="a gdk keyval name" modifiers="control,alt,shift" verb="VerbName" />
<!-- a secondary key binding; modifiers="" if unspecified --> <seconary keyval="a gdk keyval name" verb="OtherVerbName" /> </keybindings>
The keyval names are as returned by gdk_keyval_name().
I've comitted a shortcuts.xml file that I've extracted from shortcuts.cpp; it follows this schema. We'll probably move it somewhere else later, but right now it's in src/.
No code to read it, yet, but that'll come soon.
I think files using these schemas will go in /usr/share/inkscape/keybindings/ and ~/.inkscape/keybindings/.
I'm not sure whether the default schema should remain hard-coded or whether that should stay in an XML file. Thoughts?
-mental
On Thu, 2005-11-24 at 22:07 -0500, mental@...3... wrote:
I'm not sure whether the default schema should remain hard-coded or whether that should stay in an XML file. Thoughts?
I'm for hard coding, just because it is more robust. Through all the directory confusion that can happen, we'll have menus, a default preferences file, and keybindings if they're all hard coded (the others are now).
It would be kinda cool if we had a little "xml2c" type script that would run at compile time so we could keep these as XML in CVS.
--Ted
On Nov 27, 2005, at 10:34 PM, Ted Gould wrote:
It would be kinda cool if we had a little "xml2c" type script that would run at compile time so we could keep these as XML in CVS.
The simple way to do that is with XSLT.
Have some xsl defining things and just run xsltproc on them to get the .cpp output.
On Thu, Nov 24, 2005 at 10:07:12PM -0500, mental@...3... wrote:
I've comitted a shortcuts.xml file that I've extracted from shortcuts.cpp
Something to think about & keep in mind during the design of customizable key bindings is that many of the more important keyboard shortcuts aren't in shortcuts.cpp but in individual source files (particularly *-context.cpp). E.g. The_wow on IRC has pointed out that the [ and ] keys for rotation are fine for US keyboards but rather difficult for many european keyboard layouts (languages where accented characters are more important than rare punctuation symbols). These keybindings are currently specified in the form of `case GDK_bracketleft' in node-context.cpp rather than as verbs. Presumably some keys mean different things in different contexts (tools), though I haven't looked for examples (besides the obvious text tool :) ).
pjrm.
participants (4)
-
unknown@example.com
-
Jon A. Cruz
-
Peter Moulder
-
Ted Gould