List Info

Thread: Java: Managing keyboard shortcuts - where to start




Java: Managing keyboard shortcuts - where to start
user name
2006-03-14 10:23:02
Hi Carsten,

>> my next task is to remove and add some keyboard
shortcuts to an
>> OpenOffice... I looked up the Dev-Guide but it does
not tell much about
>> keybord shortcuts.
>>
>> Is it possible to manage the keyboard shortcuts via
Java? If yes, where
>> can I start? Can you help me please once more?

> just have a look at the thread "UNO package
setting keybindings" where I
> describe how to set keyboard shortcuts via API. There
is also another
> thread "Problem adding a keyboard shortcut by
API's" where this issue
> were discussed.

I found the BASIC examlpe. I want to translate it to Java
but have a
starting problem. Maybe you can help me.

I cite you:
-----%<-----
REM  *****  BASIC  *****
REM  *** Example to set a keyboard shortcut with the new ui
REM  *** configuration API

Sub Main
    REM *** Initialize constants. See IDL file
    REM com.sun.star.awt.KeyEvent
    REM com.sun.star.awt.KeyModifier
    REM com.sun.star.awt.Key
    MODIFIER_SHIFT = 1
    MODIFIER_MOD1  = 2
    MODIFIER_MOD2  = 4
	
    KEY_F10        = 777
	
    REM *** Retrieve the global accelerator configuration
manager
    oGlobalAccelCfgMgr =
     
createUnoService("com.sun.star.ui.GlobalAcceleratorCon
figuration")

    REM *** Retrieve the module configuration manager from
central
    REM *** module configuration manager supplier
    oModuleCfgMgrSupplier = createUnoService(
       
"com.sun.star.ui.ModuleUIConfigurationManagerSupplier
")
-----%<-----

How can I get the oGlobalAccelCfgMgr? I tried:
-----%<-----
// Condition: XComponentContext xRemoteContext
Object test =
xRemoteServiceManager.createInstanceWithContext(
   
"com.sun.star.ui.GlobalAcceleratorConfiguration"
, xRemoteContext);
com.sun.star.uno.XInterface xInterface =
(com.sun.star.uno.XInterface)
                    UnoRuntime.queryInterface(
                    GlobalAcceleratorConfiguration.class,
                    test);
-----%<-----
The createInstance... works out, but how to go on?

Would you please give me a hint?

Greetings, Tobias

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org

Java: Managing keyboard shortcuts - where to start
user name
2006-03-28 06:21:00
Hi together,

> I found the BASIC examlpe. I want to translate it to
Java but have a
> starting problem. Maybe you can help me.
> 
> I cite you:
> -----%<-----
> REM  *****  BASIC  *****
> REM  *** Example to set a keyboard shortcut with the
new ui
> REM  *** configuration API
> 
> Sub Main
>     REM *** Initialize constants. See IDL file
>     REM com.sun.star.awt.KeyEvent
>     REM com.sun.star.awt.KeyModifier
>     REM com.sun.star.awt.Key
>     MODIFIER_SHIFT = 1
>     MODIFIER_MOD1  = 2
>     MODIFIER_MOD2  = 4
> 	
>     KEY_F10        = 777
> 	
>     REM *** Retrieve the global accelerator
configuration manager
>     oGlobalAccelCfgMgr =
>      
createUnoService("com.sun.star.ui.GlobalAcceleratorCon
figuration")
> 
>     REM *** Retrieve the module configuration manager
from central
>     REM *** module configuration manager supplier
>     oModuleCfgMgrSupplier = createUnoService(
>        
"com.sun.star.ui.ModuleUIConfigurationManagerSupplier
")
> -----%<-----
> 
> How can I get the oGlobalAccelCfgMgr? I tried:
> -----%<-----
> // Condition: XComponentContext xRemoteContext
> Object test =
xRemoteServiceManager.createInstanceWithContext(
>    
"com.sun.star.ui.GlobalAcceleratorConfiguration"
, xRemoteContext);
> com.sun.star.uno.XInterface xInterface =
(com.sun.star.uno.XInterface)
>                     UnoRuntime.queryInterface(
>                    
GlobalAcceleratorConfiguration.class,
>                     test);
> -----%<-----
> The createInstance... works out, but how to go on?
> 
> Would you please give me a hint?

here I found some hints:
http://api.openoffice.org/servlets/ReadMsg?
list=dev&msgId=2552185

Greetings, Tobias

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )