diff options
author | Noel Power <npower@openoffice.org> | 2003-03-06 10:27:38 +0000 |
---|---|---|
committer | Noel Power <npower@openoffice.org> | 2003-03-06 10:27:38 +0000 |
commit | 6d25d3f8da391520c37175d9950f27f9647d606a (patch) | |
tree | 7da6221e9ad6215ba3a6afff8d95739446c6dd57 /scripting/workben | |
parent | 7e3090bbb86ffd6b97a4fa5c339ef2b1fbded0cb (diff) |
#12037, fixed problems with key assignments....
Diffstat (limited to 'scripting/workben')
-rw-r--r-- | scripting/workben/bindings/ScriptBinding.xba | 51 |
1 files changed, 40 insertions, 11 deletions
diff --git a/scripting/workben/bindings/ScriptBinding.xba b/scripting/workben/bindings/ScriptBinding.xba index 04ff383a96b3..109c71984963 100644 --- a/scripting/workben/bindings/ScriptBinding.xba +++ b/scripting/workben/bindings/ScriptBinding.xba @@ -134,9 +134,9 @@ Sub createAndPopulateKeyArrays() 'Create SHIFT + CONTROL + F keys array 'Dim keyGroupProp as new com.sun.star.beans.PropertyValue - Dim SCFKey( 10 ) - for FKey = 2 to 12 - SCFKey( FKey - 2 ) = "SHIFT + CONTROL + F" + FKey + Dim SCFKey( 11 ) + for FKey = 1 to 12 + SCFKey( FKey - 1 ) = "SHIFT + CONTROL + F" + FKey next FKey KeyBindArrayOfArrays(0) = SCFKey() @@ -157,9 +157,9 @@ Sub createAndPopulateKeyArrays() KeyBindArrayOfArrays(2) = SCLKey() 'Create CONTROL + F keys - Dim CFKey( 10 ) - for FKey = 2 to 12 - CFKey( Fkey - 2 ) = "CONTROL + F" + FKey + Dim CFKey( 11 ) + for FKey = 1 to 12 + CFKey( Fkey - 1 ) = "CONTROL + F" + FKey next FKey KeyBindArrayOfArrays(3) = CFKey() @@ -178,17 +178,42 @@ Sub createAndPopulateKeyArrays() KeyBindArrayOfArrays(5) = CLKey() 'Create SHIFT + F Keys - Dim SFKey( 10 ) - for FKey = 2 to 12 - SFKey( Fkey - 2 ) = "SHIFT + F" + FKey + Dim SFKey( 11 ) + for FKey = 1 to 12 + SFKey( Fkey - 1 ) = "SHIFT + F" + FKey next FKey KeyBindArrayOfArrays(6) = SFKey() End Sub +Sub updateMapWithDisabledKeys() + 'disable CONTROL + F1 & + keyAllocationMap( 3, 0 ).Value = 1 + keyAllocationMap( 3, 0 ).Name = "" + 'disable CONTROL + F4 & + keyAllocationMap( 3, 3 ).Value = 1 + keyAllocationMap( 3, 3 ).Name = "" + 'disable CONTROL + F6 + keyAllocationMap( 3, 5 ).Value = 1 + keyAllocationMap( 3, 5 ).Name = "" + + + 'disable SHIFT + F1 & + keyAllocationMap( 6, 0 ).Value = 1 + keyAllocationMap( 6, 0 ).Name = "" + 'disable SHIFT + F2 & + keyAllocationMap( 6, 1 ).Value = 1 + keyAllocationMap( 6, 1 ).Name = "" + 'disable SHIFT + F6 & + keyAllocationMap( 6, 5 ).Value = 1 + keyAllocationMap( 6, 5 ).Name = "" + +End Sub + Sub ExecuteKeyBinding() dialogName = "Key" createAndPopulateKeyArrays() + updateMapWithDisabledKeys() xmlFileName = GetDocumentType( "Key" ) if not (ReadXMLToArray( "Key" )) then @@ -623,7 +648,7 @@ function getKeyGroupIndex( key as String, offset as Integer ) as Integer select case offset case 0: num = cint( cutKey ) - getKeyGroupIndex() = num - 2 + getKeyGroupIndex() = num - 1 exit function case 1: num = asc( key ) - 48 @@ -648,7 +673,7 @@ Sub processKeyXMLLine( lineCount as Integer, xmlline as String ) if instr( xmlFile( lineCount ), "accel:mod1="+chr$(34)+"true"+chr$(34) ) > 0 then control = true end if - offsetIntoArrayOfArrays = 0 'default to "SHIFT + CONTROL" set of arrays + offsetIntoArrayOfArrays = -1 'default unknown if ( control AND shift ) then offsetIntoArrayOfArrays = 0 elseif ( control ) then @@ -663,6 +688,10 @@ Sub processKeyXMLLine( lineCount as Integer, xmlline as String ) ' Calculate from the key the offset into key group array we need to point to KeyGroupIndex = getKeyGroupIndex( key, keyTypeOffset ) + if ( offsetIntoArrayOfArrays = -1 ) then + 'Unknown key group, no processing necessary + Exit Sub + end if if ( KeyGroupIndex > -1 ) then ' Determine if a script framework binding is present or not |