So, u need to get the mouse back to react to u. You say that the release function doesn't works or return's errors in ruby console? If thats what you mean, then here is how to get it back to work:
First when calling the release function(http://msdn.microsoft.com/en-us/library/ms646261(v=VS.85).aspx) You should avoid extra parameters. The script says:
@unknownuser said:
- release mouse
releaseCapture = Win32API.new('user32', 'ReleaseCapture', 'L', 'L') releaseCapture.call()
The underlined "L", which represent's the number, says that while calling that function you need to add a required parameter>>, but there is nothing required. So you need to change that first "L" to "V", which is void. And then it won't require you any parameters, even though this function still doesn't has any required parameters.
The reason Win32API was written like that >> there would be a plenty of ways to call the function, and so the user could know in what form the function is required and return its objectives.
The second "L" is now the user's idea to choose the function's returning mode. Ex: putting "V" would make the function to return nothing.
In my way the function should sound like that:
releaseCapture = Win32API.new('user32', 'ReleaseCapture', 'V', 'L') releaseCapture.call()
Then it will work - I even checked it. The mouse was captured and then released. Ex:
` ontick{
if frame==10
model=Sketchup.active_model
entities=model.entities
view=model.active_view
getForegroundWindow = Win32API.new('user32', 'GetForegroundWindow', [], 'L')
window_handle = getForegroundWindow.Call()
setCapture = Win32API.new('user32', 'SetCapture', 'L', 'L')
setCapture.call(window_handle)
end
if frame==200
releaseCapture = Win32API.new('user32', 'ReleaseCapture', 'V', 'L')
releaseCapture.call()
end
}`
Here's the URL what explains some of that: http://phrogz.net/ProgrammingRuby/lib_windows.html#Win32API
And Here's the windows API reference: http://msdn.microsoft.com/en-us/library/aa383749(VS.85).aspx
If that was not what u wanted then PLEASE make it more clear!!! - My dad is really good at win32API stuff. He's Smart >>
Thanks for asking!!!