Bug 148613

Summary: Setting hotkey via macro only works after a restart.
Product: LibreOffice Reporter: Vladimir Sokolinskiy <sokol>
Component: CalcAssignee: Not Assigned <libreoffice-bugs>
Status: UNCONFIRMED ---    
Severity: normal    
Priority: medium    
Version: 7.3.2.2 release   
Hardware: All   
OS: All   
Whiteboard: QA:needsComment
Crash report or crash signature: Regression By:

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