Hi,

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 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.


Sub AddTabKeyhandling
  oView = thisComponent.getCurrentController()
  oTabListener = CreateUnoListener
                 ("TabKeyHandler_","com.sun.star.awt.XKeyHandler")
  oView.addKeyHandler (oTabListener)
End Sub

Sub TabKeyHandler_keyPressed
                 (oEvent as new com.sun.star.awt.KeyHandler )
  If oEvent.keyCode = com.sun.star.awt.Key.TAB then
    ' do something
  End If
End Sub

Thanks for any advice,
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