From kde-i18n-doc Tue Aug 28 22:08:15 2007 From: Luciano Montanaro Date: Tue, 28 Aug 2007 22:08:15 +0000 To: kde-i18n-doc Subject: Shortcuts, XMLGui and locale Message-Id: <200708290008.15393.mikelima () cirulla ! net> X-MARC-Message: https://marc.info/?l=kde-i18n-doc&m=118837331425832 I need some clarification about the best way to specify shortcuts for use in kde programs. Shorcuts may be specified in a KDE program by specifiying them in the programui.rc of a program or by explicitly using the setShortcut() method of the QAction class. Most applications seem to use the setShortcut method, some use mostly the uirc file. Is there a good reason to use one over the other? Using the uirc option has the advantage that less code is needed; if the user overrides a shortcut, the rc file has the last word anyway. Moreover, the action could be specified together with the action definiton. It may also make customization of the shortcuts a little easier. The definition of the shortcut in C++ has the advantage that the program may still be usable without an rc file. But is this an important case? Am I missing something important here, or are the shortcut defined in C++ due to historical reason? Another issue that may be important to investigate is if the shortcuts should be translatable. Since layout varies with the language, some shortcuts may be awkward or impossible to type on a particular keyboard; or it may be useful to add alternatives for certain languages. Languages with non-latin layouts come to my mind: I've not used a Greek keyoard to type greek, but I remember in Greece a key combination is used to switch between US and greek layout. I think Ctrl-key sequences send the proper keycode, but it may be useful to add a greek letter shortcut for unqualified shortcuts (single letter shortcuts, say directions in games). Well, what do you think? Luciano