auto_click 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: bb1c3b5d61b5f4998b061b364a3ec9d0aa64f129
4
+ data.tar.gz: d569868f75ee1de80a58679ab2bf434a47bae2ce
5
+ SHA512:
6
+ metadata.gz: 36dadba35007541fdb5acf1a4c84ca721bd44e6616919de3fe6344c43fcfb962bbbf60d9587e3665e5dde6e3816a63885efaeee1967fd7a74a863d59556eec96
7
+ data.tar.gz: 5472cf43025984ff588d58f1b63a576c40644cf3150aedcabed222b83356e0577e312557c068f55be4dca3b07faf6982a58abeb1769b380c111cdabc2630fe97
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ 0.2.0
2
+ bump verison
3
+
1
4
  0.1.15
2
5
  Add more general mouse control methods: mouse_down(button_name), mouse_up(button_name)
3
6
 
data/Gemfile CHANGED
@@ -2,3 +2,5 @@ source "http://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in auto_click.gemspec
4
4
  gemspec
5
+
6
+
@@ -19,7 +19,7 @@ To move the mouse cursor to 50,50 ( the top left corner is 0,0) and perform a do
19
19
  mouse_move(50,50)
20
20
  double_click
21
21
 
22
- To move the mouse cursor to 300,300 and perform a right click:
22
+ 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
@@ -32,7 +32,13 @@ To scroll down (backward) 5 wheel steps:
32
32
 
33
33
  mouse_scroll(-5)
34
34
 
35
+ To get the current cursor position
36
+
37
+ cursor_position
38
+
35
39
  To drag the icon on (50,50) to (200,300):
40
+
41
+
36
42
 
37
43
  left_drag(50,50,200,300)
38
44
 
data/Rakefile CHANGED
@@ -1,3 +1,6 @@
1
1
  #$:.unshift( File.dirname(__FILE__) )
2
2
  require 'bundler'
3
3
  Bundler::GemHelper.install_tasks #:name => 'auto_click'
4
+
5
+
6
+
@@ -1,17 +1,17 @@
1
- require 'dl/import'
1
+ require 'fiddle/import'
2
2
  require 'auto_click/input_structure'
3
3
  require 'auto_click/virtual_key'
4
4
  require 'auto_click/user32'
5
-
5
+
6
6
  module AutoClick
7
-
8
7
  @@rightdown = InputStructure.mouse_input(0,0,0,0x0008)
9
8
  @@rightup = InputStructure.mouse_input(0,0,0,0x0010)
10
9
  @@leftdown = InputStructure.mouse_input(0,0,0,0x0002)
11
10
  @@leftup = InputStructure.mouse_input(0,0,0,0x0004)
12
11
  @@middledown = InputStructure.mouse_input(0,0,0,0x0020)
13
12
  @@middleup = InputStructure.mouse_input(0,0,0,0x0040)
14
-
13
+
14
+
15
15
  def send_input(inputs)
16
16
  n = inputs.size
17
17
  ptr = inputs.collect {|i| i.to_s}.join
@@ -96,6 +96,7 @@ module AutoClick
96
96
  send_input( [scroll])
97
97
  end
98
98
 
99
+
99
100
  def left_drag(sx,sy,ex,ey)
100
101
  mouse_move sx,sy
101
102
  sleep 0.1
@@ -18,5 +18,4 @@ module InputStructure
18
18
  ki.pack('LLLLLLL')
19
19
  end
20
20
 
21
-
22
21
  end
@@ -1,8 +1,8 @@
1
1
  module User32
2
- extend DL::Importer
2
+ extend Fiddle::Importer
3
3
  dlload 'user32'
4
4
  extern "int GetCursorPos(char*)"
5
5
  extern "int SetCursorPos(int,int)"
6
6
  extern "int SendInput(int,char*,int)"
7
7
  extern "int GetKeyState(int)"
8
- end
8
+ end
@@ -1,3 +1,3 @@
1
1
  module AutoClick
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
@@ -1,7 +1,7 @@
1
1
  module VirtualKey
2
2
  def self.code_from_name(name)
3
-
4
- if name.kind_of? Fixnum
3
+
4
+ if name.kind_of? Fixnum!
5
5
  return name
6
6
  elsif name.kind_of? String
7
7
  name=name.delete('_').delete('-').delete(' ')
metadata CHANGED
@@ -1,18 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: auto_click
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
5
- prerelease: !!null
4
+ version: 0.3.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - erinata
9
- autorequire: !!null
8
+ autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2011-02-05 00:00:00.000000000 -06:00
13
- default_executable: !!null
11
+ date: 2017-06-03 00:00:00.000000000 Z
14
12
  dependencies: []
15
- description: ! "Provide several Ruby methods for simulating mouse click, cursor movement
13
+ description: "Provide several Ruby methods for simulating mouse click, cursor movement
16
14
  and keystrokes in Windows. \n This gem use DL library and SendInput
17
15
  method so there is no dependency on FFI, AutoIt or Win32-api. \n Methods
18
16
  include mouse_move(x,y), left_click, right_click, type(string), mouse_scroll(steps),
@@ -25,7 +23,7 @@ executables: []
25
23
  extensions: []
26
24
  extra_rdoc_files: []
27
25
  files:
28
- - .gitignore
26
+ - ".gitignore"
29
27
  - CHANGELOG
30
28
  - Gemfile
31
29
  - Gemfile.lock
@@ -37,29 +35,27 @@ files:
37
35
  - lib/auto_click/user32.rb
38
36
  - lib/auto_click/version.rb
39
37
  - lib/auto_click/virtual_key.rb
40
- has_rdoc: true
41
38
  homepage: https://github.com/erinata/auto_click
42
39
  licenses: []
43
- post_install_message: !!null
40
+ metadata: {}
41
+ post_install_message:
44
42
  rdoc_options: []
45
43
  require_paths:
46
44
  - lib
47
45
  required_ruby_version: !ruby/object:Gem::Requirement
48
- none: false
49
46
  requirements:
50
- - - ! '>='
47
+ - - ">="
51
48
  - !ruby/object:Gem::Version
52
49
  version: 1.9.0
53
50
  required_rubygems_version: !ruby/object:Gem::Requirement
54
- none: false
55
51
  requirements:
56
- - - ! '>='
52
+ - - ">="
57
53
  - !ruby/object:Gem::Version
58
54
  version: '0'
59
55
  requirements: []
60
- rubyforge_project: !!null
61
- rubygems_version: 1.5.0
62
- signing_key: !!null
63
- specification_version: 3
56
+ rubyforge_project:
57
+ rubygems_version: 2.6.8
58
+ signing_key:
59
+ specification_version: 4
64
60
  summary: Smulating mouse click, cursor movement and keystrokes
65
61
  test_files: []