Bug 148613 - Setting hotkey via macro only works after a restart.
Summary: Setting hotkey via macro only works after a restart.
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.3.2.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: QA:needsComment
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-15 13:33 UTC by Vladimir Sokolinskiy
Modified: 2022-04-30 03:40 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Sokolinskiy 2022-04-15 13:33:25 UTC
Execute a macro that sets the Alt+F1 hotkey. Alt+F1 combination starts to be processed only after LO restart.

Sub TestAccSetKey
   Dim oACC, keyEvent As New com.sun.star.awt.KeyEvent 
   oACC=com.sun.star.ui.ModuleAcceleratorConfiguration.createWithModuleIdentifier("com.sun.star.sheet.SpreadsheetDocument")  
   With keyEvent
     .KeyCode=com.sun.star.awt.Key.F1
     .Modifiers=4   ' Alt
   End With   
   oAcc.setKeyEvent KeyEvent, "vnd.sun.star.script:Standard.Module1.MyMacro?language=Basic&location=application"
   oAcc.store  ' save
End Sub