Accelerator for toggle button in toolbar
Posted: Tue May 31, 2022 4:07 am
I'm writing an extension where I want to have an accelerator for a toggle button in a toolbar. I'd like the accelerator to toggle the state of the button just as control-B does for the bold toolbar button.
My toolbar button looks like this:
But I'm not sure what to put in the Accelerators.xcu file to trigger it:
Thanks in advance for any help on this!
My toolbar button looks like this:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<oor:component-data xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" oor:name="Addons" oor:package="org.openoffice.Office">
<node oor:name="AddonUI">
<node oor:name="OfficeToolBar">
<node oor:name="com.philolog.hoplitekb.toolbar" oor:op="replace">
<node oor:name="com.philolog.hoplitekb.button1" oor:op="replace">
<prop oor:name="URL" oor:type="xs:string">
<value>com.philolog.hoplitekb:open</value>
</prop>
<prop oor:name="ControlType">
<value>ToggleButton</value>
</prop>
<prop oor:name="Title" oor:type="xs:string">
<value xml:lang="en-US">Toggle Hoplite Keyboard</value>
</prop>
<prop oor:name="Target" oor:type="xs:string">
<value>_self</value>
</prop>
<prop oor:name="Context" oor:type="xs:string">
<value>com.sun.star.text.TextDocument</value>
</prop>
</node>
</node>
</node>...
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<oor:component-data xmlns:oor="http://openoffice.org/2001/registry"
xmlns:xs="http://www.w3.org/2001/XMLSchema" oor:name="Accelerators"
oor:package="org.openoffice.Office">
<node oor:name="PrimaryKeys">
<node oor:name="Modules">
<node oor:name="com.sun.star.text.TextDocument">
<node oor:name="0_MOD1" oor:op="replace">
<prop oor:name="Command">
<value xml:lang="en-US">???????????</value>
</prop>
</node>
</node>
</node>
</node>
</oor:component-data>