/usr/lib/libreoffice/share/extensions/DmathsAddon/OOoGdmath/Raccourcis.xba is in libreoffice-dmaths 3.4+dfsg1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 | <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Raccourcis" script:language="StarBasic">'OOoGdmath
'Copyright (C) 2005-2009 Gilles Daurat
'This program is free software; you can redistribute it and/or
'modify it under the terms of the GNU General Public License
'as published by the Free Software Foundation; either version 2
'of the License, or (at your option) any later version.
'This program is distributed in the hope that it will be useful,
'but WITHOUT ANY WARRANTY; without even the implied warranty of
'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
'GNU General Public License for more details.
'You should have received a copy of the GNU General Public License
'along with this program; if not, write to the Free Software
'Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
' auteur : Paolo Mantovani
' modifications : avril 2006
Option Explicit
Sub Main
DefinitRaccourcis
End Sub
Sub DefinitRaccourcis()
SetUpKeyBinding GD_CTRL + GD_MAJ, GD_M, "InsereExpression"
End Sub
Sub SetUpKeyBinding(ctrl as integer, touche as integer, uneMacro as String)
Dim oModuleCfgMgrSupplier As Object
Dim oModuleCfgMgr As Object
Dim oWriterShortCutMgr As Object
Dim sCommand As String
Dim sLocCommand As String
Dim sMsg As String
Dim iMsgResult As Integer
Dim combi as String
' Initialize strings
sCommand = "vnd.sun.star.script:OOoGdmath." & uneMacro & ".Main?language=Basic&location=application"
' Retrieve the module configuration manager from central module configuration manager supplier
oModuleCfgMgrSupplier = createUnoService("com.sun.star.ui.ModuleUIConfigurationManagerSupplier")
' Retrieve the module configuration manager with module identifier
oModuleCfgMgr = oModuleCfgMgrSupplier.getUIConfigurationManager("com.sun.star.text.TextDocument")
oWriterShortCutMgr = oModuleCfgMgr.getShortCutManager
Dim aKeyEvent As New com.sun.star.awt.KeyEvent
With aKeyEvent
.Modifiers = ctrl
.KeyCode = touche
End With
combi = Miif((ctrl and GD_CTRL)<>0, "CTRL+", "") & Miif((ctrl and GD_MAJ)<>0, "MAJ+", "") & Miif((ctrl and GD_ALT)<>0, "ALT+", "") & CaractereTouche(touche)
On Error Resume Next
sLocCommand = oWriterShortCutMgr.getCommandByKeyEvent(aKeyEvent)
On Error GoTo 0 'restore the error handler
Select Case sLocCommand
Case = "" 'no previous bindings
oWriterShortCutMgr.setKeyEvent( aKeyEvent, sCommand )
oWriterShortCutMgr.store
Case = sCommand 'ok the key event is already used by our command
'nothing to do
Case Else 'the key event is already used by another command
sMsg = "La combinaison de touche " & combi & " est déjà utilisée par la commande :" & Chr(10)
sMsg = sMsg & sLocCommand & "." & Chr(10) & Chr(10)
sMsg = sMsg & "Voulez-vous la remplacer par la commande : " & uneMacro
iMsgResult = MsgBox(sMsg, 1)
If iMsgResult = 1 Then
oWriterShortCutMgr.removeKeyEvent( aKeyEvent)
oWriterShortCutMgr.setKeyEvent( aKeyEvent, sCommand )
oWriterShortCutMgr.store
End If
End Select
End Sub
Private Function GD_MAJ() as integer
GD_MAJ() = 1
End Function
Private Function GD_CTRL() as integer
GD_CTRL() = 2
End Function
Private Function GD_ALT() as integer
GD_ALT() = 4
End Function
Private Function GD_A() as integer
GD_A() = com.sun.star.awt.Key.A
End Function
Private Function GD_B() as integer
GD_B() = com.sun.star.awt.Key.B
End Function
Private Function GD_C() as integer
GD_C() = com.sun.star.awt.Key.C
End Function
Private Function GD_D() as integer
GD_D() = com.sun.star.awt.Key.D
End Function
Private Function GD_E() as integer
GD_E() = com.sun.star.awt.Key.E
End Function
Private Function GD_F() as integer
GD_F() = com.sun.star.awt.Key.F
End Function
Private Function GD_G() as integer
GD_G() = com.sun.star.awt.Key.G
End Function
Private Function GD_H() as integer
GD_H() = com.sun.star.awt.Key.H
End Function
Private Function GD_I() as integer
GD_I() = com.sun.star.awt.Key.I
End Function
Private Function GD_J() as integer
GD_J() = com.sun.star.awt.Key.J
End Function
Private Function GD_K() as integer
GD_K() = com.sun.star.awt.Key.K
End Function
Private Function GD_L() as integer
GD_L() = com.sun.star.awt.Key.L
End Function
Private Function GD_M() as integer
GD_M() = com.sun.star.awt.Key.M
End Function
Private Function GD_N() as integer
GD_N() = com.sun.star.awt.Key.N
End Function
Private Function GD_O() as integer
GD_O() = com.sun.star.awt.Key.O
End Function
Private Function GD_P() as integer
GD_P() = com.sun.star.awt.Key.P
End Function
Private Function GD_Q() as integer
GD_Q() = com.sun.star.awt.Key.Q
End Function
Private Function GD_R() as integer
GD_R() = com.sun.star.awt.Key.R
End Function
Private Function GD_S() as integer
GD_S() = com.sun.star.awt.Key.S
End Function
Private Function GD_T() as integer
GD_T() = com.sun.star.awt.Key.T
End Function
Private Function GD_U() as integer
GD_U() = com.sun.star.awt.Key.U
End Function
Private Function GD_V() as integer
GD_V() = com.sun.star.awt.Key.V
End Function
Private Function GD_W() as integer
GD_W() = com.sun.star.awt.Key.W
End Function
Private Function GD_X() as integer
GD_X() = com.sun.star.awt.Key.X
End Function
Private Function GD_Y() as integer
GD_Y() = com.sun.star.awt.Key.Y
End Function
Private Function GD_Z() as integer
GD_Z() = com.sun.star.awt.Key.Z
End Function
Private Function CaractereTouche(touche as integer) as String
Select case touche
case GD_A
CaractereTouche() = "A"
case GD_B
CaractereTouche() = "B"
case GD_C
CaractereTouche() = "C"
case GD_D
CaractereTouche() = "D"
case GD_E
CaractereTouche() = "E"
case GD_F
CaractereTouche() = "F"
case GD_G
CaractereTouche() = "G"
case GD_H
CaractereTouche() = "H"
case GD_I
CaractereTouche() = "I"
case GD_J
CaractereTouche() = "J"
case GD_K
CaractereTouche() = "K"
case GD_L
CaractereTouche() = "L"
case GD_M
CaractereTouche() = "M"
case GD_N
CaractereTouche() = "N"
case GD_O
CaractereTouche() = "O"
case GD_P
CaractereTouche() = "P"
case GD_Q
CaractereTouche() = "Q"
case GD_R
CaractereTouche() = "R"
case GD_S
CaractereTouche() = "S"
case GD_T
CaractereTouche() = "T"
case GD_U
CaractereTouche() = "U"
case GD_V
CaractereTouche() = "V"
case GD_W
CaractereTouche() = "W"
case GD_X
CaractereTouche() = "X"
case GD_Y
CaractereTouche() = "Y"
case GD_Z
CaractereTouche() = "Z"
End Select
End Function
</script:module>
|