Use the event of an assigned macro

In LibreOffice 6.2.8, I assign the macro FrmExit to my Frame on the event “Non-alphanumeric input”

But how do I pass this event as a parameter in my sub ?

Sub FrmExit(oEvent)

MsgBox(oEvent.KeyCode)

End Sub

This says the object oEvent is undefined.

edit : im using a frame, not a textbox. sorry for the confusion

Hello,

Couple of items that are uncertain. What “Text Box” are you concerned with - form control or graphical Draw object? Also where did you find “Non-alphanumeric input” event? Don’t see this anywhere for these objects.

form control or graphical Draw object?

Not sure what is the difference. I create a textbox by clicking insert > textbox and then typing text inside. Then anchors it as a character and save it as an autotext.

Also where did you find “Non-alphanumeric input” event? Don’t see this anywhere for these object

I use a frame, not a textbox to be more precise.

How to show this dialog box?, ok, I see, it’s a frame, not a textbox

Right click on a frame, properties > macro tab edit : yes sorry, i thought textboxes had the same features.

@Alectrona,

Yes, being precise is important. There is a difference between a text box control and the text box graphical object (Insert->Text Box) and even more so when it is really a Frame. The text boxes noted do not have any such event as you used.

This event required two arguments… In Python is:

def input_frame(name, code):
    if code == 1282:
        app.msgbox('Press TAB')
    return

In Basic, I not test

Sub input_frame(name, code)

End Sub

Works perfectly! Thanks alot.

@Alectrona,

As you have been helped, please help others to know the question has been answered by clicking on the :heavy_check_mark: in upper left area of answer which satisfied the question.

mb i probably clicked twice