auto_click 0.4.0 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG +5 -0
- data/README.rdoc +13 -20
- data/auto_click.gemspec +1 -1
- data/lib/auto_click.rb +30 -21
- data/lib/auto_click/user32.rb +1 -0
- data/lib/auto_click/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 47d56fa17310e18867a710aef8a980ffb8b58ac4a656e1abea7d5f8b26bbece7
|
4
|
+
data.tar.gz: c6bc2650e7f044871fb06b253bc09c6efe63709590bde4440511c30ac9291e5d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa65e21e050acd7df0a6b2e0dbd752c3c0ff71cc0192469fef623a2857dfd263b7052d72d7a436b1cb0db51bed7d79c9d493676c51b510e6a30f57960e8a8bb7
|
7
|
+
data.tar.gz: c5f66a8bd2dae391a48d33e5a1eb95d6612857329cfc6f8ba18919f498830ce5b2cddf9d77e1faa5af7ea39a65059ebcbf42c2c38849f87a30ce706b07969f7b
|
data/.gitignore
CHANGED
data/CHANGELOG
CHANGED
data/README.rdoc
CHANGED
@@ -23,6 +23,10 @@ To move the mouse cursor to 50,50 and perform a right click:
|
|
23
23
|
|
24
24
|
mouse_move(50,50)
|
25
25
|
right_click
|
26
|
+
|
27
|
+
To move the mouse cursor to the middle of the screen:
|
28
|
+
|
29
|
+
mouse_move_percentage(0.5,0.5)
|
26
30
|
|
27
31
|
To scroll up (forward) 10 wheel steps:
|
28
32
|
|
@@ -38,8 +42,6 @@ To get the current cursor position
|
|
38
42
|
|
39
43
|
To drag the icon on (50,50) to (200,300):
|
40
44
|
|
41
|
-
|
42
|
-
|
43
45
|
left_drag(50,50,200,300)
|
44
46
|
|
45
47
|
Suppose the notepad window on the top left corner of the screen, to type "Auto Click" in notepad. (Methods like get_windows("notepad") will be implemented in future release. So that you do not need to use this left click things to get focus on the notepad window......in later release......)
|
@@ -172,6 +174,8 @@ There are some methods which are not discussed here. Please see the following Me
|
|
172
174
|
|
173
175
|
- mouse_move(x,y)
|
174
176
|
|
177
|
+
- mouse_move_percentage(x_percent,y_percent)
|
178
|
+
|
175
179
|
- mouse_scroll(step)
|
176
180
|
|
177
181
|
- left_drag(x_start,y_start,x_end,y_end)
|
@@ -188,38 +192,27 @@ There are some methods which are not discussed here. Please see the following Me
|
|
188
192
|
|
189
193
|
== To Do List
|
190
194
|
|
195
|
+
- Backward compatibility with 32-bit ruby
|
196
|
+
|
191
197
|
- Add options of movement speed of mouse so the cursor is actually "moving" instead of just show up at the destination instantly
|
192
198
|
|
193
199
|
- GetWindow and GetWindowFocus Method
|
194
200
|
|
195
|
-
- Refactor the ugly type(string) method
|
201
|
+
- Refactor the ugly type(string) method
|
202
|
+
|
203
|
+
- Use code block to implement modifier keys
|
196
204
|
|
197
205
|
- More effective way to move mouse relative to current position
|
198
206
|
|
199
207
|
== Change log
|
200
208
|
(for full change log please refer to the CHANGELOG file in the repository)
|
201
209
|
|
210
|
+
- 0.4.3 Add mouse_move_percentage and get_screen_resolution
|
211
|
+
|
202
212
|
- 0.4.0 Fix the 64bit bug and Fixnum! bug
|
203
213
|
|
204
214
|
- 0.3.0 Update to use DL Library
|
205
215
|
|
206
|
-
- 0.2.0 bump verison
|
207
|
-
|
208
|
-
- 0.1.15 Add more general mouse control methods: mouse_down(button_name), mouse_up(button_name)
|
209
|
-
|
210
|
-
- 0.1.14 Add middle_click and double_click
|
211
|
-
|
212
|
-
- 0.1.12 Super ugly implementation of the method type (need refactoring or even rewite later)
|
213
|
-
|
214
|
-
- 0.1.10 Implement get_key_state method. Refine the key_stroke, key_down and key_up method
|
215
|
-
|
216
|
-
- 0.1.9 Add support for keybaord region specific keys using US-keyboard standard
|
217
|
-
|
218
|
-
- 0.1.8 Implement key_stroke, key_down and key_up
|
219
|
-
|
220
|
-
- 0.1.7 Primitive implementation of key_stroke. Need good api before putting it into method list
|
221
|
-
|
222
|
-
- 0.1.4 Implement left_drag and right_drag
|
223
216
|
|
224
217
|
== License
|
225
218
|
|
data/auto_click.gemspec
CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
|
|
16
16
|
See https://github.com/erinata/auto_click for more details about instalation and usage.
|
17
17
|
(More control over mouse movement such as speed or locus will be implemented in future releases)}
|
18
18
|
|
19
|
-
s.required_ruby_version = '>=
|
19
|
+
s.required_ruby_version = '>= 2.3.0'
|
20
20
|
|
21
21
|
s.files = `git ls-files`.split("\n")
|
22
22
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
data/lib/auto_click.rb
CHANGED
@@ -10,41 +10,50 @@ module AutoClick
|
|
10
10
|
@@leftup = InputStructure.mouse_input(0,0,0,0x0004)
|
11
11
|
@@middledown = InputStructure.mouse_input(0,0,0,0x0020)
|
12
12
|
@@middleup = InputStructure.mouse_input(0,0,0,0x0040)
|
13
|
-
|
14
|
-
|
13
|
+
|
14
|
+
|
15
15
|
def send_input(inputs)
|
16
16
|
n = inputs.size
|
17
17
|
ptr = inputs.collect {|i| i.to_s}.join
|
18
18
|
User32.SendInput(n, ptr, inputs[0].size)
|
19
19
|
end
|
20
20
|
|
21
|
+
def get_screen_resolution
|
22
|
+
[User32.GetSystemMetrics(0), User32.GetSystemMetrics(1)]
|
23
|
+
end
|
24
|
+
|
21
25
|
def mouse_move(x,y)
|
22
26
|
User32.SetCursorPos(x,y)
|
23
27
|
end
|
24
|
-
|
25
|
-
def
|
26
|
-
|
28
|
+
|
29
|
+
def mouse_move_percentage(x,y)
|
30
|
+
screen_resolution = get_screen_resolution()
|
31
|
+
User32.SetCursorPos(get_screen_resolution[0]*x,get_screen_resolution[1]*y)
|
27
32
|
end
|
28
33
|
|
29
|
-
def
|
30
|
-
|
31
|
-
|
32
|
-
end
|
34
|
+
# def mouse_move_pixel_absolute(x,y)
|
35
|
+
# User32.SetCursorPos(x,y)
|
36
|
+
# end
|
33
37
|
|
34
|
-
def
|
35
|
-
|
36
|
-
|
37
|
-
end
|
38
|
+
# def mouse_move_percentage_relative_virtual(x,y) # broken
|
39
|
+
# move = InputStructure.mouse_input(x,y,0,0x0001)
|
40
|
+
# send_input( [move])
|
41
|
+
# end
|
38
42
|
|
39
|
-
def
|
40
|
-
|
41
|
-
|
42
|
-
end
|
43
|
+
# def mouse_move_percentage_relative_real(x,y) # broken
|
44
|
+
# move = InputStructure.mouse_input(x,y,0,0x4001)
|
45
|
+
# send_input( [move])
|
46
|
+
# end
|
43
47
|
|
44
|
-
def
|
45
|
-
|
46
|
-
|
47
|
-
end
|
48
|
+
# def mouse_move_percentage_absolute_virtual(x,y)
|
49
|
+
# move = InputStructure.mouse_input(x*65536,y*65536,0,0xc001)
|
50
|
+
# send_input( [move])
|
51
|
+
# end
|
52
|
+
|
53
|
+
# def mouse_move_percentage_absolute_real(x,y)
|
54
|
+
# move = InputStructure.mouse_input(x*65536,y*65536,0,0x8001)
|
55
|
+
# send_input( [move])
|
56
|
+
# end
|
48
57
|
|
49
58
|
def right_click
|
50
59
|
send_input( [@@rightdown, @@rightup] )
|
data/lib/auto_click/user32.rb
CHANGED
data/lib/auto_click/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: auto_click
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- erinata
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: "Provide several Ruby methods for simulating mouse click, cursor movement
|
14
14
|
and keystrokes in Windows. \n This gem use DL library and SendInput
|
@@ -46,7 +46,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
46
46
|
requirements:
|
47
47
|
- - ">="
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version:
|
49
|
+
version: 2.3.0
|
50
50
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - ">="
|