Hi.
I have a few comments.
Someone asked for a mouse recorder in the ask for help section, so I tried to make a simple one.
My idea was, to save the delta info, eg,
dx,dy, and then playback is simply
MouseMove,dx,dy,0,R.
I realised quite quickly, that if you have any mouse acceleration or sensitivity settings on the mouse, the delta info doesn't match the mouse cursor, this is of course as (should be) expected, I felt stupid.
However, when I disabled these settings, to verify that my mouse recorder worked, in principle at least, I found that still some delta info seemed to be lost.
Since, messages under
0x312 aren't buffered, I figuered some got lost, and tried, as recommended in the docs, to use
Critical, 30, it seemed to help a little, but still some info was lost.
Finally, I found, and I think this could be useful for others, that I could change the so called
polling rate of my mouse, this was set to
1000 hz, I guess I at some point figured, more is more.
If I set this to
125 hz, nothing is lost, it seems like this guards the (maximum) frequency at which the message
0xFF will be posted.
Another, small thing to, note, if either of the axes doesn't change, its delta value is blank (eg,
dx:=""), rather than
0.
Maybe I am missing something, but I never see
__Delete() being called, to remedy, I changed and added:
Code: Select all
__new(){
;[...]
this.fn := this.MouseMoved.Bind(this) ; Monitor function.
this.start() ; To preserve original behaviour
}
start()
{
OnMessage(0x00FF, this.fn) ; Start monitor msg
return
}
stop()
{
OnMessage(0x00FF, this.fn, 0) ; Stop monitor msg
return
}
clear()
{
this.stop()
this.fn:="" ; Needs to be cleared before __Delete() can be called
this.TimeoutFn:=""
return
}
Then one should save a reference to the instance, eg
Code: Select all
md:= new MouseDelta("f")
; do stuff
; Now I'm done
md.clear()
md:="" ; Now __Delete() will be called
And finally, I figured that UCR would use this code for the
InputDelta, although I couldn't find the code. However, whatever settings I use for my mouse, when doing the mouse recording using
InputDelta in UCR, a lot of delta info is lost. Couldn't get it working. I set it up like
Code: Select all
init()
{
;...
this.AddControl("InputDelta", "mouse", 0, this.MouseEvent.Bind(this))
;...
}
MouseEvent(e)
{
if !this.recording
return
dx:=e.axes.x
dy:=e.axes.y
; save dx dy and stuff
}
I pasted the
MouseDelta class in a UCR plugin and did the exact same thing with the delta info from
MouseDelta as with the delta info from
InputDelta,
MouseDelta records perfectly,
InputDelta fails with good margin.
Is it possible to stop the
InputDelta from gathering info when not needed, besides from using
Clear in its menu? It seems to be making UCR somewhat unresponsive when on.
Sorry for the long post. Cheers!