We will be migrating from Ask to Discourse on the first week of August, read the details here

Ask Your Question
0

Multiple functions from a keyboard shortcut?

asked 2021-01-24 15:35:11 +0200

DStosser gravatar image

updated 2021-06-23 23:23:06 +0200

Alex Kemp gravatar image

Hi,

I need to insert empty rows between a few thousand sets of data as part of a process towards generating a CSV. I've figured out how to create a keyboard shortcut, but is it possible for one shortcut to do multiple things in order? For example, instead of setting F3 to "insert row above" and then pressing up, could I tell F3 to do both functions in order? If so, instead of alternating keys, I could just hold down F3 until the process is complete.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2021-01-24 17:20:17 +0200

Opaque gravatar image

Hello,

Afaik you'd need a macro for such combined action (which in turn could be assigned to a shortcut). Your example insert row above + up could be achieved by:

sub InsertRowUp

 dim oDoc as object
 dim oDisp as object

 oDoc   = ThisComponent.CurrentController.Frame
 oDisp  = createUnoService("com.sun.star.frame.DispatchHelper") 
 oDisp.executeDispatch(oDoc, ".uno:InsertRowsBefore", "", 0, Array())
 oDisp.executeDispatch(oDoc, ".uno:GoUp", "", 0, Array())

end sub


(At least that works for me on LibreOffice 7.0.4.2).

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2021-01-24 15:35:11 +0200

Seen: 31 times

Last updated: Jan 24