Haddood
June 6th, 2004, 01:30 PM
Hi every one,
here is a LUA script, followd by GML, Copy teh GML into Notepad, save as .gml and import into girder. The script is well commented (or i think so :oops: ).
the Scripts allow you to flip through Charecters, and after defined time it will perform action, also it will exit the alphanumric mode after definde time, both can be configured....
you will need to know how to use 'TriggerEvent' to make use of it ...
SOME CHANGES NEED TO BE DONE TO GET IT TO WORK ...so please read allthe comments ... I used my Keyboard numbers to test it ...
You also need to creat a command with OSD and [pld1] in the text only, add to it Event and select girder and name it OSD, this to show info on OSD
I am posting the script for refrerence and questions ...
enjoy ... 8)
--################################################## ############################
-- AlphaNumric Input
-- v. 0.5
-- Sarmad Mashta, 2004
-- WinLUAex, Plug in For Device to be used for Input
--################################################## ############################
function DoAlphaNum (Char)
print (Char) -- here triger the events you like
-- based on Char value, or passit with
-- TriggerEvent as PLD 1
end
------------------------------ main Code -----------------------------
EventAlphaNumricMode = '3FS00XZ' --[[ Event String to Enter/Exit AlphaNumric
Mode, must be replaced with Eventstring
that will be used to Enter/Exit
AlphaNumric Mode--]]
DeviceID = 124 -- Must be replaced with Device Plugin ID
local TimeOut = 15 * 1000 -- Seconds before exiting AlphaNumric Input
-- Automatically (Afted Idle)
local CharTime = 1.5 * 1000 -- Seconds to repeat key press to
-- change to next charecter
local Event = EventString
-------------- AutoExit Timer --------------
if not SleepTimer then
SleepTimer = TIMER_CreateObject()
SleepTimer.Create (nil, 'TriggerEvent(EventAlphaNumricMode, DeviceID)', nil, 0)
else
SleepTimer.Cancel()
end
SleepTimer.Arm (TimeOut)
----------- Key Press Processing -----------
if Event == EventAlphaNumricMode then
result = 1 --[[ Goto Toggle each time AlphaNumric Mode
pressed or simulated by timer xx--]]
AlphaNumricMode = not AlphaNumricMode
if AlphaNumricMode then
Key3100000 = ' ?@1' -- set here the possible values for each key
Key3200000 = 'ABC2' -- Variable Names must be KeyXXXXXXX Where
Key3300000 = 'DEF3' -- XXXXXXX replaced with the Eventstring
Key3400000 = 'GHI4' -- generated by Device used to generate the
Key3500000 = 'JKL5' -- input. Extra Charecters can be added to
Key3600000 = 'MNO6' -- strings as needed
Key3700000 = 'PQRS7'
Key3800000 = 'TUV8'
Key3900000 = 'XWYZ9'
-- This is Used to Display info in OSD
TriggerEvent ('OSD', 18, 'Entering AlphaNumric mode...')
else
Key3100000 = nil -- these lines clears the mess we created :)
Key3200000 = nil
Key3300000 = nil
Key3400000 = nil
Key3500000 = nil
Key3600000 = nil
Key3700000 = nil
Key3800000 = nil
Key3900000 = nil
Index = nil
LastKey = nil
SleepTimer.Destroy()
SleepTimer = nil
DeviceID = nil
CurrentChar = nil
AlphaNumricMode = nil
-- Display Exitining AlphaNumricMode
TriggerEvent ('OSD', 18, 'Exiting AlphaNumric mode...')
end
else
if not AlphaTimer then
AlphaTimer = TIMER_CreateObject()
AlphaTimer.Create (nil, 'DoAlphaNum (CurrentChar)', nil, 0)
else
AlphaTimer.Cancel()
end
AlphaTimer.Arm (CharTime)
if LastKey ~= Event then
if LastKey then
DoAlphaNum (CurrentChar)
end
Index = 1
LastKey = Event
else
Index = Index + 1
if Index > strlen (getglobal ('Key'..Event)) then Index =1 end
end
if getglobal('Key'.. Event) then
CurrentChar = strsub(getglobal('Key'.. Event), Index, Index)
end
TriggerEvent ('OSD', 18, 1, CurrentChar)
end
------------------- here is the GML ------------
<?xml version="1.0" encoding="UTF-8"?>
<Girder><Group Name="Alpha Numric" Identifier="4509" Enabled="TRUE"><Command Name="AlphaNumric Input Script" Identifier="4500" Enabled="TRUE"><StateCount>1</StateCount><StateBegin>1</StateBegin><StateCurrent>1</StateCurrent><StateInvert>FALSE</StateInvert><Binary Encoding="Base64">G0x1YUABBAQEIAYJCBLmW6GwubJBCAAAAD0obm9uZSkAAAAAAA AAAAAACAAAAAAAAAAAAAAALgAA
AAsAAABEb0FscGhhTnVtABEAAABFdmVudEFscGhhTnVtcmljAA gAAAAzRlMwMFhaAAkAAABEZXZp
Y2VJRAAMAAAARXZlbnRTdHJpbmcACwAAAFNsZWVwVGltZXI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wKAAQCqAACATAEAAE4CAAACgAEATAEA
AI4CAAALAAAAAoABAIsAAADMAgAAYBEAgAYAAIATAwAATAMAAB 8AAABTAwAATAMAACcGAIDHAwAA
kwMAAEcEAAATBAAAxwQAAJMEAABHBQAAEwUAAMcFAACTBQAARw YAABMGAADHBgAAkwYAAEcHAAAT
BwAAxwcAAJMHAAAMCAAARwgAAEYEAIBGAACAhwgAAAKAAQCqGg CARAAAAJMDAABEAAAAEwQAAEQA
AACTBAAARAAAABMFAABEAAAAkwUAAEQAAAATBgAARAAAAJMGAA BEAAAAEwcAAEQAAACTBwAARAAA
ANMIAABEAAAAEwkAAEwBAABOCQAAAoABAEQAAABTAQAARAAAAN MAAABEAAAAkwkAAAwIAABHCAAA
RgQAgEYAAIDHCQAAAoABACoRAIAMCgAApgIAgIwBAABCgAEAEw oAAAwKAADOAQAARAAAAEcKAABE
AAAAxv//fwKAAQCqAACADAoAAE4CAAACgAEADAoAAI4CAABLAAAAAoABAA wJAACLAAAAYQIAgAwJ
AACnAACADAAAAIwJAAACgAEABgAAgNMIAACLAAAAEwkAAGoDAI DMCAAAGAAAgNMIAADMCAAAjAoA
AMwKAAAHCwAAiwAAAJ0AAADCvwIAQgACAGMAAIAGAACA0wgAAM wKAAAHCwAAiwAAAJ0AAABCgAEA
ZwIAgEwLAADMCgAABwsAAIsAAACdAAAAQgACAMwIAADMCAAAQo ABAJMJAAAMCAAARwgAAEYEAIBG
AACAjAkAAAKAAQAAAAAA</Binary><OSD>FALSE</OSD><Submatch>FALSE</Submatch><Topmost>TRUE</Topmost><OneMatch>FALSE</OneMatch><UseVar>FALSE</UseVar><MatchHidden>FALSE</MatchHidden><MatchNum>1</MatchNum><ActionType>4</ActionType><ActionSubType>34</ActionSubType><sValue1>--################################################## ############################
-- AlphaNumric Input
-- v. 0.5
-- Sarmad Mashta, 2004
-- WinLUAex, Plug in For Device to be used for Input
--################################################## ############################
function DoAlphaNum (Char)
print (Char) -- here triger the events you like
-- based on Char value, or passit with
-- TriggerEvent as PLD 1
end
------------------------------ main Code -----------------------------
EventAlphaNumricMode = '3FS00XZ' --[[ Event String to Enter/Exit AlphaNumric
Mode, must be replaced with Eventstring
that will be used to Enter/Exit
AlphaNumric Mode--]]
DeviceID = 124 -- Must be replaced with Device Plugin ID
local TimeOut = 15 * 1000 -- Seconds before exiting AlphaNumric Input
-- Automatically (Afted Idle)
local CharTime = 1.5 * 1000 -- Seconds to repeat key press to
-- change to next charecter
local Event = EventString
-------------- AutoExit Timer --------------
if not SleepTimer then
SleepTimer = TIMER_CreateObject()
SleepTimer.Create (nil, 'TriggerEvent(EventAlphaNumricMode, DeviceID)', nil, 0)
else
SleepTimer.Cancel()
end
SleepTimer.Arm (TimeOut)
----------- Key Press Processing -----------
if Event == EventAlphaNumricMode then
result = 1 --[[ Goto Toggle each time AlphaNumric Mode
pressed or simulated by timer xx--]]
AlphaNumricMode = not AlphaNumricMode
if AlphaNumricMode then
Key3100000 = ' ?@1' -- set here the possible values for each key
Key3200000 = 'ABC2' -- Variable Names must be KeyXXXXXXX Where
Key3300000 = 'DEF3' -- XXXXXXX replaced with the Eventstring
Key3400000 = 'GHI4' -- generated by Device used to generate the
Key3500000 = 'JKL5' -- input. Extra Charecters can be added to
Key3600000 = 'MNO6' -- strings as needed
Key3700000 = 'PQRS7'
Key3800000 = 'TUV8'
Key3900000 = 'XWYZ9'
-- This is Used to Display info in OSD
TriggerEvent ('OSD', 18, 'Entering AlphaNumric mode...')
else
Key3100000 = nil -- these lines clears the mess we created :)
Key3200000 = nil
Key3300000 = nil
Key3400000 = nil
Key3500000 = nil
Key3600000 = nil
Key3700000 = nil
Key3800000 = nil
Key3900000 = nil
Index = nil
LastKey = nil
SleepTimer.Destroy()
SleepTimer = nil
DeviceID = nil
CurrentChar = nil
AlphaNumricMode = nil
-- Display Exitining AlphaNumricMode
TriggerEvent ('OSD', 18, 'Exiting AlphaNumric mode...')
end
else
if not AlphaTimer then
AlphaTimer = TIMER_CreateObject()
AlphaTimer.Create (nil, 'DoAlphaNum (CurrentChar)', nil, 0)
else
AlphaTimer.Cancel()
end
AlphaTimer.Arm (CharTime)
if LastKey ~= Event then
if LastKey then
DoAlphaNum (CurrentChar)
end
Index = 1
LastKey = Event
else
Index = Index + 1
if Index > strlen (getglobal ('Key'..Event)) then Index =1 end
end
if getglobal('Key'.. Event) then
CurrentChar = strsub(getglobal('Key'.. Event), Index, Index)
end
TriggerEvent ('OSD', 18, CurrentChar)
end
</sValue1><bValue1>FALSE</bValue1><bValue2>FALSE</bValue2><bValue3>FALSE</bValue3><lValue1>4502</lValue1><EventString Name="EventString" Identifier="4501" Enabled="FALSE" Invert="FALSE" Device="-2" IrStr="On Keyboard driver Event"><Comments>Select your Device from the list in On Event</Comments></EventString><EventString Name="EventString" Identifier="4507" Enabled="TRUE" Invert="FALSE" Device="124" IrStr="3FS00XZ"><Comments>Learn the Key that will get you Into AlphaNumric Mode</Comments></EventString></Command><MultiGroup Name="Toggle AlphaNumric Input" Identifier="4502" Enabled="TRUE"><Comments>See Coments in Enter/Exit commands</Comments><StateCount>1</StateCount><StateBegin>1</StateBegin><StateCurrent>1</StateCurrent><StateInvert>FALSE</StateInvert><Command Name="Enter AlphaNumric" Identifier="4504" Enabled="TRUE"><Comments>here Disable all Eventstrings that Share same input: state 1 of 2</Comments><StateCount>2</StateCount><StateBegin>1</StateBegin><StateCurrent>1</StateCurrent><StateInvert>FALSE</StateInvert><OSD>FALSE</OSD><Submatch>FALSE</Submatch><Topmost>TRUE</Topmost><OneMatch>FALSE</OneMatch><UseVar>FALSE</UseVar><MatchHidden>FALSE</MatchHidden><MatchNum>1</MatchNum><ActionType>4</ActionType><ActionSubType>1</ActionSubType><bValue1>FALSE</bValue1><bValue2>FALSE</bValue2><bValue3>FALSE</bValue3><lValue1>4501</lValue1></Command><Command Name="Exit AlphaNumric" Identifier="4505" Enabled="TRUE"><Comments>here Enable all Eventstrings that Share same input: state 2 of 2</Comments><StateCount>2</StateCount><StateBegin>2</StateBegin><StateCurrent>2</StateCurrent><StateInvert>FALSE</StateInvert><OSD>FALSE</OSD><Submatch>FALSE</Submatch><Topmost>TRUE</Topmost><OneMatch>FALSE</OneMatch><UseVar>FALSE</UseVar><MatchHidden>FALSE</MatchHidden><MatchNum>1</MatchNum><ActionType>4</ActionType><ActionSubType>2</ActionSubType><bValue1>FALSE</bValue1><bValue2>FALSE</bValue2><bValue3>FALSE</bValue3><lValue1>4501</lValue1></Command></MultiGroup></Group></Girder> 8)
here is a LUA script, followd by GML, Copy teh GML into Notepad, save as .gml and import into girder. The script is well commented (or i think so :oops: ).
the Scripts allow you to flip through Charecters, and after defined time it will perform action, also it will exit the alphanumric mode after definde time, both can be configured....
you will need to know how to use 'TriggerEvent' to make use of it ...
SOME CHANGES NEED TO BE DONE TO GET IT TO WORK ...so please read allthe comments ... I used my Keyboard numbers to test it ...
You also need to creat a command with OSD and [pld1] in the text only, add to it Event and select girder and name it OSD, this to show info on OSD
I am posting the script for refrerence and questions ...
enjoy ... 8)
--################################################## ############################
-- AlphaNumric Input
-- v. 0.5
-- Sarmad Mashta, 2004
-- WinLUAex, Plug in For Device to be used for Input
--################################################## ############################
function DoAlphaNum (Char)
print (Char) -- here triger the events you like
-- based on Char value, or passit with
-- TriggerEvent as PLD 1
end
------------------------------ main Code -----------------------------
EventAlphaNumricMode = '3FS00XZ' --[[ Event String to Enter/Exit AlphaNumric
Mode, must be replaced with Eventstring
that will be used to Enter/Exit
AlphaNumric Mode--]]
DeviceID = 124 -- Must be replaced with Device Plugin ID
local TimeOut = 15 * 1000 -- Seconds before exiting AlphaNumric Input
-- Automatically (Afted Idle)
local CharTime = 1.5 * 1000 -- Seconds to repeat key press to
-- change to next charecter
local Event = EventString
-------------- AutoExit Timer --------------
if not SleepTimer then
SleepTimer = TIMER_CreateObject()
SleepTimer.Create (nil, 'TriggerEvent(EventAlphaNumricMode, DeviceID)', nil, 0)
else
SleepTimer.Cancel()
end
SleepTimer.Arm (TimeOut)
----------- Key Press Processing -----------
if Event == EventAlphaNumricMode then
result = 1 --[[ Goto Toggle each time AlphaNumric Mode
pressed or simulated by timer xx--]]
AlphaNumricMode = not AlphaNumricMode
if AlphaNumricMode then
Key3100000 = ' ?@1' -- set here the possible values for each key
Key3200000 = 'ABC2' -- Variable Names must be KeyXXXXXXX Where
Key3300000 = 'DEF3' -- XXXXXXX replaced with the Eventstring
Key3400000 = 'GHI4' -- generated by Device used to generate the
Key3500000 = 'JKL5' -- input. Extra Charecters can be added to
Key3600000 = 'MNO6' -- strings as needed
Key3700000 = 'PQRS7'
Key3800000 = 'TUV8'
Key3900000 = 'XWYZ9'
-- This is Used to Display info in OSD
TriggerEvent ('OSD', 18, 'Entering AlphaNumric mode...')
else
Key3100000 = nil -- these lines clears the mess we created :)
Key3200000 = nil
Key3300000 = nil
Key3400000 = nil
Key3500000 = nil
Key3600000 = nil
Key3700000 = nil
Key3800000 = nil
Key3900000 = nil
Index = nil
LastKey = nil
SleepTimer.Destroy()
SleepTimer = nil
DeviceID = nil
CurrentChar = nil
AlphaNumricMode = nil
-- Display Exitining AlphaNumricMode
TriggerEvent ('OSD', 18, 'Exiting AlphaNumric mode...')
end
else
if not AlphaTimer then
AlphaTimer = TIMER_CreateObject()
AlphaTimer.Create (nil, 'DoAlphaNum (CurrentChar)', nil, 0)
else
AlphaTimer.Cancel()
end
AlphaTimer.Arm (CharTime)
if LastKey ~= Event then
if LastKey then
DoAlphaNum (CurrentChar)
end
Index = 1
LastKey = Event
else
Index = Index + 1
if Index > strlen (getglobal ('Key'..Event)) then Index =1 end
end
if getglobal('Key'.. Event) then
CurrentChar = strsub(getglobal('Key'.. Event), Index, Index)
end
TriggerEvent ('OSD', 18, 1, CurrentChar)
end
------------------- here is the GML ------------
<?xml version="1.0" encoding="UTF-8"?>
<Girder><Group Name="Alpha Numric" Identifier="4509" Enabled="TRUE"><Command Name="AlphaNumric Input Script" Identifier="4500" Enabled="TRUE"><StateCount>1</StateCount><StateBegin>1</StateBegin><StateCurrent>1</StateCurr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D0obm 9uZSkACAAAAAEAAAAAAwAAAAAA
AAAAAAAAAQAAAAYAAABwcmludAAAAAAAAAAAAAQAAAAMAAAACw AAAAKAAAAAAAAAsAAAADAAAAAT
AAAAhwAAAFMAAADGHgCA0wAAAIYDAIDG+QCAGgAAAAgAAADG+Q CAGgAAAAwBAABMAQAApgIAgIwB
AABCgAEAUwEAAEwBAADOAQAARAAAAAcCAABEAAAAxv//fwKAAQCqAACATAEAAE4CAAACgAEATAEA
AI4CAAALAAAAAoABAIsAAADMAgAAYBEAgAYAAIATAwAATAMAAB 8AAABTAwAATAMAACcGAIDHAwAA
kwMAAEcEAAATBAAAxwQAAJMEAABHBQAAEwUAAMcFAACTBQAARw YAABMGAADHBgAAkwYAAEcHAAAT
BwAAxwcAAJMHAAAMCAAARwgAAEYEAIBGAACAhwgAAAKAAQCqGg CARAAAAJMDAABEAAAAEwQAAEQA
AACTBAAARAAAABMFAABEAAAAkwUAAEQAAAATBgAARAAAAJMGAA BEAAAAEwcAAEQAAACTBwAARAAA
ANMIAABEAAAAEwkAAEwBAABOCQAAAoABAEQAAABTAQAARAAAAN MAAABEAAAAkwkAAAwIAABHCAAA
RgQAgEYAAIDHCQAAAoABACoRAIAMCgAApgIAgIwBAABCgAEAEw oAAAwKAADOAQAARAAAAEcKAABE
AAAAxv//fwKAAQCqAACADAoAAE4CAAACgAEADAoAAI4CAABLAAAAAoABAA wJAACLAAAAYQIAgAwJ
AACnAACADAAAAIwJAAACgAEABgAAgNMIAACLAAAAEwkAAGoDAI DMCAAAGAAAgNMIAADMCAAAjAoA
AMwKAAAHCwAAiwAAAJ0AAADCvwIAQgACAGMAAIAGAACA0wgAAM wKAAAHCwAAiwAAAJ0AAABCgAEA
ZwIAgEwLAADMCgAABwsAAIsAAACdAAAAQgACAMwIAADMCAAAQo ABAJMJAAAMCAAARwgAAEYEAIBG
AACAjAkAAAKAAQAAAAAA</Binary><OSD>FALSE</OSD><Submatch>FALSE</Submatch><Topmost>TRUE</Topmost><OneMatch>FALSE</OneMatch><UseVar>FALSE</UseVar><MatchHidden>FALSE</MatchHidden><MatchNum>1</MatchNum><ActionType>4</ActionType><ActionSubType>34</ActionSubType><sValue1>--################################################## ############################
-- AlphaNumric Input
-- v. 0.5
-- Sarmad Mashta, 2004
-- WinLUAex, Plug in For Device to be used for Input
--################################################## ############################
function DoAlphaNum (Char)
print (Char) -- here triger the events you like
-- based on Char value, or passit with
-- TriggerEvent as PLD 1
end
------------------------------ main Code -----------------------------
EventAlphaNumricMode = '3FS00XZ' --[[ Event String to Enter/Exit AlphaNumric
Mode, must be replaced with Eventstring
that will be used to Enter/Exit
AlphaNumric Mode--]]
DeviceID = 124 -- Must be replaced with Device Plugin ID
local TimeOut = 15 * 1000 -- Seconds before exiting AlphaNumric Input
-- Automatically (Afted Idle)
local CharTime = 1.5 * 1000 -- Seconds to repeat key press to
-- change to next charecter
local Event = EventString
-------------- AutoExit Timer --------------
if not SleepTimer then
SleepTimer = TIMER_CreateObject()
SleepTimer.Create (nil, 'TriggerEvent(EventAlphaNumricMode, DeviceID)', nil, 0)
else
SleepTimer.Cancel()
end
SleepTimer.Arm (TimeOut)
----------- Key Press Processing -----------
if Event == EventAlphaNumricMode then
result = 1 --[[ Goto Toggle each time AlphaNumric Mode
pressed or simulated by timer xx--]]
AlphaNumricMode = not AlphaNumricMode
if AlphaNumricMode then
Key3100000 = ' ?@1' -- set here the possible values for each key
Key3200000 = 'ABC2' -- Variable Names must be KeyXXXXXXX Where
Key3300000 = 'DEF3' -- XXXXXXX replaced with the Eventstring
Key3400000 = 'GHI4' -- generated by Device used to generate the
Key3500000 = 'JKL5' -- input. Extra Charecters can be added to
Key3600000 = 'MNO6' -- strings as needed
Key3700000 = 'PQRS7'
Key3800000 = 'TUV8'
Key3900000 = 'XWYZ9'
-- This is Used to Display info in OSD
TriggerEvent ('OSD', 18, 'Entering AlphaNumric mode...')
else
Key3100000 = nil -- these lines clears the mess we created :)
Key3200000 = nil
Key3300000 = nil
Key3400000 = nil
Key3500000 = nil
Key3600000 = nil
Key3700000 = nil
Key3800000 = nil
Key3900000 = nil
Index = nil
LastKey = nil
SleepTimer.Destroy()
SleepTimer = nil
DeviceID = nil
CurrentChar = nil
AlphaNumricMode = nil
-- Display Exitining AlphaNumricMode
TriggerEvent ('OSD', 18, 'Exiting AlphaNumric mode...')
end
else
if not AlphaTimer then
AlphaTimer = TIMER_CreateObject()
AlphaTimer.Create (nil, 'DoAlphaNum (CurrentChar)', nil, 0)
else
AlphaTimer.Cancel()
end
AlphaTimer.Arm (CharTime)
if LastKey ~= Event then
if LastKey then
DoAlphaNum (CurrentChar)
end
Index = 1
LastKey = Event
else
Index = Index + 1
if Index > strlen (getglobal ('Key'..Event)) then Index =1 end
end
if getglobal('Key'.. Event) then
CurrentChar = strsub(getglobal('Key'.. Event), Index, Index)
end
TriggerEvent ('OSD', 18, CurrentChar)
end
</sValue1><bValue1>FALSE</bValue1><bValue2>FALSE</bValue2><bValue3>FALSE</bValue3><lValue1>4502</lValue1><EventString Name="EventString" Identifier="4501" Enabled="FALSE" Invert="FALSE" Device="-2" IrStr="On Keyboard driver Event"><Comments>Select your Device from the list in On Event</Comments></EventString><EventString Name="EventString" Identifier="4507" Enabled="TRUE" Invert="FALSE" Device="124" IrStr="3FS00XZ"><Comments>Learn the Key that will get you Into AlphaNumric Mode</Comments></EventString></Command><MultiGroup Name="Toggle AlphaNumric Input" Identifier="4502" Enabled="TRUE"><Comments>See Coments in Enter/Exit commands</Comments><StateCount>1</StateCount><StateBegin>1</StateBegin><StateCurrent>1</StateCurrent><StateInvert>FALSE</StateInvert><Command Name="Enter AlphaNumric" Identifier="4504" Enabled="TRUE"><Comments>here Disable all Eventstrings that Share same input: state 1 of 2</Comments><StateCount>2</StateCount><StateBegin>1</StateBegin><StateCurrent>1</StateCurrent><StateInvert>FALSE</StateInvert><OSD>FALSE</OSD><Submatch>FALSE</Submatch><Topmost>TRUE</Topmost><OneMatch>FALSE</OneMatch><UseVar>FALSE</UseVar><MatchHidden>FALSE</MatchHidden><MatchNum>1</MatchNum><ActionType>4</ActionType><ActionSubType>1</ActionSubType><bValue1>FALSE</bValue1><bValue2>FALSE</bValue2><bValue3>FALSE</bValue3><lValue1>4501</lValue1></Command><Command Name="Exit AlphaNumric" Identifier="4505" Enabled="TRUE"><Comments>here Enable all Eventstrings that Share same input: state 2 of 2</Comments><StateCount>2</StateCount><StateBegin>2</StateBegin><StateCurrent>2</StateCurrent><StateInvert>FALSE</StateInvert><OSD>FALSE</OSD><Submatch>FALSE</Submatch><Topmost>TRUE</Topmost><OneMatch>FALSE</OneMatch><UseVar>FALSE</UseVar><MatchHidden>FALSE</MatchHidden><MatchNum>1</MatchNum><ActionType>4</ActionType><ActionSubType>2</ActionSubType><bValue1>FALSE</bValue1><bValue2>FALSE</bValue2><bValue3>FALSE</bValue3><lValue1>4501</lValue1></Command></MultiGroup></Group></Girder> 8)