New Versions of InputDeviceMapper of LiveDriveIR (1 Viewer)

M

MaceX

Guest
kaburke said:
Sorry I didn't reply sooner - I was busy this weekend and didn't get a chance to watch the posts.

MaceX said:
When I go to learn a command and press a button on my remote and then press a different button on the remote an exception is raised.

When are you pushing the buttons? Are you pushing them both while the "Learn Command" window is showing?

I don't know why this could be happening (though it would help to have more information about the details, such as answers the the above questions). Unfortunely I don't have a USB IR dongle to try it out, but I will look at your source code and see if I can figure out how my code is misbehaving in relation to it.

When the Learn Command window is open I will press a button on my remote. Now the Edit Mapping window appears. If I press a different button on my remote, the Code: field on the Edit Mapping window changes to the new code that was pressed on my remote, and an exception occurs. The InputDeviceMapper is still listening for commands when the Edit Mapping window is open. I don't think it should do that.

kaburke said:
MaceX said:
Also if I learn a command and press the same button twice I get this message.

'40320' is the code for the button I pressed and it's not assigned to any command.

I'm not sure what you mean by "press the same button twice." Are you pushing the button twice while the "Learn Command" window is showing, or after it closes?

Just like above I press the button on the remote when the Learn Command window is visible and then press that same button when the Edit Mapping window is shown.
 
M

MaceX

Guest
MaceX said:
kaburke said:
MaceX said:
The InputDeviceMapper is still listening for commands when the Edit Mapping window is open. I don't think it should do that.

You're right - it shouldn't be. Which version are you using?

.3

I just tested it again and I can't get it to cause an exception, but the "
"The code '40320' for plugin 'USBRemoteIR.USBRemoteIR' is already used by the '' command. " still occurs if I press the same button on the remote twice.
 

kaburke

Portal Pro
March 4, 2005
64
0
Alberta, Canada
It turns out my handle() method isn't thread safe - I thought it was.

I'll (at least attempt to) remedy this in v0.4. I would appreciate it, MaceX, if, when it does come out, you could give it a try to make sure I've fixed the problem.
 
M

MaceX

Guest
kaburke said:
It turns out my handle() method isn't thread safe - I thought it was.

I'll (at least attempt to) remedy this in v0.4. I would appreciate it, MaceX, if, when it does come out, you could give it a try to make sure I've fixed the problem.

Sure.

What I did to temporarily fix the problem was to change "if (m_dmsLearnedCodeCallbackObject != null)" in the handle method to
" if (m_dmsLearnedCodeCallbackObject != null && m_dmsLearnedCodeCallbackObject.m_mefEditForm.Visible == false)
"

probably not the best way though.
 

kaburke

Portal Pro
March 4, 2005
64
0
Alberta, Canada
Well, I was wrong. My method IS threadsafe (I thought so...).

The downside is that that means I have no idea how this problem is happening. As best as I can tell, your plugin somehow bypasses the lock() {} statement in my handle() method; unfortunately I don't know how.

Where can I pick up one of those dongles you have? I'm trying to simulate the behaviour of your plugin with some code, but it (obviously) isn't working, so it seems I'll need to use the real thing.
 
M

MaceX

Guest
kaburke said:
Well, I was wrong. My method IS threadsafe (I thought so...).

The downside is that that means I have no idea how this problem is happening. As best as I can tell, your plugin somehow bypasses the lock() {} statement in my handle() method; unfortunately I don't know how.

Where can I pick up one of those dongles you have? I'm trying to simulate the behaviour of your plugin with some code, but it (obviously) isn't working, so it seems I'll need to use the real thing.

Maybe it's bypassing your lock because I'm using an unsafe code block?

I don't see why you would need the real thing. You could probably simulate the bug using WM_KEYDOWN? The dongle came with my capture card, so obtaining it would be kinda difficult and I don't know any other remotes that would work with my plugin. Maybe the MCE remote?

This is what I used to obtain data from my remote http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwmt/html/remote_control.asp
 
M

MaceX

Guest
I just tested it using a WM_KEYDOWN message with and without unsafe code blocks and I got the same message.


"The code 'xxx' for plugin 'USBRemoteIR.USBRemoteIR' is already used by the '' command.

xxx being the code

I think I got the exception because I had some invalid setting in the configuration file.
 

kaburke

Portal Pro
March 4, 2005
64
0
Alberta, Canada
I tried the WM_KEYDOWN message. Unfortunately, the Mapping Edit Form needs to be in dialog mode for the problem to present itself - and if it's in dialog mode, your plugin doesn't receive any WM_KEYDOWN messages.

I'm trying to modify your plugin you "listen" to my gamepad instead - hopefully I'll get it to work.
 

Users who are viewing this thread

Top Bottom