forked from iberianpig/xSwipe
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrubySwipeActions.pl
40 lines (38 loc) · 1.25 KB
/
rubySwipeActions.pl
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
#!/usr/bin/perl
######################################################################
# # # # # ##### # # # #### ##### #
# # # # # # # # # # # # # # #
# # # # ### #### # # # # #### ### #
# # # # # # # # # # # # # #
# ## # # ##### # # # # ##### #
######################################################################
use strict;
use Time::HiRes();
use X11::GUITest qw( :ALL );
while (<>) {
chomp($_);
my ($kind, $action) = split "/", $_;
if ($kind eq "SendKeys") {
SendKeys($action);
} elsif ($kind eq "PressKey") {
PressKey($action);
} elsif ($kind eq "ReleaseKey") {
ReleaseKey($action);
} elsif ($kind eq "PressMouseButton") {
if ($action eq "MLEFT") {
PressMouseButton(M_LEFT);
} elsif ($action eq "MRIGHT") {
PressMouseButton(M_RIGHT);
} elsif ($action eq "MCENTER") {
PressMouseButton(M_MIDDLE);
}
} elsif ($kind eq "ReleaseMouseButton") {
if ($action eq "MLEFT") {
ReleaseMouseButton(M_LEFT);
} elsif ($action eq "MRIGHT") {
ReleaseMouseButton(M_RIGHT);
} elsif ($action eq "MCENTER") {
ReleaseMouseButton(M_MIDDLE);
}
}
}