PDA

View Full Version : Putting an end to AlphaNumric Input requests ...



Haddood
June 6th, 2004, 01:31 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&#xD;
AAsAAABEb0FscGhhTnVtABEAAABFdmVudEFscGhhTnVtcmljAA gAAAAzRlMwMFhaAAkAAABEZXZp&#xD;
Y2VJ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FMAAADGHgCA0wAAAIYDAIDG+QCAGgAAAAgAAADG+Q CAGgAAAAwBAABMAQAApgIAgIwB&#xD;
AABCgAEAUwEAAEwBAADOAQAARAAAAAcCAABEAAAAxv//fwKAAQCqAACATAEAAE4CAAACgAEATAEA&#xD;
AI4CAAALAAAAAoABAIsAAADMAgAAYBEAgAYAAIATAwAATAMAAB 8AAABTAwAATAMAACcGAIDHAwAA&#xD;
kwMAAEcEAAATBAAAxwQAAJMEAABHBQAAEwUAAMcFAACTBQAARw YAABMGAADHBgAAkwYAAEcHAAAT&#xD;
BwAAxwcAAJMHAAAMCAAARwgAAEYEAIBGAACAhwgAAAKAAQCqGg CARAAAAJMDAABEAAAAEwQAAEQA&#xD;
AACTBAAARAAAABMFAABEAAAAkwUAAEQAAAATBgAARAAAAJMGAA BEAAAAEwcAAEQAAACTBwAARAAA&#xD;
ANMIAABEAAAAEwkAAEwBAABOCQAAAoABAEQAAABTAQAARAAAAN MAAABEAAAAkwkAAAwIAABHCAAA&#xD;
RgQAgEYAAIDHCQAAAoABACoRAIAMCgAApgIAgIwBAABCgAEAEw oAAAwKAADOAQAARAAAAEcKAABE&#xD;
AAAAxv//fwKAAQCqAACADAoAAE4CAAACgAEADAoAAI4CAABLAAAAAoABAA wJAACLAAAAYQIAgAwJ&#xD;
AACnAACADAAAAIwJAAACgAEABgAAgNMIAACLAAAAEwkAAGoDAI DMCAAAGAAAgNMIAADMCAAAjAoA&#xD;
AMwKAAAHCwAAiwAAAJ0AAADCvwIAQgACAGMAAIAGAACA0wgAAM wKAAAHCwAAiwAAAJ0AAABCgAEA&#xD;
ZwIAgEwLAADMCgAABwsAAIsAAACdAAAAQgACAMwIAADMCAAAQo ABAJMJAAAMCAAARwgAAEYEAIBG&#xD;
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 &gt; 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)

Ron
June 6th, 2004, 11:12 PM
That is awesome, I'll have to try it!!

mitko
June 7th, 2004, 05:20 AM
I've been away for a long time and I have to catch up quickly
:)
So can someone help me here with this script. How does one trigger the needed event? What is used to simulate the keyboard input?
I'm a little lost here

I suppose that if this is working well enought there will be no need of my KeySelector plugin which is nearly finished now. I suppose I'll send it to Ron after all so the users that are not familiar with LUA could use it

Haddood
June 7th, 2004, 10:16 AM
HI every one
i found that i've miss typed one variable :oops: , the script and the gml are corrected now ...

the mistake was; after comment 'main code' first line

read: EventAlphaNumric= '3FS00XZ'
it must be: EventAlphaNumricMode = ' 3FS00XZ'

and Add:
AlphaNumricMode = nil
after:
else -- these lines clears the mess we created

this is to clean this variable
sorry for those who already started testing ... :oops:

calavera-o
July 1st, 2004, 01:30 PM
Some Problems..

The OSD only shows the first character when i press a button on the
remote control.
For example:
1: A
2: D
3: G

I also don't understand what you mean with:
"-- here triger the events you like
-- based on Char value, or passit with
-- TriggerEvent as PLD 1"
Can you please make an example. I just want to send the characters as a keystroke to several applications.

Haddood
July 1st, 2004, 04:41 PM
Some Problems..

The OSD only shows the first character when i press a button on the
remote control.
For example:
1: A
2: D
3: G

first press of the key show the first letter, second press shows the second ... etc. also there is time out for pressing the keys, so increase it if your remote is kind of slow, you must have winLUA ex installed to get it to work, ...


I also don't understand what you mean with:
"-- here triger the events you like
-- based on Char value, or passit with
-- TriggerEvent as PLD 1"
Can you please make an example. I just want to send the characters as a keystroke to several applications.


well this part makes the script usefull, if you are planning only on sending keyboard keystrokes i will look into that when i have sometime ...
of go and do some reading about triggering events in girder from LUA script it is not difficult to learn ...

this script is the core functions ... and does not work out of the shlef, but it is a good idea that i will enclude sending keystrokes to the active window and adding a string builder to show

calavera-o
July 2nd, 2004, 09:17 AM
first press of the key show the first letter, second press shows the second ... etc. also there is time out for pressing the keys, so increase it if your remote is kind of slow, you must have winLUA ex installed to get it to work, ...

hmm...I only can see the first character, even if i change the chartime.
wunLUA ex is installed.
I use the ATI Remote with the plugin "X10/Ati Remote Interface".
Here is my Script:



--################################################## ############################
-- AlphaNumric Input
-- v. 0.5
-- Sarmad Mashta, 2004
-- WinLUAex, Plug in For Device to be used for Input
--################################################## ############################

function DoAlphaNum &#40;Char&#41;
print &#40;Char&#41; -- here triger the events you like
-- based on Char value, or passit with
-- TriggerEvent as PLD 1
end
------------------------------ main Code -----------------------------
EventAlphaNumricMode = 'X10_DN_Record' --&#91;&#91; Event String to Enter/Exit AlphaNumric
Mode, must be replaced with Eventstring
that will be used to Enter/Exit
AlphaNumric Mode--&#93;&#93;
DeviceID = 62 -- Must be replaced with Device Plugin ID
local TimeOut = 15 * 1000 -- Seconds before exiting AlphaNumric Input
-- Automatically &#40;Afted Idle&#41;
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&#40;&#41;
SleepTimer.Create &#40;nil, 'TriggerEvent&#40;EventAlphaNumricMode, DeviceID&#41;', nil, 0&#41;
else
SleepTimer.Cancel&#40;&#41;
end
SleepTimer.Arm &#40;TimeOut&#41;

----------- Key Press Processing -----------
if Event == EventAlphaNumricMode then
result = 1 --&#91;&#91; Goto Toggle each time AlphaNumric Mode
pressed or simulated by timer xx--&#93;&#93;
AlphaNumricMode = not AlphaNumricMode
if AlphaNumricMode then
KeyX10_DN_One = ' ?@1' -- set here the possible values for each key
KeyX10_DN_Two = 'ABC2' -- Variable Names must be KeyXXXXXXX Where
KeyX10_DN_Three = 'DEF3' -- XXXXXXX replaced with the Eventstring
KeyX10_DN_Four = 'GHI4' -- generated by Device used to generate the
KeyX10_DN_Five = 'JKL5' -- input. Extra Charecters can be added to
KeyX10_DN_Six = 'MNO6' -- strings as needed
KeyX10_DN_Seven = 'PQRS7'
KeyX10_DN_Eight = 'TUV8'
KeyX10_DN_Nine = 'XWYZ9'
-- This is Used to Display info in OSD
TriggerEvent &#40;'OSD', 18, 'Entering AlphaNumric mode...'&#41;
else
KeyX10_DN_One = nil -- these lines clears the mess we created
KeyX10_DN_Two = nil
KeyX10_DN_Three = nil
KeyX10_DN_Four = nil
KeyX10_DN_Five = nil
KeyX10_DN_Six = nil
KeyX10_DN_Seven = nil
KeyX10_DN_Eight = nil
KeyX10_DN_Nine = nil
Index = nil
LastKey = nil
SleepTimer.Destroy&#40;&#41;
SleepTimer = nil
DeviceID = nil
CurrentChar = nil
AlphaNumricMode = nil
-- Display Exitining AlphaNumricMode
TriggerEvent &#40;'OSD', 18, 'Exiting AlphaNumric mode...'&#41;
end
else
if not AlphaTimer then
AlphaTimer = TIMER_CreateObject&#40;&#41;
AlphaTimer.Create &#40;nil, 'DoAlphaNum &#40;CurrentChar&#41;', nil, 0&#41;
else
AlphaTimer.Cancel&#40;&#41;
end
AlphaTimer.Arm &#40;CharTime&#41;
if LastKey ~= Event then
if LastKey then
DoAlphaNum &#40;CurrentChar&#41;
end
Index = 1
LastKey = Event
else
Index = Index + 1
if Index > strlen &#40;getglobal &#40;'Key'..Event&#41;&#41; then Index =1 end
end
if getglobal&#40;'Key'.. Event&#41; then
CurrentChar = strsub&#40;getglobal&#40;'Key'.. Event&#41;, Index, Index&#41;
end
TriggerEvent &#40;'OSD', 18, CurrentChar&#41;
end










well this part makes the script usefull, if you are planning only on sending keyboard keystrokes i will look into that when i have sometime ...
of go and do some reading about triggering events in girder from LUA script it is not difficult to learn ...

this script is the core functions ... and does not work out of the shlef, but it is a good idea that i will enclude sending keystrokes to the active window and adding a string builder to show

That would be wonderful. Thanks in advance.

esajesa
February 8th, 2005, 03:38 PM
Hi,

do you think you could post this in a zipped file and an example?? Would be very very nice!

Cheers,
Jens

Klayer
July 4th, 2005, 02:09 PM
It would be great if someone competent could post a result which is more than a theroetical solution which can only be used by "techies" who are willing to learn this lua language.

dma
July 10th, 2005, 01:37 PM
Hey people. :)

I have modified Haddood's method to a much simplier version.

My version doesn't include any activation/desactivation system, it's always active (though it's certainly possible to do it by yourself additionaly, if you need it).

What it does is just browsing through characters defined for each button with display to basic Girder OSD, then ouputing those via basic Girder keyboard output.

So to install my version, all you have to do is:
1) Install the WinLUAex plugin,
2) Import the .gml group,
3) Replace the "EventString"s by the buttons of your remote you want to use for alphanumeric input (if not corresponding already, mine being X10/ATI),
4) Edit the Script (in "Girder" tab),
5) Replace the XXX from Key_XXX parameters by the names of the "EventString"s corresponding to your buttons (again if not corresponding already).
6) Test it, it SHOULD work. :)


Many thanks to Haddood for the original principle! :D

By the way the problem that Calavera-o had came from the ATI remote input of key repeat and/or key slacken. The current keycode changes between two keypresses.


Here is the .gml code for direct comments.


<?xml version="1.0" encoding="UTF-8" ?>
<Girder>
<Group Name="Alphanumeric" Identifier="27458" Enabled="TRUE">
<Command Name="Alphanumeric Input Script" Identifier="27459" Enabled="TRUE">
<Comments>Replace the "EventString"s here by the buttons of your remote you want to use for alphanumeric input &#40;if not corresponding, mine being X10/ATI&#41;. Then edit the Script &#40;in "Girder" tab&#41;.</Comments>
<StateCount>1</StateCount>
<StateBegin>1</StateBegin>
<StateCurrent>1</StateCurrent>
<StateInvert>FALSE</StateInvert>
<Binary Encoding="Base64">G0x1YUABBAQEIAYJCBLmW6GwubJBCAAAAD0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xw IAAJMCAABHAwAAEwMAAMcDAACT&#xD;
AwAARwQAABMEAADHBAAAkwQAADAAAAATBQAATAUAAIwFAACmAg CAzAUAAEIAAQCTBQAAjAUAAA4G&#xD;
AABEAAAARwYAAEQAAADG//9/AgABAKoAAICMBQAAjgYAAAIAAQCMBQAAzgYAAAsAAAACAAEADA cA&#xD;
AEcHAABLAAAAnQAAAEIAAQAnCQCAjAcAAEsAAABhAgCAjAcAAK cAAIAMBQAAzAcAAAIAAQAGAACA&#xD;
EwgAAEsAAACTBwAAagMAgAwIAAAYAACAEwgAAAwIAABMCAAADA cAAEcHAABLAAAAnQAAAMI/AgBC&#xD;
gAEAYwAAgAYAAIATCAAAjAgAAAwHAABHBwAASwAAAJ0AAABCgA EADAgAAAwIAABCAAEA0wcAAMwI&#xD;
AAAHCQAARgQAgMwHAAACAAEAAAAAAA==</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>--################################################## ############################
-- Alphanumeric Input
-- v. 0.51
-- Sarmad Mashta, 2004
-- dma, 2005
--
-- Plug-in requirement&#58; WinLUAex
--################################################## ############################

---------------------------------- Parameters ----------------------------------
--------------------- MODIFY THOSE ACCORDING TO YOUR SETUP ---------------------

--&#91;&#91; Seconds to wait before printing current character without any new key
pressed. / \ --&#93;&#93;
local CharTime = 1.5 * 1000

--&#91;&#91; Set here the possible values for each key.

Variable Names must start with "Key_" then the name of the EventString
generated by the device used for input &#40;mine being X10/ATI remote&#41;.

Extra Characters can be added to values as needed.
You can also add more keys if you need.--&#93;&#93;

Key_X10_DN_One = '1&#58;/.@'
Key_X10_DN_Two = '2abc'
Key_X10_DN_Three = '3def'
Key_X10_DN_Four = '4ghi'
Key_X10_DN_Five = '5jkl'
Key_X10_DN_Six = '6mno'
Key_X10_DN_Seven = '7pqrs'
Key_X10_DN_Eight = '8tuv'
Key_X10_DN_Nine = '9wxyz'
Key_X10_DN_Zero = '0 '

----------------------------------- main Code ----------------------------------

function DoAlphaNum &#40;Char&#41;
TriggerEvent &#40;'PRINT', 18, Char&#41;
LastKey = nil
end

local Event = EventString

if not AlphaTimer then
AlphaTimer = TIMER_CreateObject&#40;&#41;
AlphaTimer.Create &#40;nil, 'DoAlphaNum &#40;CurrentChar&#41;', nil, 0&#41;
else
AlphaTimer.Cancel&#40;&#41;
end
AlphaTimer.Arm &#40;CharTime&#41;

if getglobal&#40;'Key_'.. Event&#41; then
if LastKey ~= Event then
if LastKey then
DoAlphaNum &#40;CurrentChar&#41;
end
Index = 1
LastKey = Event
else
Index = Index + 1
if Index &gt; strlen &#40;getglobal &#40;'Key_'..Event&#41;&#41; then
Index = 1
end
end
CurrentChar = strsub&#40;getglobal&#40;'Key_'.. Event&#41;, Index, Index&#41;
end
TriggerEvent &#40;'OSD', 18, CurrentChar&#41;

--################################################## ############################</sValue1>
<bValue1>FALSE</bValue1>
<bValue2>FALSE</bValue2>
<bValue3>FALSE</bValue3>
<lValue1>27462</lValue1>
<lValue2>27451</lValue2>
<EventString Name="EventString" Identifier="27469" Enabled="TRUE" Invert="FALSE" Device="62" IrStr="X10_DN_One" />
<EventString Name="EventString" Identifier="27470" Enabled="TRUE" Invert="FALSE" Device="62" IrStr="X10_DN_Two" />
<EventString Name="EventString" Identifier="27471" Enabled="TRUE" Invert="FALSE" Device="62" IrStr="X10_DN_Three" />
<EventString Name="EventString" Identifier="27472" Enabled="TRUE" Invert="FALSE" Device="62" IrStr="X10_DN_Four" />
<EventString Name="EventString" Identifier="27473" Enabled="TRUE" Invert="FALSE" Device="62" IrStr="X10_DN_Five" />
<EventString Name="EventString" Identifier="27474" Enabled="TRUE" Invert="FALSE" Device="62" IrStr="X10_DN_Six" />
<EventString Name="EventString" Identifier="27475" Enabled="TRUE" Invert="FALSE" Device="62" IrStr="X10_DN_Seven" />
<EventString Name="EventString" Identifier="27476" Enabled="TRUE" Invert="FALSE" Device="62" IrStr="X10_DN_Eight" />
<EventString Name="EventString" Identifier="27477" Enabled="TRUE" Invert="FALSE" Device="62" IrStr="X10_DN_Nine" />
<EventString Name="EventString" Identifier="27478" Enabled="TRUE" Invert="FALSE" Device="62" IrStr="X10_DN_Zero" />
</Command>
<Command Name="OSD" Identifier="27465" Enabled="TRUE">
<StateCount>1</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>9</ActionSubType>
<sValue1>&#91;pld1&#93;</sValue1>
<bValue1>FALSE</bValue1>
<bValue2>FALSE</bValue2>
<bValue3>FALSE</bValue3>
<EventString Name="EventString" Identifier="27466" Enabled="TRUE" Invert="FALSE" Device="18" IrStr="OSD" />
</Command>
<Command Name="PRINT" Identifier="27467" Enabled="TRUE">
<StateCount>1</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>6</ActionType>
<ActionSubType>9</ActionSubType>
<sValue1>&#91;pld1&#93;</sValue1>
<sValue2>FALSE</sValue2>
<bValue1>FALSE</bValue1>
<bValue2>FALSE</bValue2>
<bValue3>FALSE</bValue3>
<EventString Name="EventString" Identifier="27468" Enabled="TRUE" Invert="FALSE" Device="18" IrStr="PRINT" />
</Command>
</Group>
</Girder>

noodleNT
August 12th, 2007, 04:13 PM
I am trying to get this to work in Girder 5. I am having a problem though.

I get the following error:
[string "SVRLINK_Remote.gml:\MCE\Controls\Number Pad..."]:28: attempt to call global `TIMER_CreateObject' (a nil value)

I have a feeling its because I don't know what my device input ID is. How can I find this?

----
The other script posted here does that too. Looks like TIMER_CreateObject is no longer valid.

Rob H
August 13th, 2007, 03:52 AM
TIMER_CreateObject is the old Girder 3.3 timer.

In G4 and G5 you would use gir.CreateTimer() instead - see the help file.