Hello Patrick,

On Tue, Mar 31, 2015 at 09:39:23AM -0400, Patrick Lynn wrote:
> I had asked about this bug previously and got a response saying to look at
> this
> http://opengrok.adfinis-sygroup.org/source/xref/aoo-trunk/main/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu
> .
> 
> The file was extremely long and didn't have a ton of comments so I wasn't
> sure exactly how it functioned. Many of the shortcuts were repeated with
> identical code several times so I assumed the shortcuts applied to
> different OO modules.

You can read the schema belonging to that configuration file:
https://svn.apache.org/viewvc/openoffice/trunk/main/officecfg/registry/schema/org/openoffice/Office/Accelerators.xcs?view=markup#l45
In order to understand it, it is better if you read the configuration
files, both the schema and the data, with an editor that lets you
collapse the nodes.

As the component defines, there are two main groups:

- "PrimaryKeys": contains the preferred keys
- "SecondaryKeys": contains the secondary keys

Each group has two sets:

- "Global": valid for all OpenOffice modules, its elements are of type
  "Key"
- "Modules": valid for an specific OpenOffice module, its elements are
  of type "Module"

So you have:

PrimaryKeys
     Global
     Modules
SecondaryKeys
     Global
     Modules

In the "Modules", each node has the name of an OpenOffice module, see
https://wiki.openoffice.org/wiki/Office_modules_since_OpenOffice.org_2.3

The type of the elements is defined in the templates:
https://svn.apache.org/viewvc/openoffice/trunk/main/officecfg/registry/schema/org/openoffice/Office/Accelerators.xcs?view=markup#l28

Both Global and Modules are a set of "Key".

Each Key is identified by its name in the oor:name.
The name is composed of the key name, followed by SHIFT and/or
modifiers, all in uppercase and separated by "_".
Keys are as defined in the API here
https://www.openoffice.org/api/docs/common/ref/com/sun/star/awt/Key.html
Modifiers here
https://www.openoffice.org/api/docs/common/ref/com/sun/star/awt/KeyModifier.html


Each Key has a property named Command, which contains a UNO command.
This property is localized but not translatable, this means that the
same key can be bound to a different UNO command, depending on the UI
language.

For example, among the PrimaryKeys for the module Writer,
"com.sun.star.text.TextDocument", you have Ctrl + B:

<node oor:name="B_MOD1" oor:op="replace">

The key is bound to different commands, depending on the UI language:

- in German, it is bound to .uno:JustifyPara, this means that Ctrl
  + B justifies a paragraph in Writer with German user interface

- in Spanish, Ctrl + B opens the search dialog: .uno:SearchDialog
  (Search is Buscar in Spanish, hence the "B")

- in English, Ctrl + B sets the text in Bold, .uno:Bold is the command


<value xml:lang="x-no-translate"> means that any of these values should
be translated, UNO commands are not meant to be translated!


> To try to narrow down which parts of the code apply to where I replaced all
> of the 4 N_SHIFT_MOD1 commands from NewDoc to Grow and after building the
> system the change did work and I could increase the font size in writer.
> 
> Is there some hidden structure to this file that i'm unaware of? I still
> don't know which one of the commands I replaced applies to writer, granted
> I can figure this out through trial and error, but i'm not sure where in
> the code I would add in the new shortcuts.
> 
> Then the big question is what should the shortcut keys be to increase and
> decrease font size in Writer?

See Regina's answer. Try to see what Microsoft Office does, as most
users come from a MSOffice background. According to this page
https://support.office.com/en-ca/article/Keyboard-shortcuts-for-Microsoft-Office-Word-628621ea-c0b7-4f01-bc3e-50640c0b46dc
http://support.microsoft.com/en-us/kb/290938

Decrease font size one value.   CTRL+SHIFT+<
Increase font size one value.   CTRL+SHIFT+>
Decrease font size 1 point.     CTRL+[
Increase font size 1 point.     CTRL+]

Side note, you don't need to build the whole source code in order to try
this out, you can make an extension.
See these files:
https://people.apache.org/~arielch/extensions/Accelerators.zip
that generate
https://people.apache.org/~arielch/extensions/AcceleratorsTest.oxt

If the shortcuts don't show up in the Tools - Customize - Keyboard,
that's a bug you'll have to fix ;)


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina

Attachment: signature.asc
Description: Digital signature

Reply via email to