You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was thinking the other day of a Keys menu in Preferences. Where you could see and update the keyboard shortcuts. Like VLC has, for example, where you can even search through them.
While going through the translation files, I noticed you could set the & shortcut wherever you wanted, and initially thought it worked the same as .Net, but noticed from @justinclift's code, this has to be 'hard coded' in Qt - shortcut keys have to be specifically coded. I presume then that the accelerators defined by a & sign on labels, etc, are for cosmetic purposes only?
If you have a menu item with the text T&est, does pressing ALT + e on Windows trigger it? I remember this is the way ampersand worked, though I don't know how it would work on mac.
@chrisjlocke For the top drop down menu's (eg File, View, etc), adding an & sign should in theory automatically create a platform-appropriate shortcut.
In reality, it seems to be a bit inconsistent for DB4S. It might just be we're doing something weird, or out-of-order in our code base though. (unsure)
@justinclift I know, it would be awesome. I searched for an already created library (widget) but couldn't find one :(
I stumbled upon this package manager though, but I'm not sure that the packages page contains all of the available packages. I'll install it in a couple of days and see if I find something useful there.
Was thinking about this earlier. If we remove the & signs from _all_ of our strings, and instead create all of the keyboard shortcuts at program startup (eg like this code, that would probably benefit us in two ways:
The keyboard shortcuts could then be stored/retrieved using PreferencesDialog::saveSettings()/getSettingsValue(). That would let them be mapped into a new tab in the PreferencesDialog for learning/changing.
In initial thinking through of that... depending how the "choose your new key sequence" bit is done, it could be simple to implement.
If we go for the simple approach, such as a Line Edit field with "Ctrl-A" (or whatever) typed in manually, we could get an initial implementation done pretty quickly
The most user friendly approach is probably one where the user gets to click a widget, then press their desired key combination, which the widget captures and converts to the appropriate Qt shortcut combination. That doesn't sound like a particularly quick/easy/accurate thing to implement though.
Personally, I'd go with the first approach just to see how usable that turns out to be. It'd probably be acceptable. 😄
@justinclift, I don't think is a good idea to let the users type the shortcut. Even in your example, you wrote "Ctrl-A" but I would have typed "CTRL+a".
Also, I think that a middle solution that's not complicated is to have ComboBox for the modifier keys and a 1 character limited text field like this:
@revolter Heh Heh Heh, well for me yeah it wouldn't have worked like that... I would have had to figure out to use "+" instead of "-" (as you did properly).
Kind of thinking it wouldn't be a real issue though, as the fields would be pre-populated with the current keys. Wouldn't that clue people into the correct format to use?
@SafaAlfulaij Well, that probably explains a few things. 😉
You worry about irrelevant things. Relevant thing is to create observer which would control all possible shortcuts in all possible classes where they are currently hardcoded.
If someone creates a list of those in wiki, I'll implement it. UPD: list of shortcuts that can be changed.
I think once you have a system to change the keys ... someone likes Ctrl+R as thats what they're used to, but someone else is used to F5... then you can 'open the system' so people can change it all - you may as well change any key rather than just this one, that one or the other...
At work, we use the 'ICE' method of prioritising - impact, cost and ease. The impact here is higher usability, but I'm not sure on the ease, so its hard to weigh this issue amongst all the others. With VB, its quite easy to 'soft code' such doodlies. I'm not sure if the same can be done in Qt.
Anyway, I am already working on it. Help with testing would be really appreciated, as well as another wiki page for OS X shortcuts since those are beyond my conversance.
Activity
revolter commentedon Jul 27, 2016
I was thinking the other day of a
Keysmenu inPreferences. Where you could see and update the keyboard shortcuts. Like VLC has, for example, where you can even search through them.chrisjlocke commentedon Jul 27, 2016
While going through the translation files, I noticed you could set the & shortcut wherever you wanted, and initially thought it worked the same as .Net, but noticed from @justinclift's code, this has to be 'hard coded' in Qt - shortcut keys have to be specifically coded. I presume then that the accelerators defined by a & sign on labels, etc, are for cosmetic purposes only?
revolter commentedon Jul 28, 2016
If you have a menu item with the text
T&est, does pressingALT + eon Windows trigger it? I remember this is the way ampersand worked, though I don't know how it would work on mac.justinclift commentedon Jul 28, 2016
@chrisjlocke For the top drop down menu's (eg File, View, etc), adding an & sign should in theory automatically create a platform-appropriate shortcut.
In reality, it seems to be a bit inconsistent for DB4S. It might just be we're doing something weird, or out-of-order in our code base though. (unsure)
justinclift commentedon Jul 28, 2016
@revolter If you want to add a user changeable "Keyboard Mapping" thing to the Preferences, that sounds really useful for people. 😄
revolter commentedon Jul 28, 2016
@justinclift I know, it would be awesome. I searched for an already created library (widget) but couldn't find one :(
I stumbled upon this package manager though, but I'm not sure that the packages page contains all of the available packages. I'll install it in a couple of days and see if I find something useful there.
justinclift commentedon Jul 28, 2016
@revolter Cool. Hadn't come across qpm.io. Looks useful. 😄
justinclift commentedon Jul 29, 2016
Was thinking about this earlier. If we remove the & signs from _all_ of our strings, and instead create all of the keyboard shortcuts at program startup (eg like this code, that would probably benefit us in two ways:
In initial thinking through of that... depending how the "choose your new key sequence" bit is done, it could be simple to implement.
Personally, I'd go with the first approach just to see how usable that turns out to be. It'd probably be acceptable. 😄
revolter commentedon Jul 29, 2016
@justinclift, I don't think is a good idea to let the users type the shortcut. Even in your example, you wrote "Ctrl-A" but I would have typed "CTRL+a".
Also, I think that a middle solution that's not complicated is to have ComboBox for the modifier keys and a 1 character limited text field like this:
SafaAlfulaij commentedon Jul 29, 2016
Accelerators are triggered by
Alt+EnotCtrl+E. They are different than shortcuts :)Shortcuts are like
Ctrl+CCtrl+V..justinclift commentedon Jul 29, 2016
@revolter Heh Heh Heh, well for me yeah it wouldn't have worked like that... I would have had to figure out to use "+" instead of "-" (as you did properly).
Kind of thinking it wouldn't be a real issue though, as the fields would be pre-populated with the current keys. Wouldn't that clue people into the correct format to use?
@SafaAlfulaij Well, that probably explains a few things. 😉
revolter commentedon Jul 29, 2016
@justinclift, I personally wouldn't bet on that. There are a lot of people who don't pay attention, and we can't (and shouldn't) rely on them.
4 remaining items
vtronko commentedon Sep 1, 2016
@revolter why would user type a shortcut? He would just press it and apply settings.
vtronko commentedon Sep 1, 2016
You guys really don't understand how it works, nobody enters shortcuts in text field.
vtronko commentedon Sep 1, 2016
You worry about irrelevant things. Relevant thing is to create observer which would control all possible shortcuts in all possible classes where they are currently hardcoded.
If someone creates a list of those in wiki, I'll implement it.
UPD: list of shortcuts that can be changed.
justinclift commentedon Sep 1, 2016
Thanks @chrisjlocke. 😄
With Ctrl+P, it's probably that way from when it was first implemented. P == Plot or similar.
On the other hand though, Ctrl+P is commonly by programs to mean "Print". (eg send the document, view, whatever to a printer)
@innermous That's a bit confusing. When you say "shortcuts that can be changed", are you meaning some shortcuts can't be?
vtronko commentedon Sep 1, 2016
@justinclift why would you change "Open file" shortcut, for example?
justinclift commentedon Sep 1, 2016
Heh Heh Heh
Sure, I don't have a need to... but some people might. (possibly assistive devices maybe? but I really don' t know)
Anyway, isn't the whole point that we give people a choice, so if they want to change it they can? 😄
vtronko commentedon Sep 1, 2016
@justinclift never mind then, I don't like where it goes.
justinclift commentedon Sep 1, 2016
No worries @innermous. 😄
chrisjlocke commentedon Sep 1, 2016
I think once you have a system to change the keys ... someone likes Ctrl+R as thats what they're used to, but someone else is used to F5... then you can 'open the system' so people can change it all - you may as well change any key rather than just this one, that one or the other...
At work, we use the 'ICE' method of prioritising - impact, cost and ease. The impact here is higher usability, but I'm not sure on the ease, so its hard to weigh this issue amongst all the others. With VB, its quite easy to 'soft code' such doodlies. I'm not sure if the same can be done in Qt.
revolter commentedon Sep 2, 2016
@innermous, Where did I say that?
vtronko commentedon Sep 2, 2016
@revolter
vtronko commentedon Sep 2, 2016
Anyway, I am already working on it. Help with testing would be really appreciated, as well as another wiki page for OS X shortcuts since those are beyond my conversance.
revolter commentedon Sep 2, 2016
I said that the users should not type the shortcuts.
chrisjlocke commentedon Sep 2, 2016
@revolter's solution (combo box and textbox) is the best solution - easier to validate what the user wants. The Windows' method (ie, VB) is painful!
Just because 'Ctrl' isn't in the right case, it throws a wobbly.
revolter commentedon Feb 27, 2017
Noticed SmartGit's solution for this, from which we might take some ideas:
It detects duplicated and shows a breadcrumb style name separated by
|.Here I set shortcuts for
Check OutandCherry-Pickand the initial ones move to theDefaultcolumn.