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 <oliver.brinz...@gmx.de>
 À : api@openoffice.apache.org 
 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: api-unsubscr...@openoffice.apache.org
For additional commands, e-mail: api-h...@openoffice.apache.org



  

Reply via email to