keystroker 0.1.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/keystroker.rb +41 -2
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b75f8b6a694515e3f2f8a6c91a293eb8370cbf5ddfc1ac025107eca7096bd604
|
|
4
|
+
data.tar.gz: '098df3f61a7abc1872e7acace5b67cf5bab80db77dc444248e114ab44e31f25b'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 23e23faca9095d11545b7c31155e6872559ff38ac22a1feac6a15faaa5e74f1e170c919aaf88383328147eced0b15b2f86f4044361c28764164ba51eb18ad062
|
|
7
|
+
data.tar.gz: 71e575431a3b9d8e9de9758a7c1956b9c5a3e6a4db1c1d6b25aae7c449a85034fd92de0ad9d8177a243b6b678a7994f4875bc25e3ffff19d27822ae28763c64c
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data.tar.gz.sig
CHANGED
|
Binary file
|
data/lib/keystroker.rb
CHANGED
|
@@ -19,10 +19,15 @@ require 'rexle-builder'
|
|
|
19
19
|
class Keystroker
|
|
20
20
|
using ColouredText
|
|
21
21
|
|
|
22
|
-
def initialize(debug: false)
|
|
22
|
+
def initialize(kbml='<kbml/>', debug: false)
|
|
23
|
+
|
|
23
24
|
@debug = debug
|
|
25
|
+
|
|
26
|
+
if kbml then
|
|
27
|
+
@doc = Rexle.new(RXFHelper.read(kbml).first)
|
|
28
|
+
end
|
|
24
29
|
end
|
|
25
|
-
|
|
30
|
+
|
|
26
31
|
def parse_hg0(s)
|
|
27
32
|
|
|
28
33
|
xml = RexleBuilder.new
|
|
@@ -72,6 +77,40 @@ class Keystroker
|
|
|
72
77
|
@doc = Rexle.new(a3)
|
|
73
78
|
|
|
74
79
|
end
|
|
80
|
+
|
|
81
|
+
def to_au3()
|
|
82
|
+
|
|
83
|
+
a = []
|
|
84
|
+
|
|
85
|
+
@doc.root.each_recursive do |x|
|
|
86
|
+
|
|
87
|
+
next unless x
|
|
88
|
+
|
|
89
|
+
if x.name == 'type' then
|
|
90
|
+
a << ''
|
|
91
|
+
a << %Q{Send("%s")} % x.text
|
|
92
|
+
else
|
|
93
|
+
|
|
94
|
+
modifiers = {ctrl: '^', shift: '+', alt: '!', win: '#'}
|
|
95
|
+
|
|
96
|
+
instruction = if modifiers[x.name.to_sym] then
|
|
97
|
+
modifiers[x.name.to_sym]
|
|
98
|
+
else
|
|
99
|
+
"{%s}" % x.name.upcase
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
if x.attributes[:key] then
|
|
103
|
+
instruction += '' + x.attributes[:key] + ''
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
a << %Q{Send("%s")} % instruction
|
|
107
|
+
a << '' if x.name == 'enter'
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
puts a.join("\n")
|
|
113
|
+
end
|
|
75
114
|
|
|
76
115
|
def to_hg0()
|
|
77
116
|
|
metadata
CHANGED
metadata.gz.sig
CHANGED
|
Binary file
|