-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmod.js
62 lines (54 loc) · 1.43 KB
/
mod.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import {
f_s_version_node,
f_o_output_from_node_command,
f_a_n_u8__stdout__from_node_command,
f_s_from_node_command,
f_s_function_body
} from "https://deno.land/x/[email protected]/mod.js"
let a_s_name_prop = JSON.parse(
await f_s_from_node_command(
f_s_function_body(
()=>{
let o = require('robotjs');
console.log(JSON.stringify(Object.keys(o)))
}
)
)
)
console.log(a_s_name_prop)
let o_robot_js = {};
for(let s_prop of a_s_name_prop){
o_robot_js[s_prop] = async function(){
let s = await f_s_from_node_command(
`
let a_v_arg = [${
Array.from(arguments)
.map(v=>{
if(typeof v == 'string'){
return `'${v}'`
}
return v
})
.join(',')
}]
let o = require('robotjs');
console.log(JSON.stringify(o['${s_prop}'](...a_v_arg)))
`
)
return JSON.parse(s)
}
}
export {
o_robot_js
}
// window.setInterval(async function(){
// let o_trn_mouse = JSON.parse(
// await f_s_from_node_command(
// ()=>{
// let o = require('robotjs');
// console.log(JSON.stringify(o.getMousePos()))
// }
// )
// )
// console.log(o_trn_mouse)
// },100)