[Macros] How do I know which key has been pressed? [closed]

asked 2019-11-20 04:43:04 +0100

Alectrona gravatar image

I want to know if left key, right key or tab key is pressed inside a textbox.

So I assign the event "non-alphanumeric input" on my textbox to my macro, but when I run my macro :

Sub KeyHandler_KeyPressed(oEvent)
    If oEvent.KeyCode = com.sun.star.awt.Key.TAB Then
        MsgBox("Tab key pressed")
    End If
End Sub

It shows an error dialog box stating that the object "oEvent" isnt defined

What am I doing wrong?

edit retag flag offensive reopen merge delete

Closed for the following reason duplicate question by Ratslinger
close date 2019-11-20 05:27:44.742397

Comments

Hello,

Still have the same questions as asked on your previous post but not yet answered:

https://ask.libreoffice.org/en/questi...

Please do not duplicate questions - you could just edit the question.

Ratslinger gravatar imageRatslinger ( 2019-11-20 04:55:21 +0100 )edit

Yes but thought it was a dead question none would ever answer to. Didnt had any notification for your comment, sorry

Alectrona gravatar imageAlectrona ( 2019-11-20 05:07:14 +0100 )edit

Notifications don't seem to be working correctly for some time now. Have reported this a few times. Still need answer.

Dead question is not an issue. You can edit the question, make a minor change & it will rise back to the top.

Ratslinger gravatar imageRatslinger ( 2019-11-20 05:11:24 +0100 )edit