This has become an integral part of the Spanish alphabet starting in the 18th century and has since been adopted by other countries especially those who have been conquered or influenced by Spain. Type_A_Character( 8211 ) REM 8212 is the Unicode for the EN-DASH symbol "-".Ñ (lower case ñ) is one of the letters on the modern Latin alphabet which has a tilde (also called virgulilla) on top, thus resulting in it being pronounced as ‘ en-ye‘. Type_A_Character( 8212 ) REM 8212 is the Unicode for the EM-DASH symbol "-". OToolkit.keyPress( oKeyEvent ) REM methods of XToolkitRobot. OWindow = ()ĭim oKeyEvent As New .KeyEvent REM Types a Unicode character into the current window. Sub type_A_Character( iUnicode As Integer ) OShortcutManager.removeCommandFromAllKeyEvents( strCommandURL2 ) REM Remove the CTRL-Minus Shortcut again. OShortcutManager.removeCommandFromAllKeyEvents( strCommandURL1 ) REM Remove the ALT-Minus Shortcut again. tKeyEvent( oKeyEvent2, strCommandURL2 ) REM Install the CTRL-Minus Shortcut. tKeyEvent( oKeyEvent1, strCommandURL1 ) REM Install the ALT-Minus Shortcut. OShortcutManager = oUIConfigurationManager.getShortCutManager() OUIConfigurationManager = oUIConfigurationManagerSupplier.getUIConfigurationManager( aModules( i ) ) OModuleManager = createUnoService( ".ModuleManager" )ĭim aModules() As String : aModules = oModuleManager.getElementNames()įor i = 0 To uBound( aModules ) REM install/remove the 2 Shortcuts in all available Office Modules: OUIConfigurationManagerSupplier = getDefaultContext().getByName( "/singletons/.theModuleUIConfigurationManagerSupplier" ) OKeyEvent2.Ke圜ode = .Key.SUBTRACTĭim oUIConfigurationManagerSupplier As Object OKeyEvent1.Ke圜ode = .Key.SUBTRACTĭim oKeyEvent2 As New .KeyEvent REM KeyEvent representing CTRL-Minus. REM ******* NB ******** Set here the correct URL of your macro to be called when CTRL-Minus is pressed:Ĭonst strCommandURL2$ = ":_An_ENDASH?language=Basic&location=application"ĭim oKeyEvent1 As New .KeyEvent REM KeyEvent representing ALT-Minus. REM ******* NB ******** Set here the correct URL of your macro to be called when ALT-Minus is pressed:Ĭonst strCommandURL1$ = ":_An_EMDASH?language=Basic&location=application" REM To remove these 2 Keyboard shortcuts again, set the below constant bInstall to, then call this method once. REM Call this method once to install the 2 Keyboard shortcuts in every Office Module. REM Assigns 2 Keyboard shortcuts "Ctrl+-" and "Alt+-", to 2 macros that insert an en-dash and an em-dash respectively. Hope it helps, lib Sub installMyShortcuts() Standard library, then adjust the 2 constants in the method installMyShortcuts() to point to that location, then Run the method installMyShortcuts(). To try this macro, just copy-paste the code below into a Basic module inside your. I haven’'t looked into that yet, but i guess it could be solved by adjusting the method type_A_Character() to address the case for Base especially. I have tested the macro below, and it works wonderfully in Writer, Calc, Draw, Impress, Formula Editor, the BasicIDE, but with one notable exception: it doesn’‘t seem to do anything in LibreOffice Base. Seeing that you already agreed to that in your question, i wrote a macro here below that does just that. Instead the Module’'s Shortcut must be overwritten for each Office Module separately. Writer, Calc ) like you mentioned, it would not be sufficient to install a Shortcut at the Global level for them, since they would be overruled by the Module’‘s Shortcut every time. Such ‘hidden’ Shortcut Keys can only be removed again by using the API.įor Key combinations such as “CTRL±” that are already defined at the Module-level ( i.e. : Keyboard", but can still be assigned to a command by using the API.ĭoing so is of course at ones own responsibility, since these Key combinations were probably left out of the GUI for a reason… Even after assigning a command to such Key combinations by API, they are still not visible in the GUI but they are truly active and they do trigger the assigned command. Certain Key combinations such as “ALT±” are not listed among the available Shortcut Keys in "Tools : Customize.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |