[Solved] Can I import keyboard config using a macro?

The Application Programming Interface and the OASIS Open Document Format

[Solved] Can I import keyboard config using a macro?

Postby Tarkovsky » Mon Aug 20, 2018 7:29 pm

Tried to find anything in the internet, but no success.
So, I would like to import an existing keyboard config(with all its custom shortcuts) using a macro.
First, is it possible?
If yes, Can someone help me?
Last edited by Tarkovsky on Thu Aug 23, 2018 7:16 am, edited 2 times in total.
OpenOffice 4.1.3 on Arch Linux
Tarkovsky
 
Posts: 29
Joined: Fri Jun 30, 2017 9:17 am

Re: Can I import keyboard config using a macro?

Postby Zizi64 » Mon Aug 20, 2018 11:04 pm

So, I would like to import an existing keyboard config(with all its custom shortcuts) using a macro.


The keyboard locale layout is related to the operating system.

And there are some shortcut key functions, that are related to the operating system. It is not a good idea to modify them.

And there are sortcut key associations with different functions for the AOO applications. What application (Calc, Writer, or other) you want to control by the macro?
Tibor Kovacs, Hungary; LO4.4.7, LO6.1.5 on Win7-10 x64Prof.
PortableApps, winPenPack: LO3.3.0-6.2.2; AOO4.1.5
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
Zizi64
Volunteer
 
Posts: 7824
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Can I import keyboard config using a macro?

Postby Tarkovsky » Tue Aug 21, 2018 6:51 am

I don't want to touch the locale, I'm talking about the shortcuts from Tools > Customize... > Keyboard.
I want to change them in my Calc file, it's because I have created a SpreadSheet with lots of macros and foms. So, people will use it to insert data on each textbox and unlock some other textboxes on other sheets... But I want them to use some shortcuts to navigate. Since the shortcuts can be stored in a config file, that would be cool if I could load that file when they open my SpreadSheet.
OpenOffice 4.1.3 on Arch Linux
Tarkovsky
 
Posts: 29
Joined: Fri Jun 30, 2017 9:17 am

Re: Can I import keyboard config using a macro?

Postby Villeroy » Tue Aug 21, 2018 2:49 pm

Every Calc document has a configuration file Configurations2/accelerator/current.xml which is normally empty
You find the same configuration in the saved file after you saved your shortcuts via Tools>Customize>Keyboard> [Save...]

I don't know how to merge the trees nor do I know what happens when you do so but I would expect that there is some API interface for this.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, OpenOffice 4.x & LibreOffice 6.x
User avatar
Villeroy
Volunteer
 
Posts: 26552
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Can I import keyboard config using a macro?

Postby Tarkovsky » Tue Aug 21, 2018 5:54 pm

But I want to save the .cfg file separated from the current document, and just use the macro to load it when my document is opened.
OpenOffice 4.1.3 on Arch Linux
Tarkovsky
 
Posts: 29
Joined: Fri Jun 30, 2017 9:17 am

Re: Can I import keyboard config using a macro?

Postby Villeroy » Tue Aug 21, 2018 6:35 pm

This makes no sense to me.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, OpenOffice 4.x & LibreOffice 6.x
User avatar
Villeroy
Volunteer
 
Posts: 26552
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Can I import keyboard config using a macro?

Postby Zizi64 » Tue Aug 21, 2018 8:46 pm

But I want to save the .cfg file separated from the current document, and just use the macro to load it when my document is opened.

Why you want save the settings separatelly? Just store (save) the changed settings of the Toolbar, Hotkeys, and the Menu items into the specific document: then they will be loaded together the document, and they will not be appeared, when you open and another document.
Tibor Kovacs, Hungary; LO4.4.7, LO6.1.5 on Win7-10 x64Prof.
PortableApps, winPenPack: LO3.3.0-6.2.2; AOO4.1.5
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
Zizi64
Volunteer
 
Posts: 7824
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Can I import keyboard config using a macro?

Postby Tarkovsky » Tue Aug 21, 2018 10:01 pm

I'm sorry, but there is just an option to save the keyboard shortcuts in a .cfg file or change it for Calc or LIbreOffice.
I can store the menus, context menus, toolbars and events inside my document, but can not store the keyboard shortcuts keys...
OpenOffice 4.1.3 on Arch Linux
Tarkovsky
 
Posts: 29
Joined: Fri Jun 30, 2017 9:17 am

Re: Can I import keyboard config using a macro?

Postby Zizi64 » Tue Aug 21, 2018 10:55 pm

I'm sorry, but there is just an option to save the keyboard shortcuts in a .cfg file or change it for Calc or LIbreOffice.
I can store the menus, context menus, toolbars and events inside my document, but can not store the keyboard shortcuts keys...

OOoops! Yes, I see now: It is true.
Tibor Kovacs, Hungary; LO4.4.7, LO6.1.5 on Win7-10 x64Prof.
PortableApps, winPenPack: LO3.3.0-6.2.2; AOO4.1.5
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
Zizi64
Volunteer
 
Posts: 7824
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Can I import keyboard config using a macro?

Postby JeJe » Wed Aug 22, 2018 11:48 am

Have you considered a keyboard listener/handler?
Openoffice 4.1.2
Windows 8
JeJe
Volunteer
 
Posts: 459
Joined: Wed Mar 09, 2016 2:40 pm

Re: Can I import keyboard config using a macro?

Postby Villeroy » Wed Aug 22, 2018 2:38 pm

Imported keyboard settings for a single document do work. This is something you can't do in the GUI and the GUI can not override this setup.
Starting with today's topic https://forum.openoffice.org/en/forum/v ... 46#p451846 I saved the configuration which inserts a new row at Ctrl+R and then transfered Configurations2/accelerator/current.xml into a Calc document using a zip tool.
Now Ctrl+R inserts a new row into this document's spreadsheet whereas the same shortcut used in other spreadsheets aligns cell contents to the right.
Attachments
Calc_Ctrl-R.ods
(12.6 KiB) Downloaded 50 times
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, OpenOffice 4.x & LibreOffice 6.x
User avatar
Villeroy
Volunteer
 
Posts: 26552
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Can I import keyboard config using a macro?

Postby Tarkovsky » Wed Aug 22, 2018 5:07 pm

Have you considered a keyboard listener/handler?

Yes, but I want to remove some shortcuts(like the navigator hotkey) that enable the users to access other parts of my spreadsheet.
Imported keyboard settings for a single document do work. This is something you can't do in the GUI and the GUI can not override this setup.
Starting with today's topic https://forum.openoffice.org/en/forum/v ... 46#p451846 I saved the configuration which inserts a new row at Ctrl+R and then transfered Configurations2/accelerator/current.xml into a Calc document using a zip tool.
Now Ctrl+R inserts a new row into this document's spreadsheet whereas the same shortcut used in other spreadsheets aligns cell contents to the right.

That's awesome, it does exactly what I want... but on my job I'm not allowed to install new apps due to compliance issues. I can use winrar there, but will that work?
OpenOffice 4.1.3 on Arch Linux
Tarkovsky
 
Posts: 29
Joined: Fri Jun 30, 2017 9:17 am

Re: Can I import keyboard config using a macro?

Postby Villeroy » Wed Aug 22, 2018 5:25 pm

Even Windows can handle zip files and you are certainly allowed to use templates.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, OpenOffice 4.x & LibreOffice 6.x
User avatar
Villeroy
Volunteer
 
Posts: 26552
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany


Return to UNO API and ODF

Who is online

Users browsing this forum: No registered users and 3 guests