LM Gestion

Blast IR with the LM RKM COM Objects

Download Free Version

You can use LM Remote KeyMap COM object to use your IR Blaster. For example you can use VBScript to blast some IR codes to one of the LM Remote KeyMap IR devices.

The LM Remote KeyMap COM objects are :

  • LMRemoteKeyMap.IRDevices : this is the main COM object. With this object you can access all LM Remote KeyMap IR devices.
  • LMRemoteKeyMap.Device : this COM object represent one LM Remote KeyMap IR device
  • LMRemoteKeyMap.Button : this COM object represent one button for a IR device

 

LMRemoteKeyMap.IRDevices properties and methods

Count

This property returns an integer : the number of IR devices currently defined in LM Remote KeyMap

Devices

This property returns an array of LMRemoteKeyMap.Device objects. It contains all LM Remote KeyMap IR devices.

Blast(string deviceID, string buttonID)

This method allow you to send a IR code for a given button ID and device ID (button and device ID are GUIDs generated by LM Remote KeyMap when you create a device or button). Normally you'll not use this method.

GetDeviceByName(string deviceName)

This method returns the LMRemoteKeyMap.Device object corresponding to the name passed to the method. This is the name you defined for the device. 

GetDevice(string deviceID)

This method returns the LMRemoteKeyMap.Device object corresponding to the device ID passed to the method. You will normally not use this method.

LMRemoteKeyMap.Device properties and methods

Name

This property returns a string as the device name

ID

This property returns a string as the device ID

Buttons

This property returns an array of LMRemoteKeyMap.Button objects. That is all buttons you defined for this IR device in LM Remote KeyMap.

ChangeChannel(string channelNumber)

This method issue a channel change on the device to the channel number passed to the method.

GetButton(string buttonID)

This method returns a LMRemoteKeyMap.Button object corresponding to the button ID passed to the method.

GetButtonByName(string buttonName)

This method returns a LMRemoteKeyMap.Button object corresponding to the button name passed to the method.

LMRemoteKeyMap.Button properties and methods

Name

This property returns a string as the button name.

ID

This property returns a string as the button ID.

Blast() 

This method sends the IR code corresponding to this button to your IR device.

Sample VBScript

Here is a quick sample script that sends one IR code to a device.

'First we create our main IRDevices object
Dim oIRDevices
Set oIRDevices = WScript.CreateObject("LMRemoteKeyMap.IRDevices")

Dim aDevice, aButton
'Then we get a IR device by its name
Set aDevice = oIRDevices.GetDeviceByName("MySetTopBox")
If Not aDevice Is Nothing Then
    'Once we get the device, get a button by its name
    Set aButton = aDevice.GetButtonByName("PowerOn")
    'We blast the IR code
    If Not aButton Is Nothing Then aButton.Blast()
    'We destroy the button object to be clean
    Set aButton = Nothing
End If

'A little clean up
Set aDevice = Nothing
Set oIRDevices = Nothing

This little script should send a "PowerOn" IR code to the device named "MySetTopBox".

Download this sample script

 



(c) 2008 LM Gestion