Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
libvncserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rasky
libvncserver
Commits
5092a3b5
Commit
5092a3b5
authored
Oct 10, 2006
by
dscho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
VisualNaCro: add --compact and --compact-dragging
parent
4af738e0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
9 deletions
+40
-9
ChangeLog
VisualNaCro/ChangeLog
+8
-0
recorder.pl
VisualNaCro/recorder.pl
+32
-9
No files found.
VisualNaCro/ChangeLog
View file @
5092a3b5
2006-10-10: Johannes Schindelin <Johannes.Schindelin@gmx.de>
* implement --compact and --compact-dragging to shut up the
script about mouse movements or drags.
2006-09-12: Johannes Schindelin <Johannes.Schindelin@gmx.de>
* the reference rectangle is selected with a rubber band,
and can be shown with 'd'.
2006-06-15: Johannes Schindelin <Johannes.Schindelin@gmx.de>
* added timing: you can record the events with their timestamps now
...
...
VisualNaCro/recorder.pl
View file @
5092a3b5
...
...
@@ -3,22 +3,24 @@
use
Getopt::
Long
;
use
nacro
;
# TODO: take options
$output
=
"my_script"
;
$server
=
"localhost"
;
$port
=
5900
;
$listen_port
=
5923
;
$timing
=
0
;
$symbolic
=
0
;
$compact
=
0
;
$compact_dragging
=
0
;
if
(
!
GetOptions
(
"script:s"
=>
\
$output
,
"listen:i"
=>
\
$listen_port
,
"timing"
=>
\
$timing
,
"symbolic"
=>
\
$symbolic
,
"compact"
=>
\
$compact
,
"compact-dragging"
=>
\
$compact_dragging
,
)
||
$#ARGV
!=
0
)
{
print
STDERR
"Usage: $ARGV0 [--script output_name] [--listen listen_port] [--timing]
[--symbolic
] server[:port]\n"
;
print
STDERR
"Usage: $ARGV0 [--script output_name] [--listen listen_port] [--timing]
\n\t[--symbolic] [--compact] [--compact-dragging
] server[:port]\n"
;
exit
2
;
}
...
...
@@ -91,6 +93,21 @@ sub writetiming () {
}
}
$last_button
=
-
1
;
sub
handle_mouse
{
my
$x
=
shift
;
my
$y
=
shift
;
my
$buttons
=
shift
;
if
(
nacro::
sendmouse
(
$vnc
,
$x
,
$y
,
$buttons
))
{
$x
-=
$x_origin
;
$y
-=
$y_origin
;
writetiming
();
print
OUT
"nacro::sendmouse(\$vnc,\$x_origin"
.
(
$x
>=
0
?
"+"
:
""
)
.
"$x,\$y_origin"
.
(
$y
>=
0
?
"+"
:
""
)
.
"$y,$buttons);\n"
;
}
}
while
(
1
)
{
$result
=
nacro::
waitforinput
(
$vnc
,
999999
);
if
(
$result
==
0
)
{
...
...
@@ -129,13 +146,18 @@ while(1) {
$x
=
nacro::
getx
(
$vnc
);
$y
=
nacro::
gety
(
$vnc
);
$buttons
=
nacro::
getbuttons
(
$vnc
);
if
(
nacro::
sendmouse
(
$vnc
,
$x
,
$y
,
$buttons
))
{
$x
-=
$x_origin
;
$y
-=
$y_origin
;
writetiming
();
print
OUT
"nacro::sendmouse(\$vnc,\$x_origin"
.
(
$x
>=
0
?
"+"
:
""
)
.
"$x,\$y_origin"
.
(
$y
>=
0
?
"+"
:
""
)
.
"$y,$buttons);\n"
;
if
(
$buttons
!=
$last_buttons
)
{
if
(
!
$buttons
&&
$compact_dragging
)
{
handle_mouse
(
$x
,
$y
,
$last_buttons
);
}
$last_buttons
=
$buttons
;
}
else
{
if
((
$buttons
&&
$compact_dragging
)
||
(
!
$buttons
&&
$compact
))
{
next
;
}
}
handle_mouse
(
$x
,
$y
,
$buttons
);
}
if
(
$result
&
$
nacro::
RESULT_TEXT_CLIENT
)
{
my
$text
=
nacro::
gettext_client
(
$vnc
);
...
...
@@ -188,6 +210,7 @@ while(1) {
$x
=
nacro::
getx
(
$vnc
);
$y
=
nacro::
gety
(
$vnc
);
if
(
$start_x
==
$x
&&
$start_y
==
$y
)
{
# reset
print
OUT
"\$x_origin=0; \$y_origin=0;\n"
;
}
else
{
if
(
$start_x
>
$x
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment