Hi,
I'm a big fan of keyboard shortcuts, so I decided to add these guys to
lib/matplotlib/backend_bases.py
I'm not sure if this is too much, and maybe these should be configurable
down the line, but here's my first stab at it, what do you all think?
in the same order as they appear in the toolbar:
'h' or 'r' for Home/Reset
left arrow or 'z' or backspace for Back
right arrow and 'x' for Forward
'p' for pan axes with right, zoom with left mode toggle
'o' for z*o*om to rectangle mode toggle
's' for save
'z' and 'x' I borrowed from the Opera browser, very handy to for
righties who can have their left hand on the keyboard while using the mouse.
I decided to use 'o' for zoom to rect since it's located right next to
the 'p' for panning, and both are modes.
There was also a message on the matplotlib-users list in July that this
patch would be useful for
Subj: [Matplotlib-users] tool bar help / feature request
From: Ben Axelrod <[EMAIL PROTECTED]> - 2008-07-31 16:08
(but I don't know how to reply to that message as I was not on the the
users list at that time)
cheers,
Paul Ivanov
Index: matplotlib/lib/matplotlib/backend_bases.py
===================================================================
--- matplotlib/lib/matplotlib/backend_bases.py (revision 6232)
+++ matplotlib/lib/matplotlib/backend_bases.py (working copy)
@@ -1513,6 +1513,23 @@
if event.key == 'f':
self.full_screen_toggle()
+
+ # *h*ome or *r*eset mnemonic
+ elif event.key == 'h' or event.key == 'r' or event.key == "home":
+ self.canvas.toolbar.home()
+ # z and x to enable left handed quick navigation
+ elif event.key == 'left' or event.key == 'z' or event.key == 'backspace':
+ self.canvas.toolbar.back()
+ elif event.key == 'right' or event.key == 'x':
+ self.canvas.toolbar.forward()
+ # *p*an mnemonic
+ elif event.key == 'p':
+ self.canvas.toolbar.pan()
+ # z*o*om mnemonic
+ elif event.key == 'o':
+ self.canvas.toolbar.zoom()
+ elif event.key == 's':
+ self.canvas.toolbar.save_figure(self.canvas.toolbar)
if event.inaxes is None:
return
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel