openoffice監聽鍵盤事件宏代碼

REM  *****  BASIC  *****

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
發佈了131 篇原創文章 · 獲贊 44 · 訪問量 34萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章