Oliver,
I have followed your Basic code below and adapted it to Java and I can confirm
that it works for the intended purpose of binding a shortcut key to an
extension command.
Thank you.
De : Oliver Brinzing <[email protected]>
À : [email protected]
Envoyé le : Mercredi 17 juin 2015 20h36
Objet : Re: need some help to Accelerators.xcu
just found, that there is a service
"com.sun.star.ui.GlobalAcceleratorConfiguration"
maybe this will work:
Sub Main
oGlobalAccelCfg =
createUnoService("com.sun.star.ui.GlobalAcceleratorConfiguration")
Dim aKeyEvent as new com.sun.star.awt.KeyEvent
aKeyEvent.KeyCode = com.sun.star.awt.Key.F11
aKeyEvent.Modifiers = com.sun.star.awt.KeyModifier.MOD1
oGlobalAccelCfg.setKeyEvent(aKeyEvent,
"vnd.sun.star.script:Standard.Module1.ShowMsgBox?language=Basic&location=application"
)
oGlobalAccelCfg.store()
End Sub
Sub ShowMsgBox
MsgBox("Hello World!!!")
End Sub
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]