Closed GoogleCodeExporter closed 9 years ago
Updated.
Original comment by vanhtu1...@gmail.com
on 29 Jan 2008 at 6:57
Attachments:
I'm gonna review your patches on weekend. I do not have enough time during work
days.
Thanks for your work and dedication.
Original comment by pere.ne...@gmail.com
on 29 Jan 2008 at 9:05
I've cleaned up all of the crufts from last attempts (even the hack with 100%
CPU
usage that allows right-clicking) in favor of threading, which is the proper
way to
do it, IMO.
MOUSE DOWN, MOUSE UP, MOUSE MOVE and MOUSE WAIT events are correctly detected
using
my simple algorithms. They have been unit tested (now have been removed as well,
along with the events stuff).
Each time there is a MOUSE DOWN event, a new thread is spawned into existence to
check for how long user has been holding the IR pen down. If true, a right click
event is fired. If the 'mouse' moves a certain distance, the effect is canceled
and
the thread is killed.
The same algorithm is used in calibration phase. But when putting inside a
thread,
for some unknown reason. The loop never got executed more than once.
When running under a debugger (gdb, I used cgdb), that same code executed fine.
Now
that I'd be gladly appreciated if anyone will point out my stupidity ;s .
I suspect that libcwiid somehow intervened with my thread code. I've written a
same
function (without classes and the actual Wii though) in a new test program. It
showed
no weird behavior.
My latest snapshot:
Original comment by vanhtu1...@gmail.com
on 29 Jan 2008 at 10:00
Attachments:
I rewrote the threading code with boost's threading library. The result was the
same:
the loop never got executed twice, which is not really surprising considering
that
boost is just a wrapper for pthread.
:( I'm gonna fix the jerky mouse motion first.
Original comment by vanhtu1...@gmail.com
on 31 Jan 2008 at 8:20
Problem solved :-) that was my fault.
Original comment by vanhtu1...@gmail.com
on 31 Jan 2008 at 9:43
Original comment by vanhtu1...@gmail.com
on 31 Jan 2008 at 9:47
Original issue reported on code.google.com by
vanhtu1...@gmail.com
on 29 Jan 2008 at 6:10Attachments: