[tomboy-list] Key bindings

Doug Johnston doug.johnston at gmail.com
Wed Jan 20 23:51:28 PST 2010


Hi All,

One of Tomboy's greatest strengths is that as a desktop application it
has unique hooks that a web app just can't replicate. One example of
this is the system-wide hotkeys that are available. This inherently
makes Tomboy a very "keyboard-centric", power-user kind of app. I've
always wanted a bit more control with the various in app shortcuts and
modifiers keys though, so I thought it would be nice to expose all the
key binding that we have defined in the program. All over in our code,
we have various lines like:

decrease_font.AddAccelerator ("activate",
						accel_group,
						(uint) Gdk.Key.underscore,
						Gdk.ModifierType.ControlMask,
						Gtk.AccelFlags.Visible);

which bind a function to a specified key. I ripped these out and threw
them all into a dictionary, and then exposed it to the user in the
preferences pane, which allows the user to override just about any
default shortcut key and stores them in gconf (actually, I've only
done this with a handful of bindings, but I dont think it would too
hard to do the rest). Obviously this necessitates changing a bit of
core code, so I wanted to run this by everyone before I went any
further. See http://img29.imageshack.us/img29/5215/bindings.png for
how things would look. (obviously needs some tweaking)

So, good idea? Bad idea? Improvements? Reasons why this just wont
work? i18n issues? Does it make the preferences too messy?

Code impact so far is fairly minimal due to similar code being in
place for the system wide hot-key accelerators, but I still need to
hook up the checks that are in there today to prevent bad key
combinations, and go through all the accelerators and
KeyPressEventArgs and switch out the defaults, which might add need a
bit more passing on my mapping around. Not too much work though. I'll
put the changes I've made somewhere once if adding this binding window
seems like an acceptable thing to do. I'd also like to make the hot
keys and bindings directly read from user input. As it is now, you
have to manually type out "<control>". It'd be nice just to press the
key combo you want, and have that end up in the box, but that would be
a separate implementation step. Another natural step would be to add
presets for Windows, Mac, Emacs, etc.


Best,
Doug


More information about the Tomboy-list mailing list