mouse 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/History.markdown +4 -0
- data/ext/mouse/extconf.rb +2 -1
- data/ext/mouse/mouser.c +55 -3
- data/ext/mouse/mouser.h +18 -0
- data/lib/mouse/version.rb +1 -1
- metadata +4 -4
data/History.markdown
CHANGED
data/ext/mouse/extconf.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
require 'mkmf'
|
2
2
|
|
3
3
|
$CFLAGS << ' -std=c99 -Wall -Werror -pedantic'
|
4
|
-
$LIBS << ' -framework Foundation -framework ApplicationServices
|
4
|
+
$LIBS << ' -framework Foundation -framework ApplicationServices'
|
5
|
+
$LIBS << ' -framework CoreGraphics' unless `sw_vers -productVersion`.to_f == 10.7
|
5
6
|
|
6
7
|
if RUBY_ENGINE == 'macruby'
|
7
8
|
$LIBS << ' -framework Cocoa'
|
data/ext/mouse/mouser.c
CHANGED
@@ -9,9 +9,10 @@
|
|
9
9
|
#include <ApplicationServices/ApplicationServices.h>
|
10
10
|
#include "mouser.h"
|
11
11
|
|
12
|
-
static const uint_t FPS
|
13
|
-
static const uint_t QUANTUM
|
14
|
-
static const double DEFAULT_DURATION
|
12
|
+
static const uint_t FPS = 240;
|
13
|
+
static const uint_t QUANTUM = 1000000 / 240; // should be FPS, but GCC sucks
|
14
|
+
static const double DEFAULT_DURATION = 0.2; // seconds
|
15
|
+
static const double DEFAULT_MAGNIFICATION = 2.0; // factor
|
15
16
|
|
16
17
|
#define NEW_EVENT(type,point,button) CGEventCreateMouseEvent(nil,type,point,button)
|
17
18
|
#define POST(event) CGEventPost(kCGHIDEventTap, event)
|
@@ -346,3 +347,54 @@ mouse_triple_click()
|
|
346
347
|
{
|
347
348
|
mouse_triple_click2(mouse_current_position());
|
348
349
|
}
|
350
|
+
|
351
|
+
void
|
352
|
+
mouse_smart_magnify2(CGPoint point)
|
353
|
+
{
|
354
|
+
}
|
355
|
+
|
356
|
+
void
|
357
|
+
mouse_smart_magnify()
|
358
|
+
{
|
359
|
+
mouse_smart_magnify2(mouse_current_position());
|
360
|
+
}
|
361
|
+
|
362
|
+
void
|
363
|
+
mouse_swipe2(int direction, double duration)
|
364
|
+
{
|
365
|
+
}
|
366
|
+
|
367
|
+
void
|
368
|
+
mouse_swipe(int direction)
|
369
|
+
{
|
370
|
+
mouse_swipe2(direction, DEFAULT_DURATION);
|
371
|
+
}
|
372
|
+
|
373
|
+
void
|
374
|
+
mouse_pinch3(int direction, double magnification, double duration)
|
375
|
+
{
|
376
|
+
}
|
377
|
+
|
378
|
+
void
|
379
|
+
mouse_pinch2(int direction, double magnification)
|
380
|
+
{
|
381
|
+
mouse_pinch3(direction, magnification, DEFAULT_DURATION);
|
382
|
+
}
|
383
|
+
|
384
|
+
void
|
385
|
+
mouse_pinch(int direction)
|
386
|
+
{
|
387
|
+
mouse_pinch2(direction, DEFAULT_MAGNIFICATION);
|
388
|
+
}
|
389
|
+
|
390
|
+
void
|
391
|
+
mouse_rotate2(int direction, double angle, double duration)
|
392
|
+
{
|
393
|
+
}
|
394
|
+
|
395
|
+
void
|
396
|
+
mouse_rotate(int direction, double angle)
|
397
|
+
{
|
398
|
+
mouse_rotate2(direction, angle, DEFAULT_DURATION);
|
399
|
+
}
|
400
|
+
|
data/ext/mouse/mouser.h
CHANGED
@@ -22,6 +22,10 @@ void mouse_scroll(size_t amount);
|
|
22
22
|
void mouse_scroll2(size_t amount, CGScrollEventUnit units);
|
23
23
|
void mouse_scroll3(size_t amount, CGScrollEventUnit units, double duration);
|
24
24
|
|
25
|
+
void mouse_horizontal_scroll(size_t amount);
|
26
|
+
void mouse_horizontal_scroll2(size_t amount, CGScrollEventUnit units);
|
27
|
+
void mouse_horizontal_scroll3(size_t amount, CGScrollEventUnit units, double duration);
|
28
|
+
|
25
29
|
void mouse_click_down();
|
26
30
|
void mouse_click_down2(CGPoint point);
|
27
31
|
void mouse_click_down3(CGPoint point, uint_t sleep_quanta);
|
@@ -51,3 +55,17 @@ void mouse_double_click2(CGPoint point);
|
|
51
55
|
|
52
56
|
void mouse_triple_click();
|
53
57
|
void mouse_triple_click2(CGPoint point);
|
58
|
+
|
59
|
+
void mouse_smart_magnify();
|
60
|
+
void mouse_smart_magnify2(CGPoint point);
|
61
|
+
|
62
|
+
void mouse_swipe(int direction);
|
63
|
+
void mouse_swipe2(int direction, double duration);
|
64
|
+
|
65
|
+
void mouse_pinch(int direction);
|
66
|
+
void mouse_pinch2(int direction, double magnification);
|
67
|
+
void mouse_pinch3(int direction, double magnification, double duration);
|
68
|
+
|
69
|
+
void mouse_rotate(int direction, double angle);
|
70
|
+
void mouse_rotate2(int direction, double angle, double duration);
|
71
|
+
|
data/lib/mouse/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mouse
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-12-
|
12
|
+
date: 2012-12-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: yard
|
@@ -100,7 +100,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
100
100
|
version: '0'
|
101
101
|
segments:
|
102
102
|
- 0
|
103
|
-
hash:
|
103
|
+
hash: 3422448677829633630
|
104
104
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
105
105
|
none: false
|
106
106
|
requirements:
|
@@ -109,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
109
109
|
version: '0'
|
110
110
|
segments:
|
111
111
|
- 0
|
112
|
-
hash:
|
112
|
+
hash: 3422448677829633630
|
113
113
|
requirements: []
|
114
114
|
rubyforge_project:
|
115
115
|
rubygems_version: 1.8.24
|