Key sequences similar to those used in GNU Emacs , allowing up to four key codes, do not work in the Editor after the changes introduced in PR #7768. I haven't thought about this case when working on this PR, so this needs to be fix.
@ccordoba12 what do you think is the severity of this?
Also, I'm not sure, but I think there is a problem with how we check for conflicts for these kind of shortcuts in our keyboard preference editor. For example, I do not understand how a shortcut with a keyseq defined as Ctrl+C, then Ctrl+X
could work if Ctrl+C
is already used for copy
and Ctrl+X
is already used for cut
.
Ressources:
https://srinikom.github.io/pyside-docs/PySide/QtGui/QKeySequence.html#gnu-emacs-style-key-sequences
https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts
https://www.gnu.org/software/emacs/refcards/pdf/refcard.pdf
what do you think is the severity of this?
Not that big, but we definitely need to fix this for beta2.
what do you think is the severity of this?
Not that big, but we definitely need to fix this for beta2.
Do we have a release date for beta 2?
End of this month, if we manage to fix all pending LSP stuff.
End of this month, if we manage to fix all pending LSP stuff.
Ok good, it is going to be fixed by then. But I'm not sure I understand correctly how these kind of Emacs style shortcuts are supposed to work. See my example in the OP.
To activate the Ctrl+C, Ctrl+X
shortcuts, do I have to keep the Ctrl
modifier down while I press the C
and X
?
How can such a shortcut work if Ctrl+C
and Ctrl+X
keyseq are already assigned to other shortcuts? Sorry, I don't get it. I'll try do to some research about this tonight.
do I have to keep the Ctrl modifier down while I press the C and X?
Yes, that's how Emacs shortcuts work.
do I have to keep the Ctrl modifier down while I press the C and X?
Yes, that's how Emacs shortcuts work.
OK I see, thanks.
But then, lets say Ctrl+B, Ctrl+D
is assigned to the delete line
shortcut and Ctrl+B
is assigned to the copy
shortcut. I took these keyseq so not to have the builtin shortcuts in the way while trying to understand this.
How can I know, when the Ctrl+B
combination is pressed, that the user want to do the delete line
shorctut and not the copy
shortcut?
I can tell you that this situation is currently not working in Spyder 3, i.e. Ctrl+B, Ctrl+D
do not trigger the delete line
shortcut, but the copy
shortcut instead. It is working only if I unbind Ctrl+B
from the copy
shortcut.
In Emacs, you do not have to keep the Ctrl
key pressed down when typing Ctrl+B, Ctrl+D
. However, it is not possible to have both Ctrl+B
and Ctrl+B, Ctrl-D
shortcuts defined. If you do, the Ctrl-B
shortcut takes precedence.
In Emacs, you do not have to keep the Ctrl key pressed down when typing Ctrl+B, Ctrl+D. However, it is not possible to have both Ctrl+B and Ctrl+B, Ctrl-D shortcuts defined. If you do, the Ctrl-B shortcut takes precedence.
Ok thank you very much.
However, it is not possible to have both
Ctrl+B
andCtrl+B, Ctrl-D
shortcuts defined. If you do, theCtrl-B
shortcut takes precedence.
@ccordoba12 is it ok if I do not allow this in our keyboard shortcut editor? I would display a The new shortcut conflicts with
warning in these cases.
Sure, that's fine.
@jitseniesen What about something like Ctrl+x, then k
? This is an example I've taken from here: https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts
Does it mean that you need to do a Ctrl+x
combo, then you can release the Ctrl
if you want and press k
? Alone? Without the Ctrl
?
I do not think we currently support that kind of shortcut in Spyder. I mean, it's not possible to define such a shortcut currently in our shortcut editor.
@jitseniesen What about something like
Ctrl+x, then k
? This is an example I've taken from here: https://en.wikipedia.org/wiki/Table_of_keyboard_shortcutsDoes it mean that you need to do a
Ctrl+x
combo, then you can release theCtrl
if you want and pressk
? Alone? Without theCtrl
?
Yes. Ctrl+x, Ctrl+k
and Ctrl+x, k
are two different shortcuts. In the first case, you type x
and k
while holding Ctrl
; in the second case, you type x
while holding Ctrl
, then release Ctrl
and then type k
. You can also have Ctrl+x, Shift+k
(and many other possibilities).
Yes. Ctrl+x, Ctrl+k and Ctrl+x, k are two different shortcuts. In the first case, you type x and k while holding Ctrl; in the second case, you type x while holding Ctrl, then release Ctrl and then type k. You can also have Ctrl+x, Shift+k (and many other possibilities).
Thank you very much @jitseniesen, this is very useful information.
So @ccordoba12... do I try to cover the full range of Emacs keyseq or do I aim only at covering what we were supporting before?
The idea is (one day) to add Emacs support to the Editor, please try to cover the full range of possibilities.