New Versions of InputDeviceMapper of LiveDriveIR (1 Viewer)

M

MaceX

Guest
kaburke said:
Can you send me the modified code?

Ok I know why the exception was occuring earlier, it was my fault. I was using a Form to receive WM_INPUT messages. I'm using a NativeWindow now and that exception isn't occuring.

I'm just making a whole mess out of this thing and confusing people and myself. :oops: :?

I just say forget about it.
 

kaburke

Portal Pro
March 4, 2005
64
0
Alberta, Canada
New Version of InputDeviceMapper

Version 0.4 of InputDeviceMapper has now been uploaded.

InputDeviceMapper has had some serious work done to it. I have completely restructured the code, making it more efficient, cleaner, simpler, more readable, all around better.

I also enhaced the configuration form. Most notably, I added a "New Profile" wizard that makes the initial task of learning a buch of Commands a lot easier. I've also added a Testing area to verify Commands.

The plugin has been uploaded as a patch: InputDeviceMapper

As usual, let me know of any errors/potential improvements/etc.
 

kaburke

Portal Pro
March 4, 2005
64
0
Alberta, Canada
New Version of InputDeviceMapper

Sorry for the quick turnaround - 0.4 turned out to have a few bugs (sorry for releasing it before I caught them).

Version 0.4.1 of InputDeviceMapper has now been uploaded.

InputDeviceMapper just had a few minor bugs that showed up with empty configuration files. Said bugs have been squashed.

The plugin has been uploaded as a patch: InputDeviceMapper

As usual, let me know of any errors/potential improvements/etc.
 

giovifree

Portal Member
February 7, 2005
39
0
Home Country
Italy Italy
hi.........

great work

i have as soon as ended setup myportal, inputdevicemapper and livedrive are wonderfull


bye
 

Mr.Mitchell

Retired Team Member
  • Premium Supporter
  • May 13, 2004
    227
    0
    the Netherlands
    I am working on a X10 deviceplugin and I got it kinda working. When using the wizard to learn everything is OK, but if I learn a command by pressing the "Learn Command" button I get an exception. When just continueing and ignoring the exception I can still learn commands. When I use the plugin in MP it works fine.

    The exact steps to reproduce are:

    - Press "Learn Command" button
    - Press button on the remote
    - New window comes up, fill in name and action/key
    - Press Save
    - Exception occurs (the exception text is at the bottom of this message)

    EDIT: I found that the same exception occurs when I press a button on the remote when the Setup screen for the mapper is visible, so ths also gives the exception:

    - Start configuration.exe
    - Goto plugins and open the Setup for the InputDeviceEventMapper plugin
    - Press key on the remote
    - Exception occurs

    It's probably some problem with my DevicePlugin, but I don't know what the problem could be. Any ideas.

    Also have a few suggestions.
    - It would be nice to have a way to "import" all the keys that are used in keymap.xml in one go. Right now I added the keys manually and I forgot a few. It would be nice if I could just press "Get keys from Keymap.xml" and then the keys list would be filled automatically.
    - Have to go now, other suggestions will follow :)
    Code:
    ************** Exception Text **************
    System.Runtime.InteropServices.SEHException: External component has thrown an exception.
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       at System.Windows.Forms.ComponentManager.System.Windows.Forms.UnsafeNativeMethods+IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.RunDialog(Form form)
       at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
       at InputDeviceMapper.InputDeviceMapperSetupForm.butAddMapping_Click(Object sender, EventArgs e)
       at System.Windows.Forms.Control.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnClick(EventArgs e)
       at System.Windows.Forms.Button.WndProc(Message& m)
       at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
     

    Mr.Mitchell

    Retired Team Member
  • Premium Supporter
  • May 13, 2004
    227
    0
    the Netherlands
    OK, here is the rest of the suggestions:
    - Make Space display as {SPACE} it is really hard to see if you have pressed space when adding keys to the list in the wizard. Added this by adding the following line to the keyrecorder: SENDKEYS_CODES[Keys.Space] = "{SPACE}";

    - I think it would be handy if the focus would be set to the key input field after pressing Add or Clear (in the wizard and in the Learn Command screen). I think it will make it easier to add keys.

    - It would be nice to be able to run the Wizard again. Especially for the learning part.

    - It would be nice to have an indication on the test page everytime a command is received. My remote has a repeat and when watching the command on the Test page I don't see if the repeats are received. Maybe a "light" that blinks on each received command?

    These 2 could be bugs
    - When I press PageUp no key is recognised, but when I press PageDown then I get {PGUP} all other keys seem to work fine.I found that this is a typo in the KeyRecorder it says "SENDKEYS_CODES[Keys.PageDown] = "{PGUP}";" i.s.o. "SENDKEYS_CODES[Keys.PageUp] = "{PGUP}";"

    - When I click on the Configure plugins button I don't see my deviceplugin listed. It implements the IInputDevicePlugin interface, but the header "Check the device plugins you want to enabled" suggests that all deviceplugins should be listed and not only the ones that have a configuration.

    BTW: Using 0.4.1
     

    kaburke

    Portal Pro
    March 4, 2005
    64
    0
    Alberta, Canada
    Sorry for the delay in getting to your post. I was busy with Easter all weekend.

    Mr. Mitchell said:
    Code:
    ************** Exception Text **************
    System.Runtime.InteropServices.SEHException: External component has thrown an exception.
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       ...

    It looks like something in your code, though I can't think of what. If you could tell me where to get a copy of your source, I would certainly be willing to take a look and figure out how my code is misbehaving in relation to yours (though I don't have an X10 device).

    Mr. Mitchell said:
    - It would be nice to have a way to "import" all the keys that are used in keymap.xml in one go. Right now I added the keys manually and I forgot a few. It would be nice if I could just press "Get keys from Keymap.xml" and then the keys list would be filled automatically.

    What type of file is keymap.xml? Is it one of the configuration files that InputDeviceMapper generates?

    Mr. Mitchell said:
    - Make Space display as {SPACE} it is really hard to see if you have pressed space when adding keys to the list in the wizard.

    Good idea. Did your fix work (i.e., did a SPACE get sent to the application?)? {SPACE} is not listed as a supported code in the SendKeys() description. Irrespective, I will add said functionality in 0.4.2 (in a manner that works, of course).

    Mr. Mitchell said:
    - I think it would be handy if the focus would be set to the key input field after pressing Add or Clear (in the wizard and in the Learn Command screen). I think it will make it easier to add keys.

    Good idea. Will be in 0.4.2.

    Mr. Mitchell said:
    - It would be nice to be able to run the Wizard again. Especially for the learning part.

    You mean to relearn an existing profile? I could likely do that. Maybe 0.4.2, if I have time. Otherwise 0.4.x (sometime in the future).

    Mr. Mitchell said:
    - It would be nice to have an indication on the test page everytime a command is received. My remote has a repeat and when watching the command on the Test page I don't see if the repeats are received. Maybe a "light" that blinks on each received command?

    I'm not positive I understand what you mean, but I think I do. I will put something in 0.4.2; let me know if it is what you meant.

    Mr. Mitchell said:
    - When I press PageUp no key is recognised, but when I press PageDown then I get {PGUP} all other keys seem to work fine.

    Sorry. Your fix is correct. I will correct the bug in 0.4.2.

    Mr. Mitchell said:
    - When I click on the Configure plugins button I don't see my deviceplugin listed. It implements the IInputDevicePlugin interface, but the header "Check the device plugins you want to enabled" suggests that all deviceplugins should be listed and not only the ones that have a configuration.

    The plugin has to implement IConfigurableInputDevicePlugin to show up in the list. I debated whether or not all plugins should show up, but decided to let some be hidden. I will think about this some more.

    0.4.2 will hopefully be out tomorrow (2005-03-29), assuming I'm not too busy (I should have time). I will post when it is up.
     

    Mr.Mitchell

    Retired Team Member
  • Premium Supporter
  • May 13, 2004
    227
    0
    the Netherlands
    kaburke said:
    Mr. Mitchell said:
    Code:
    ************** Exception Text **************
    System.Runtime.InteropServices.SEHException: External component has thrown an exception.
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       ...

    It looks like something in your code, though I can't think of what. If you could tell me where to get a copy of your source, I would certainly be willing to take a look and figure out how my code is misbehaving in relation to yours (though I don't have an X10 device).
    I will send you the code. It is probably something silly since I am quite new to C#/.NET programming. BTW, I noticed that the exception does not occur when I have the Test tab visible, then I see the keys appearing, but when I switch back to the Commands tab and press a key I get the exception again.

    Mr. Mitchell said:
    - It would be nice to have a way to "import" all the keys that are used in keymap.xml in one go. Right now I added the keys manually and I forgot a few. It would be nice if I could just press "Get keys from Keymap.xml" and then the keys list would be filled automatically.
    What type of file is keymap.xml? Is it one of the configuration files that InputDeviceMapper generates?
    Keymap.xml is the file where the keymappings for MP are stored. You can find it in your mediaportal folder. Right now I have to enter all keys by hand, so I have to add all keys that are used by MP manually so y, b, ESC etc.. one by one. All keys that are mapped in MP are already available in the keymap.xml file so it would be easy to just import/load that list by click on a button.

    Mr. Mitchell said:
    - Make Space display as {SPACE} it is really hard to see if you have pressed space when adding keys to the list in the wizard.
    Good idea. Did your fix work (i.e., did a SPACE get sent to the application?)? {SPACE} is not listed as a supported code in the SendKeys() description. Irrespective, I will add said functionality in 0.4.2 (in a manner that works, of course).
    Ok, I am feeling very stupid now. I only checked if everything showed up while learning I didn't test pause in MP and indeed it does not work. :oops:

    Mr. Mitchell said:
    - It would be nice to have an indication on the test page everytime a command is received. My remote has a repeat and when watching the command on the Test page I don't see if the repeats are received. Maybe a "light" that blinks on each received command?
    I'm not positive I understand what you mean, but I think I do. I will put something in 0.4.2; let me know if it is what you meant.
    My issue is that when I press the same key twice I can not see that there was a second command/keypress, because the text stays the same.

    The plugin has to implement IConfigurableInputDevicePlugin to show up in the list. I debated whether or not all plugins should show up, but decided to let some be hidden. I will think about this some more.
    k, I will see what comes out.
     

    Users who are viewing this thread

    Top Bottom