Besides the Autocomplete Engine, enough programs implement the possibility of having keyboard shortcuts to the categories.
GUI-wise, I think that the best approach is by adding a 'Details / Properties...' option in the right-click menu in the Category Tree here:
(A similar method is to be found in other programs)
Which will show a Properties window which will allow us to assign a shortcut to the current category like this one from Photo Supreme:
(No, I don't say that we must implement ALL these things now. One step at a time).
Another approach, is the one employed by AfterShot Pro which has a centralized management of shortcuts for the keywords / categories. Perhaps is better but if the properties of the Category/Keyword object will grow, it will be harder to manage. See here:
Implementation-wise, I would suggest something like this:
1. Add a new column to the Tags table called Shortcut which will be of type String.
2. When the user will assign a keyboard shortcut through the GUI workflow described above, store the shortcut in the Tags.Shortcut field. Also, be sure to read the value of this field when the 'Details / Properties...' is shown.
3. Usage: When the user will press a key combination, check first the category assignments in the Tags.Shortcuts column and if there are any hits read them all, process them and clear the key combination. Otherwise run the old keyboard processing engine.
Something like this: (in pseudo-code) - scroll to see:
Code: Select all
myShortcutsList.Clear; //this is the temp list with the Categories for the shortcut which we want to search
nResult = SQLiteExec(&db, 'SELECT TagID, Label FROM Tags WHERE Shortcut = 'Ctrl+Foo'', myCallback); //myCallback will fill the myShortcutsList structure
if nResult = 0 then //everything read ok from DB
{
if myShortcutsList.Count=0 then //nothing found. :-s Go to old (normal) keyboard processing
{
myOldKeyboardEngine; //this is the old code...
}
else //AHA!!!! Some shortcuts here...
{
if myShortcutsList.Count>1 then DoUserRefine; //!!!(*) --- ask the user which category(ies) to assign.
for i :=0 to myShortcutsList.Count-1
{
AssignCategoryToSelection(myShortcutsList[i].TagID); //IOW for each selected photo put the categories
}
}
}
In this way with minimal effort we'll have a state-of-the-art keyboard engine for the categories which will speedup the keyword assignment and support also the shortcut collisions, giving us a leading edge on most competitors in this area.
If something isn't clear or needs enhancement(s), just drop a line.