MBS Computer Control Plugin problems

First I need to say that I am not a novice at programming, but I am almost a new user of XOJO.

Here is the problem:

I am using the MBS Computer Control plugin to be able to have the mouse click from the code. This have been working perfect in my previous projects.
For this project I need to have the mouse click outside of the program, and a key press on the keyboard will make that click happen.

I use a timer to read the key press, like this:

'------ Keyboard KEY PRESS ACTIONS
If Keyboard.AsyncKeyDown(&h33) = True Then

…and with a label.text = label.text + “1” code as a test function only to see if the key press is working, and it is!
Every time I press the backspace button on the keyboard, one more “1” is added to the label.

The problem shows when I use the method “MouseDown” of the MBS Computer Control Plugin.
I have correctly set up a timer for the “MouseUp” Method, and I correctly use the “MouseDown” Method too, exactly
as I did in my earlier projects that worked fine.

The strange thing is that the mouse keep on clicking like I was hitting the backspace key repeatedly , and it also keep adding “1” to the label.text???
If I remove the MouseDown and MouseUp parts from the timer that is reading the key press, the “1” is only added
once per key press… WHY???

Is this an error in the plugin code?

Here is the code in the timer for the key press:

'------ Keyboard KEY PRESS ACTIONS
If Keyboard.AsyncKeyDown(&h33) = True Then
Timer_RECORD.Period = 300 'wait to not repeat keypress
Timer_RECORD.Mode = 1 'once
MouseDown ’ This is the MethodCall to the MBS Computer Control Plugin
Timer_REC_MouseUP.Mode = 1 'This sets the timer to have the MBS “MouseUp” happen once
LBL_REC_LastClickTime.Text = LBL_REC_LastClickTime.Text + “1” 'This is the control text that is added with every key press (backspace)
Else
Timer_RECORD.Period = 1 ’ Sets the period to “1” after the wait state of 300ms.
Timer_RECORD.Mode = 1
End

Thank you all in advance! This is driving me crazy!!

I’m still not sure if I get the problem.
Do you see two 1 added to the text if you do a mouse click?

Ok, I will try to explain better.

What I want:
When a key on the keyboard is pressed (backspace in this case for testing), a mouse click should fire. This to be able to both record the time of the click (that will happen outside of the window of the program), and click (also outside of the program window).

Now, with this code below everything is working perfect, as a test I can see the number “1” get added every time I press the backspace key on the keyboard.

Working code (without the MouseDown/MouseUp Method call):

If Keyboard.AsyncKeyDown(&h33) Then
Timer_RECORD.Period = 300
Timer_RECORD.Mode = 1
LBL_REC_LastClickTime.Text = LBL_REC_LastClickTime.Text + “1”
Else
Timer_RECORD.Period = 1
Timer_RECORD.Mode = 1
End

The code above will detect the backspace key press and as a test for me add a “1” for each time I press the backspace keyboard key. No problem at all here!

BUT with this code below:
If Keyboard.AsyncKeyDown(&h33) Then
MouseDown
Timer_RECORD.Period = 300
Timer_RECORD.Mode = 1
Timer_REC_MouseUP.Mode = 1
LBL_REC_LastClickTime.Text = LBL_REC_LastClickTime.Text + “1”
Else
Timer_RECORD.Period = 1
Timer_RECORD.Mode = 1
End

…suddenly, after one press on the backspace button on the keyboard, the nr. “1” is added repeatedly, without me pressing the backspace key on the keyboard???

It is almost like the MBS Computer Plugin presses the backspace key by it self.

MouseDown and the Timer_REC_MouseUp timer does not do anything to the timer where the above code is. No other timer or part of my program contain any actions etc to control this.

So, how is it possible that the backspace key suddenly gets pressed as soon as I call the MouseDown/MouseUp plugin method?

Oh, those “1” is only for testing, for me to see that the key press is actually working.

After one key press (backspace), the number “1” is added repeatedly, just like the MBS computer control plugin is pressing the backspace key by it self, repeatedly.

This is so strange…

Oh, I forgot, the mouse is also clicking repeatedly, just like the “1” is added over and over again…

This is the Mouse up timer code:

MouseUp
Timer_REC_MouseUP.Mode = 0

I hope for help about this, and if it is a bug I hope that this will be taken care of!

Below I also post the code within the Methods for the MouseDown and MouseUp, and it is exactly the MBS example code.

Code for method “MouseDown”:

dim x,y as integer

x=System.mousex
y=system.mousey

if targetwin32 then
call remoteControlMBS.winmouseClick x,y,true,true
elseif targetmachO then
call remoteControlMBS.MacMouseClick x,y, true, true
elseif targetlinux then
call remoteControlMBS.linuxMouseClick(1,true)
else
msgBox “not supported”
end if

Code for the method “MouseUp”:

dim x,y as integer

x=System.mousex
y=system.mousey

if targetwin32 then
call remoteControlMBS.winmouseClick x,y,true,false
elseif targetmachO then
call remoteControlMBS.MacMouseClick x,y, true, false
elseif targetlinux then
call remoteControlMBS.linuxMouseClick(1,false)
else
msgBox “not supported”
end if

Please help!
Thanks.