ipython/ipython — pull request #1334 by fawce (2012-01-27 19:55:30+00:00)
Title: added key handler for control-s to notebook, seems to work pretty well

Hi,

There was a thread on the dev list about key bindings and hooking ctrl-save to trigger a new save (http://mail.scipy.org/pipermail/ipython-dev/2012-January/008674.html).

What makes this hard is that the browser will only trigger keyboard events for the element that currently has focus. To see what this means, open a google docs spreadsheet. Hit ctrl-s, and you'll see a quick status in the header that your doc is being saved. Now, click on a menu and leave the menu dropped down - ctrl-s now will ask you to (completely pointlessly) save the html of the page. In google's spreadsheet this oddity is almost never an issue, because you almost never notice this discrepancy as you're almost always keyboard focused on the sheet.

In the updated UI, notebook's layout has the same convenient property as google docs, where focus is almost always in the notebook element or a child. The only way I was able to end up without focus in the notebook was to click the menu. As long as a menu is dropped down, the ctrl-s triggers the browser's dialog.

thanks,
fawce

p.s.
This PR is from a branch based on a pull from ellisonbg/master.