<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, May 18, 2022 at 9:50 AM Volker Hilsheimer <<a href="mailto:volker.hilsheimer@qt.io">volker.hilsheimer@qt.io</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">> On 18 May 2022, at 10:09, Laszlo Papp <<a href="mailto:lpapp@kde.org" target="_blank">lpapp@kde.org</a>> wrote:<br>
>> On Wed, May 18, 2022 at 9:03 AM Volker Hilsheimer <<a href="mailto:volker.hilsheimer@qt.io" target="_blank">volker.hilsheimer@qt.io</a>> wrote:<br>
>> Have you ever used vim? :P Deleting until the end of the line, or deleting the next word, are all multi-chord key sequences.<br>
> <br>
> Sure, but in this context, we were discussing shortcut editors that was linked in KDE.<br>
>  <br>
>> > The current proposal is to make QKeySequenceEdit be able to behave like a QShortcutEdit by adding a property. But for keyboard shortcuts, "key sequence" does not make all that much sense. We are just retrofitting it for that purpose, I feel.<br>
>> <br>
>> You are not forced to use key sequences with more than one chord, but in some applications, such as IDEs, multi-chord shortcuts are pretty common, even without using vim mode.<br>
> <br>
> We have actually done thorough investigation on this, and the fact is that the vast majority of the applications (in fact, everything we could find ourselves) use single combination shortcut. It is not really common or even practical to have sequences for shortcuts. Please refer to for example this for further information:<br>
> <br>
> <a href="https://www.ranorex.info/difference-between-key-sequence-and-key-shortcut-t8864.html" rel="noreferrer" target="_blank">https://www.ranorex.info/difference-between-key-sequence-and-key-shortcut-t8864.html</a><br>
<br>
<br>
That’s one way of defining these terms. VSCode calls things “key combination” and “chords”, and “key bindings". Qt calls them key sequence and shortcut.<br>
<br>
In Visual Studio Code, which I’d consider to be a rather popular application, you open the Keyboard Shortcut editor with a sequence of Cmd+K, Cmd+S. The “testing.cancelRun” command is then by default (I think, mine is somewhat heavily customized, but I don’t think I touched that one) bound to the key sequence Cmd+;, Cmd+X, or the “Add Line Comment” command is bound to Cmd+K, Cmd+C. Many of the extensions for VSCode use key sequences, like “jump to previous bookmark" when you install that extension is Cmd+K, J (toggling it is Cmd+K,K).<br>
<br>
And you can edit the key sequences there, and end the sequence input via Return; which makes it impossible to use Return in a sequence, but you can’t have it all, I suppose.<br></blockquote><div><br></div><div>The thing, emacs, vim, Visual Code or even QtCreator are development environments. Most of the apps out there, like ours, are not geeky development environments. I consider these sort of applications the minority out there as far as applications go. This is not to invalidate them. I am just saying that Qt designed this class for these minor use cases. I would like them to become useful also by the majority.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">QKeySequenceEdit is 330 lines of code, so writing your own that is ideal for your use case might sometimes be the best option. And if you have ideas on how we can make QKeySequenceEdit more user-friendly without categorically constraining existing use cases (Perhaps a property that allows defining a “finish editing” key? And/or adding a protected finishEditing function that would allow a subclass to handle a specific key event to finish editing), then patches welcome.<br></blockquote><div><br></div><div>The list of properties that I think a generic hotkey editor would need:</div><div><br></div><div>1. Single combination</div><div>2. Finishing character</div><div>3. No timer! This could be done automatically for keyPressEvent timing. No need to time again in a custom widget.</div><div>4. Allowing Esc to be assigned like in some apps.</div><div><br></div><div>I am happy to provide patches for these over some course of time as we have got requests for all these.</div><div><br></div><div>Thanks.</div><div><br></div></div></div>