[Qgis-developer] Key accelerators vs. key shortcuts.

Tim Sutton tim at linfiniti.com
Sat Apr 8 17:13:31 EDT 2006


Hi Lubos

These are good observations. I would like the shortcuts to be
predictable and think its a good idea to look at other applications /
frameworks to see what standard shortcuts and accellerator keys are
used.

Most of your suggestions I agree with, only zoom in zoom out I dont. I
would like to reassign zoom in to '+' and zoom out to '-'. Also I
would assign ctrl++ to add _current_ layer to overview, and ctrl+- tor
remove current layer to overview. I would remove 'add all to overview'
keybindings.

I think th accelerator keys should be set to whatever is logical in
current localised version (ie. that its ok for them to vary from tr()
to tr()).

Remapping alt based short cuts to ctrl seems to me a very good idea....

If others agree to your changes I will apply your patch.

Regards

Tim



On 4/8/06, Lubos Balazovic <lubos.balazovic at gmail.com> wrote:
> Hi!
> For quick navigation through menu items QGIS uses key accelerators.
> Key accelerators are always based on one character of the item name
> (underlined character in item). In localized version is the item name
> translated, so accelerator is logically based on translated name of item, so
> the character used for accelerator obviously differs from original one.
> The problem comes out with shortcuts. If there are used shortcuts based on
> combination Alt+some_key then they may be (and mostly are) in conflict with
> key accelerators for main menu items (handled also with Alt). It occurs
> especially in localized versions (in current SVN also with original en_US
> version).
>
> There are 2 ways how to resolve this:
>
> 1. Shortcuts in localized versions are customizable through translation .ts
> files so it is possible to have own set of shortcuts for each language to
> avoid conflicts with key accelerators. However, I think it's not a good idea
> to have various shortcut sets - it is confusing for both, translators and
> users.
>
> 2. Much better solution is NOT to use shortcuts with Alt key (currently 7
> shortcuts affected).
>
> QGIS actually uses these 39 shotcuts (ambigous shortcuts are marked with "!",
> shortcuts with Alt-key marked with "*", after "//" followed with suggested
> replacement):
>
>   mActionFileNew->setShortcut(tr("Ctrl+N"));
> !  mActionFileOpen->setShortcut(tr("Ctrl+O")); // -OK-
> !  mActionFileSave->setShortcut(tr("Ctrl+O")); // Ctrl+S
>   mActionFileSaveAs->setShortcut(tr("Ctrl+A"));
> !  mActionFilePrint->setShortcut(tr("Ctrl+P")); // -OK-
> !  mActionSaveMapAsImage->setShortcut(tr("I")); // Ctrl+I
>   mActionExportMapServer->setShortcut(tr("M"));
>   mActionFileExit->setShortcut(tr("Ctrl+Q"));
>   mActionAddNonDbLayer->setShortcut(tr("V"));
>   mActionAddRasterLayer->setShortcut(tr("R"));
>   mActionAddLayer->setShortcut(tr("D"));
>   mActionNewVectorLayer->setShortcut(tr("N"));
>   mActionRemoveLayer->setShortcut(tr("Ctrl+D"));
>   mActionAddAllToOverview->setShortcut(tr("+"));
>   mActionRemoveAllFromOverview->setShortcut(tr("-"));
>   mActionShowAllLayers->setShortcut(tr("S"));
>   mActionHideAllLayers->setShortcut(tr("H"));
> * mActionProjectProperties->setShortcut(tr("Alt+P")); // P
> * mActionOptions->setShortcut(tr("Alt+O")); -nothing-
> * mActionCustomProjection->setShortcut(tr("Alt+I")); // -nothing-
>   mActionHelpContents->setShortcut(tr("F1"));
>   mActionQgisHomePage->setShortcut(tr("Ctrl+H"));
> * mActionQgisSourceForgePage->setShortcut(tr("Alt+H")); // -nothing-
>   mActionDraw->setShortcut(tr("Ctrl+R"));
> !  mActionZoomIn->setShortcut(tr("z")); // no case sensitivity // Ctrl++
> !  mActionZoomOut->setShortcut(tr("Z")); // no case sensitivity // Ctrl+-
> !  mActionZoomFullExtent->setShortcut(tr("f")); // -OK-
> !  mActionZoomToSelected->setShortcut(tr("F")); // S
> !  mActionIdentify->setShortcut(tr("I")); //-OK-
> !  mActionMeasure->setShortcut(tr("Ctrl+M")); // -OK-
> * mActionMeasureArea->setShortcut(tr("Alt+M")); // Ctrl+J
>   mActionShowBookmarks->setShortcut(tr("Ctrl+B"));
> * mActionNewBookmark->setShortcut(tr("Alt+B")); // B
> !  mActionAddWmsLayer->setShortcut(tr("Ctrl+M")); // W
> *  mActionInOverview->setShortcut(tr("Alt+O")); // O
> !  mActionShowPluginManager->setShortcut(tr("Ctrl+P")); // -nothing-
>   mActionCapturePoint->setShortcut(tr("."));
>   mActionCaptureLine->setShortcut(tr("/"));
>   mActionCapturePolygon->setShortcut(tr("Ctrl+/"));
>
> I've submitted a patch to trac, which tidies up shortcuts as suggested above.
>
> Maybe it would be also useful to remove tr() from setShortcut() to preserve
> shortcuts integrity (I've never seen real application with localized
> shortcuts yet, except Trolltech's Qt examples). In case of keeping tr() for
> shortcuts it would be useful to give hint what does the shortcut do (hint is
> the second parameter of tr() and it is displayed only in Qt-linguist).
>
> Regards
>
> Lubos
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.qgis.org
> http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-developer
>


--
Tim Sutton

Visit http://qgis.org for a great Open Source GIS
Skype: timlinux
MSN: tim_bdworld at msn.com
Yahoo: tim_bdworld at yahoo.com
Jabber: timlinux
Irc: timlinux on #qgis at freenode.net



More information about the Qgis-developer mailing list