Sub subAddKeyHandler
oDoc = ThisComponent.CurrentController
oKeyHandler = createUnoListener("funKeyHandler_", "com.sun.star.awt.XKeyHandler")
oDoc.addKeyHandler(oKeyHandler)
End Sub
Function funKeyHandler_keyPressed(aEvent) As Boolean
msgbox aEvent.KeyCode
End Function
Function funKeyHandler_keyReleased(aEvent) As Boolean
End Function
Function funKeyHandler_disposing
oDoc.removeKeyHandler(oKeyHandler)
End Function