Since hard-coding anything in the code is inflexible and cumbersome for
more than one scheme. I propose using a config file to define how it works.
Here is an example:
[scheme 1]
move_tolerance 50
wait_tolerance 500
ir_on,ir_off mouse_down,mouse_up
ir_on,move,ir_off mouse_down,move,mouse_up
This is how it works currently: when user turns the IR on, it simulates a
mouse_down event. If the IR moves without being turned off: it also moves
the cursor, which simulates a click-and-drag event.
The move_tolerance is for how long the IR moves from the first point of
contact (IR on) to consider it a 'move' event (because the IR is very
unstable). wait_tolerance is for how long the IR stands still (relatively
of course, within the boudary of move_tolerance) to consider it a 'wait'
event, which is used below.
[scheme 2]
ir_on,wait,ir_off mouse_2_down,mouse_2_up // the right button
ir_on,ir_off mouse_down,mouse_up // same as #1
ir_on,move,ir_off mouse_down,move,mouse_up
Once again, using C in this case makes the code significantly harder to
write and more error-prone. If I wouldn't receive any answer to my previous
statements about C++ from you, I would implement the next thing in C++ and
see how it goes.
I hope to finish a prototype soon.
Original issue reported on code.google.com by vanhtu1...@gmail.com on 26 Jan 2008 at 11:36
Original issue reported on code.google.com by
vanhtu1...@gmail.com
on 26 Jan 2008 at 11:36