[IPython-dev] Min: Cmd-P/Ctrl-P for new print code question..
MinRK
benjaminrk at gmail.com
Tue Oct 26 16:35:25 EDT 2010
On Tue, Oct 26, 2010 at 13:06, Fernando Perez <fperez.net at gmail.com> wrote:
> Hey Min,
>
> in console/console_widget.py:
>
> e11b615e (MinRK 2010-10-18 16:34:07 -0700 170) #
> Configure actions.
> e11b615e (MinRK 2010-10-18 16:34:07 -0700 171)
> action = QtGui.QAction('Print', None)
> e11b615e (MinRK 2010-10-18 16:34:07 -0700 172)
> action.setEnabled(True)
> e11b615e (MinRK 2010-10-18 16:34:07 -0700 173)
> action.setShortcut(QtGui.QKeySequence.Print)
> e11b615e (MinRK 2010-10-18 16:34:07 -0700 174)
> action.triggered.connect(self.print_)
> e11b615e (MinRK 2010-10-18 16:34:07 -0700 175)
> self.addAction(action)
> e11b615e (MinRK 2010-10-18 16:34:07 -0700 176)
> self._print_action = action
>
> you added in line 173 the default print keybinding to the Print
> action. One problem that introduces is that it overwrites the
> keybinding we had for Ctrl-P, which was equivalent to 'smart up arrow'
> (history-aware).
Hm, that's annoying, sorry I didn't catch it.
One of my very favorite things about OSX is that since the standard meta key
is cmd instead of ctrl, all regular GUI bindings (entirely cmd-based) and
all emacs-style bindings (ctrl-based) have no degeneracy, so you don't have
to choose between having ctrl-a be home or select-all, or this cmd/ctrl-P
behavior, and basic emacs navigation works in *all* GUI apps by default.
Since that keybinding has been there for a long
> time, is consistent with the terminal and we want to preserve as much
> similarity as reasonable with habits from the terminal, we need to
> change this. I think a reasonable compromise is to make:
>
> Ctrl-P -> 'smart up arrow'
> Ctrl-Shift-P -> Print
>
> But I don't want to make any changes, as I don't know if on the Mac,
> there is no problem. I don't know if on the mac, Control-p and Cmd-p
> are different, so that Ctrl-p remains as before and only Cmd-p goes to
> print.
>
> If that's the case, then we should probably leave it as you did for
> the Mac, and only change the keybinding for Linux/windows (which don't
> have a separate Cmd key).
>
Yes, we should do a platform check, since it would be completely hideous to
be the only Mac app in the world that doesn't use cmd-P for print.
Questions:
Is it just Linux, or will there also be a conflict in Windows?
Specifically: is OSX the only one without a problem, or is Linux the only
one with a problem?
Is there a similar conflict on ctrl-S?
-MinRK
>
> Thoughts?
>
> Cheers,
>
> f
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20101026/ca205b2f/attachment.html>
More information about the IPython-dev
mailing list