Ejemplo n.º 1
0
/*
 * Move the mouse cursor to the given co-ordinates
 *
 * The default duration is 0.2 seconds.
 *
 * @overload move_to(point)
 *   @param point [CGPoint,Array(Number,Number),#to_point]
 *   @return [CGPoint]
 * @overload move_to(point, duration)
 *   @param point [CGPoint,Array(Number,Number),#to_point]
 *   @param duration [Number] animation time, in seconds
 *   @return [CGPoint]
 */
static
VALUE
rb_mouse_move_to(const int argc,
                 VALUE* const argv,
                 UNUSED const VALUE self)
{
    switch (argc) {
    case 0:
        rb_raise(rb_eArgError, "move_to requires at least a one arg");
    case 1:
        mouse_move_to(rb_mouse_unwrap_point(argv[0]));
        break;
    case 2:
    default:
        mouse_move_to2(rb_mouse_unwrap_point(argv[0]), NUM2DBL(argv[1]));
    }

    return CURRENT_POSITION;
}
Ejemplo n.º 2
0
void
mouse_move_to(CGPoint point)
{
  mouse_move_to2(point, DEFAULT_DURATION);
}