-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keybinding Enhancements #2217
Keybinding Enhancements #2217
Conversation
I've completed what I originally intended, but am open to suggestion. We could also add another |
User input method seems more natural to me. If I remember well Qt supports multiple letter key out of the box so it would be easy to add afterwards. |
@blink1073 what needs to be done to get this going? |
@goanpeca, this PR is ready as far as I'm concerned. I think it demonstrates a basic functionality that we are missing. I'm not terribly excited about implementing the multi-keystroke functionality. |
Why (the multi keystroke), sorry I am kinda o ignorant on this emacs issue... By multi keystroke it means entering in different states where different keystrokes are used? or..? |
Right, unless there is a built in way for Qt to sense a Keystroke sequence for us. |
Also, there is the UI of how the user sets the preference for a complex Keystroke sequence. We could allow them to type it in a box with validation, or enter it as a raw key sequence (which for example KDE does when you enter system keyboard shortcuts). |
I do not know if Qt has a default for handling states.. if it does not, well I guess is something we need to handle... which, unless I am missing something, would not be very complicated. |
From http://doc.qt.io/qt-5/qkeysequence.html:
|
@Nodd I do not see how this would solve this issue of having states? |
Why do you mean by "state" ?
Qt supports them out of the box. |
@Nodd, yes now I see how to use it, my bad ;-) |
Sorry for not reviewing this one before. I'll merge first the other PRs from @goanpeca that are almost ready, and then I'll continue with this one :-) |
Almost :-| ? ? ? |
I created a small demo showing how to get keyboard sequences from the user. This could be used as the basis for the Keyboard Preferences dialog. |
'editor/next char': "Alt+F", | ||
'editor/previous word': "Meta+B", | ||
'editor/next word': "Meta+F", | ||
'editor/Kill to Line End': "Meta+K", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does Kill
mean? Could you find a better word? ;-)
Also, I'd like (when possible) to use here the same shortcuts as the IPython console (just for consistency and muscle memory :-)
You can find them in
Help > IPython doc > Console help
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahem: "C-k: kill from cursor to the end of the line", from the exact docs you pointed to 😛
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know ;-) But since these shortcuts are also going yo be used by people not familiar with Emacs, I was thinking to use Delete or Clear instead of Kill
This is good and simple, I like it! The only thing is that I'd like to add more shortcuts because (most surely) people will expect them as part of offering Emacs keybindings. Some of them could be
I don't if @blink1073 can think of others :-) |
@ccordoba12, we cannot use compound keyboard preferences unless we change the way they are entered in the dialog. |
@blink1073 you would prefer an extra column? or a redesign (with no columns) and a dynamic entry of shortcuts? |
The columns work, but are not very user-friendly. Adding more of them will be even worse. I'd say that the right thing to do is to enter shortcuts dynamically, it's more practical and more modern. Here is another idea for later: define default presets to be loaded by the user (Spyder default, Emacs, Matlab, R, Sublime Text, Vi...) |
@ccordoba12, I don't follow. You want me to redo the rebase? I'd just as soon copy these files and start a new PR to be honest with you. |
That'd be fine too :-) I just thought you could strip half of your commits here to fix things, but my git-fu is very limited to be honest ;-) |
c39d350
to
8b03dbf
Compare
Squashing to one commit did the trick, ready! |
Great!! I hope it's not too much to ask, but could you amend the commit message to write something simpler on it? :-) |
8b03dbf
to
c60f3a3
Compare
Done! |
Thanks! I think the only thing left to fix |
What do you suggest? The system defaults still work: |
Should we just use those and punt? |
Yes, let's do that for now. Then in the (future) PR that implements Emacs keybindings, you can see how to solve the issue with |
All set. |
Unfortunately all shortcuts that involve |
@Nodd, could you test this branch in PyQt5 5.4 to see if in that version this problem is fixed? |
Nope, |
Perhaps the Meta key has moved to something like the |
I don't think so since in #2367 I can set a shortcut using |
Everything is working on PyQt5 on my Mac. |
[Python 3.4.3 64bits, Qt 5.3.1, PyQt5 5.3.2 on Darwin] |
@@ -717,7 +743,7 @@ def is_ubuntu(): | |||
# 2. If you want to *remove* options that are no longer needed in our codebase, | |||
# you need to do a MAJOR update in version, e.g. from 3.0.0 to 4.0.0 | |||
# 3. You don't need to touch this value if you're just adding a new option | |||
CONF_VERSION = '17.0.0' | |||
CONF_VERSION = '17.1.0' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update this value to 18.1.0
. I merged PR #2237 with the wrong CONF_VERSION
and now we need this value :-)
@blink1073, it seems the problem is only on Linux then ;-) I think we should merge this PR as it is now and try to find suitable shortcuts in another PR or in master (I could do that :-). This would let us keep things moving because there's nothing else to do here (except for my last comment :-) @blink1073, what do you think? |
Done, merge away! |
Ok, merging!! |
Fixes #729
Fixes #1212
Fixes #2047
Fixes #2347
Adds the following keybindings, including kill-ring support:
Also makes the follow existing key sequences configurable:
The only changed shortcut is