Re: [api-dev] Adding a keyboard shortcut to an uno CommandURL

2008-08-26 Thread Tobias Krais
Hi Carsten,

 We are working on a solution for extension which is based on XCU files,
 hopefully that will be available for OOo 3.1. Currently you can only use
 the UI configuration manager to define a shortcut. For example see the
 Basic code below which defines a shortcut to a Basic macro.

thanks for the info. I think I will search for a Basic macro that
dispatches my CommandURL (.Judas:PrintTrays) and then assign a shortcut
to it.

Greetings, Tobias

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[api-dev] Adding a keyboard shortcut to an uno CommandURL

2008-08-21 Thread Tobias Krais
Hi together,

I developed a OpenOffice.org Addon with a new toolbar. Now I would like
to add a keyboard shortcut to one of these buttons. When pressing the
button, the CommandURL .Judas:Print is called.

I did not succeed adding a keyboard shortcut for this CommandURL using
the normal dialog in the Extra menu. How can I add a keyboard shortcut
to call the CommandURL directly? Is the only way writing a macro
dispatching the CommandURL? Or can I do the trick in the Addons.xcu file?

Greetings, Tobias

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [api-dev] Adding a keyboard shortcut to an uno CommandURL

2008-08-21 Thread Carsten Driesner

Tobias Krais wrote:

Hi together,

I developed a OpenOffice.org Addon with a new toolbar. Now I would like
to add a keyboard shortcut to one of these buttons. When pressing the
button, the CommandURL .Judas:Print is called.

I did not succeed adding a keyboard shortcut for this CommandURL using
the normal dialog in the Extra menu. How can I add a keyboard shortcut
to call the CommandURL directly? Is the only way writing a macro
dispatching the CommandURL? Or can I do the trick in the Addons.xcu file?


Hi Tobias,

We are working on a solution for extension which is based on XCU files, 
hopefully that will be available for OOo 3.1. Currently you can only use 
the UI configuration manager to define a shortcut. For example see the 
Basic code below which defines a shortcut to a Basic macro.


REM  *  BASIC  *

Sub Main
REM *** Retrieve the global accelerator configuration service
oGlobalAccelCfg = 
createUnoService(com.sun.star.ui.GlobalAcceleratorConfiguration)


Dim aKeyEvent as new com.sun.star.awt.KeyEvent
aKeyEvent.KeyCode = 779 REM F12 see IDL com.sun.star.awt.Key
	aKeyEvent.Modifiers = 1 + 2 REM SHIFT + MOD1 (CTRL) see IDL 
com.sun.star.awt.KeyModifier
oGlobalAccelCfg.setKeyEvent(aKeyEvent, 
vnd.sun.star.script:Standard.Module1.ShowMsgBox?language=Basiclocation=application 
)

oGlobalAccelCfg.store()
End Sub

Sub ShowMsgBox
 MsgBox(Test)
End Sub

Regards,
Carsten

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]