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
5738e33f
Commit
5738e33f
authored
Oct 12, 2006
by
dscho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
VisualNaCro: add sendascii
parent
a5baf57b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
0 deletions
+42
-0
nacro.c
VisualNaCro/nacro.c
+41
-0
nacro.h
VisualNaCro/nacro.h
+1
-0
No files found.
VisualNaCro/nacro.c
View file @
5738e33f
...
...
@@ -717,6 +717,47 @@ bool_t sendkey(resource_t res,keysym_t keysym,bool_t keydown)
return
SendKeyEvent
(
r
->
client
,
keysym
,
keydown
);
}
bool_t
sendascii
(
resource_t
res
,
const
char
*
string
)
{
timeout_t
delay
=
0
.
1
;
private_resource_t
*
r
=
get_resource
(
res
);
int
i
;
if
(
r
==
NULL
)
return
0
;
while
(
*
string
)
{
int
keysym
=
*
string
;
int
need_shift
=
0
;
if
(
keysym
>=
8
&&
keysym
<
' '
)
keysym
+=
0xff00
;
else
if
(
keysym
>=
'A'
&&
keysym
<=
'Z'
)
need_shift
=
1
;
else
if
(
keysym
>
'~'
)
{
fprintf
(
stderr
,
"String contains non-ASCII "
"character 0x%02x
\n
"
,
*
string
);
return
FALSE
;
}
if
(
need_shift
)
{
if
(
!
SendKeyEvent
(
r
->
client
,
0xffe1
,
1
))
return
FALSE
;
waitforinput
(
r
,
delay
);
}
for
(
i
=
1
;
i
>=
0
;
i
--
)
{
if
(
!
SendKeyEvent
(
r
->
client
,
keysym
,
i
))
return
FALSE
;
waitforinput
(
r
,
delay
);
}
if
(
need_shift
)
{
if
(
!
SendKeyEvent
(
r
->
client
,
0xffe1
,
0
))
return
FALSE
;
waitforinput
(
r
,
delay
);
}
string
++
;
}
return
TRUE
;
}
bool_t
sendmouse
(
resource_t
res
,
coordinate_t
x
,
coordinate_t
y
,
buttons_t
buttons
)
{
private_resource_t
*
r
=
get_resource
(
res
);
...
...
VisualNaCro/nacro.h
View file @
5738e33f
...
...
@@ -94,6 +94,7 @@ const char *gettext_server(resource_t res);
/* send events to the server */
bool_t
sendkey
(
resource_t
res
,
keysym_t
keysym
,
bool_t
keydown
);
bool_t
sendascii
(
resource_t
res
,
const
char
*
string
);
bool_t
sendmouse
(
resource_t
res
,
coordinate_t
x
,
coordinate_t
y
,
buttons_t
buttons
);
bool_t
sendtext
(
resource_t
res
,
const
char
*
string
);
bool_t
sendtext_to_server
(
resource_t
res
,
const
char
*
string
);
...
...
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