Keyboard Shortcuts for Categories

Ideas for improvements and requests for new features in XnView MP

Moderators: XnTriq, helmut, xnview

User avatar
m.Th.
XnThusiast
Posts: 1676
Joined: Wed Aug 16, 2006 6:31 am

Keyboard Shortcuts for Categories

Post by m.Th. »

A stringent need in high-performance cataloging environments is quick category (keyword) assignment.

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:
Category-Menu.jpg
(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:
Category-Prop.jpg
(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:
ASP-Shortcuts.jpg

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
    }
  }
}
Perhaps only DoUserRefine needs some explanations. Basically, it will show a confirmation dialog asking the user which category(ies) will be assigned if under the same shortcut will be more categories. Something like this:
Multiple-checkbox-chooser.png
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.
You do not have the required permissions to view the files attached to this post.
m. Th.

- Dark Themed XnViewMP 1.7.1 64bit on Win11 x64 -
User avatar
m.Th.
XnThusiast
Posts: 1676
Joined: Wed Aug 16, 2006 6:31 am

Re: Keyboard Shortcuts for Categories

Post by m.Th. »

...a new post just to make clearer some things:

1. The new field (Tags.Shortcut) must be indexed, of course.

2. The Category Properties window shown in the previous post should have at least the following fields:
  • Name (we must have the possibility to edit the Category name)
  • Parent (very important! we must change the tree structure isn't it?)
  • Shortcut (the topic at hand)
...and in the near future Sets of Categories :-)
m. Th.

- Dark Themed XnViewMP 1.7.1 64bit on Win11 x64 -
kevin37
Posts: 4
Joined: Fri Sep 18, 2020 10:33 pm

Re: Keyboard Shortcuts for Categories

Post by kevin37 »

Hello,

Did you manage to find a way to quickly assign keywords with a shortcut key?

Desperately searching for a way to do this to sort 100's of images.

Thanks so much!
Cheers
Gwenael Q.
Posts: 304
Joined: Mon Apr 06, 2020 2:06 am
Location: Martinique

Re: Keyboard Shortcuts for Categories

Post by Gwenael Q. »

Hello,

@kevin37 : you should find what you want here : https://www.xnview.com/wiki/index.php/C ... #Shortcuts

Hope this helps.
DexterMorgan12
Posts: 3
Joined: Sat Sep 14, 2024 11:41 am

Re: Keyboard Shortcuts for Categories

Post by DexterMorgan12 »

This was a great help thank you, I am trying to tag things with categories in fullscreen viewer mode but I cannot set up the shortcut there, is there a way to do this?