Hi Ariel,

Solved, but one question left:

Ariel Constenla-Haile wrote (1-4-2008 18:20)
Cor Nouws escribió:

Another problem.
I want to know if Tab is pressed and then do some stuff. (Basically I want to prevent that Tab adds another row at a table).


Simple code as shown below, does work. However, I seem to miss some things. a. It only works for one time pressing Tab. The listener seems to be stopped then

Solved as well.
Needed another global var and a better routine for the keyhandling

Function MyTabHandler_KeyPressed(oEvent) As Boolean
  select case oEvent.keyCode
    case com.sun.star.awt.Key.TAB
       ' do something
       MyTabHandler_KeyPressed = TRUE
    case else
       MyTabHandler_KeyPressed = False
  end select
End Function

b. First I tried com.sun.star.awt.XKeyListener, but addKeyListener seems not to be a method of oView, and I can't see any info why.
[...]
For adding a key handler, you must use the method addKeyHandler() from the interface XUserInputInterception. This interface is implemented by the controller css.frame.Controller (of all office documents except OOo Base). [...] For adding a key listener, you must use the method addKeyListener() from the interface css.awt.XWindow. In Basic

ThisComponent.getCurrentController().getFrame().getContainerWindow().addKeyListener()

How could I have found the different components that are needed by those two listeners?

Thanks,
Cor


--

"The Year of 3" -2008- "Het jaar van 3"

Cor Nouws
Arnhem - Netherlands - nl.OpenOffice.org - marketing contact


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

Reply via email to