Ask Your Question
0

[Macro] How to simulate pressing a key?

asked 2019-12-02 18:56:06 +0100

Alectrona gravatar image

Can I simulate pressing Escape for example?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2019-12-02 20:14:39 +0100

Ratslinger gravatar image

updated 2019-12-02 21:21:24 +0100

Hello,

There is a macro in this post -> Create a macro that press "Enter" automatic once.

It specifically deals with the Enter key. You would just need to substitute the Enter values for what you want.

For example the Esc key:

oKeyEvent.KeyCode   = com.sun.star.awt.Key.ESCAPE               REM 1281.
oKeyEvent.KeyChar   = chr( 27 )

Also note that the routine is for a Base form. Some modification may be needed for use in Writer or another module.

Edit:

Just tested in Writer doc as posted with ENTER and worked without modification.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2019-12-02 18:56:06 +0100

Seen: 21 times

Last updated: Dec 02