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
06af02b5
Commit
06af02b5
authored
Jul 04, 2006
by
runge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x11vnc: check all XKeysymToString() return values.
parent
93ca945a
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
21 deletions
+36
-21
README
x11vnc/README
+1
-1
keyboard.c
x11vnc/keyboard.c
+24
-11
pointer.c
x11vnc/pointer.c
+7
-5
xwrappers.c
x11vnc/xwrappers.c
+4
-4
No files found.
x11vnc/README
View file @
06af02b5
x11vnc
README
file
Date
:
Tue
Jul
4
1
8
:
26
:
52
EDT
2006
x11vnc
README
file
Date
:
Tue
Jul
4
1
9
:
28
:
31
EDT
2006
The
following
information
is
taken
from
these
URLs
:
...
...
x11vnc/keyboard.c
View file @
06af02b5
...
...
@@ -104,6 +104,7 @@ void clear_modifiers(int init) {
for
(
i
=
minkey
;
i
<=
maxkey
;
i
++
)
{
for
(
j
=
0
;
j
<
syms_per_keycode
;
j
++
)
{
char
*
str
;
keysym
=
keymap
[
(
i
-
minkey
)
*
syms_per_keycode
+
j
];
if
(
keysym
==
NoSymbol
||
!
ismodkey
(
keysym
))
{
continue
;
...
...
@@ -114,7 +115,9 @@ void clear_modifiers(int init) {
}
keycodes
[
kcount
]
=
keycode
;
keysyms
[
kcount
]
=
keysym
;
keystrs
[
kcount
]
=
strdup
(
XKeysymToString
(
keysym
));
str
=
XKeysymToString
(
keysym
);
if
(
!
str
)
str
=
"null"
;
keystrs
[
kcount
]
=
strdup
(
str
);
kcount
++
;
}
}
...
...
@@ -920,7 +923,7 @@ void switch_to_xkb_if_better(void) {
char
*
str
=
XKeysymToString
(
keysym
);
fprintf
(
stderr
,
"- high keysym mapping"
": at %3d j=%d "
"'%s'
\n
"
,
i
,
j
,
str
?
str
:
"null"
);
"'%s'
\n
"
,
i
,
j
,
str
?
str
:
"null"
);
}
}
continue
;
...
...
@@ -929,7 +932,7 @@ void switch_to_xkb_if_better(void) {
if
(
debug_keyboard
>
1
)
{
char
*
str
=
XKeysymToString
(
must
);
fprintf
(
stderr
,
"- at %3d j=%d found "
"'%s'
\n
"
,
i
,
j
,
str
?
str
:
"null"
);
"'%s'
\n
"
,
i
,
j
,
str
?
str
:
"null"
);
}
/* n.b. do not break, see syms_gt_4 above. */
gotit
=
1
;
...
...
@@ -1348,14 +1351,16 @@ xkbmodifiers[] For the KeySym bound to this (keycode,group,level) store
}
if
(
debug_keyboard
>
1
)
{
char
*
str
;
fprintf
(
stderr
,
" %03d G%d L%d mod=%s "
,
kc
,
grp
+
1
,
lvl
+
1
,
bitprint
(
ms
,
8
));
fprintf
(
stderr
,
"state=%s "
,
bitprint
(
xkbstate
[
kc
][
grp
][
lvl
],
8
));
fprintf
(
stderr
,
"ignore=%s "
,
bitprint
(
xkbignore
[
kc
][
grp
][
lvl
],
8
));
str
=
XKeysymToString
(
ks
);
fprintf
(
stderr
,
" ks=0x%08lx
\"
%s
\"\n
"
,
ks
,
XKeysymToString
(
ks
)
);
ks
,
str
?
str
:
"null"
);
}
}
}
...
...
@@ -1480,11 +1485,15 @@ static void xkb_tweak_keyboard(rfbBool down, rfbKeySym keysym,
state
=
xkbstate
[
kc
][
grp
][
lvl
];
if
(
debug_keyboard
>
1
)
{
char
*
s1
,
*
s2
;
s1
=
XKeysymToString
(
XKeycodeToKeysym
(
dpy
,
kc
,
0
));
if
(
!
s1
)
s1
=
"null"
;
s2
=
XKeysymToString
(
keysym
);
if
(
!
s2
)
s2
=
"null"
;
fprintf
(
stderr
,
" got match kc=%03d=0x%02x G%d"
" L%d ks=0x%x
\"
%s
\"
(basesym:
\"
%s
\"
)
\n
"
,
kc
,
kc
,
grp
+
1
,
lvl
+
1
,
keysym
,
XKeysymToString
(
keysym
),
XKeysymToString
(
XKeycodeToKeysym
(
dpy
,
kc
,
0
)));
kc
,
kc
,
grp
+
1
,
lvl
+
1
,
keysym
,
s2
,
s1
);
fprintf
(
stderr
,
" need state: %s
\n
"
,
bitprint
(
state
,
8
));
fprintf
(
stderr
,
" ignorable : %s
\n
"
,
...
...
@@ -2383,8 +2392,9 @@ static void modifier_tweak_keyboard(rfbBool down, rfbKeySym keysym,
}
if
(
debug_keyboard
)
{
char
*
str
=
XKeysymToString
(
keysym
);
rfbLog
(
"modifier_tweak_keyboard: KeySym 0x%x
\"
%s
\"
-> "
"KeyCode 0x%x%s
\n
"
,
(
int
)
keysym
,
XKeysymToString
(
keysym
)
,
"KeyCode 0x%x%s
\n
"
,
(
int
)
keysym
,
str
?
str
:
"null"
,
(
int
)
k
,
k
?
""
:
" *ignored*"
);
}
if
(
k
!=
NoSymbol
)
{
...
...
@@ -2501,7 +2511,7 @@ static void pipe_keyboard(rfbBool down, rfbKeySym keysym, rfbClientPtr client) {
X_UNLOCK
;
fprintf
(
pipeinput_fh
,
"Keysym %d %d %u %s %s
\n
"
,
uid
,
down
,
keysym
,
name
,
down
?
"KeyPress"
:
"KeyRelease"
);
keysym
,
name
?
name
:
"null"
,
down
?
"KeyPress"
:
"KeyRelease"
);
fflush
(
pipeinput_fh
);
check_pipeinput
();
...
...
@@ -2851,13 +2861,16 @@ void keyboard(rfbBool down, rfbKeySym keysym, rfbClientPtr client) {
isbutton
=
remap
->
isbutton
;
if
(
debug_keyboard
)
{
X_LOCK
;
char
*
str1
,
*
str2
;
str1
=
XKeysymToString
(
remap
->
before
);
str2
=
XKeysymToString
(
remap
->
after
);
rfbLog
(
"keyboard(): remapping keysym: "
"0x%x
\"
%s
\"
-> 0x%x
\"
%s
\"\n
"
,
(
int
)
remap
->
before
,
XKeysymToString
(
remap
->
before
)
,
str1
?
str1
:
"null"
,
(
int
)
remap
->
after
,
remap
->
isbutton
?
"button"
:
XKeysymToString
(
remap
->
after
)
);
str2
?
str2
:
"null"
);
X_UNLOCK
;
}
break
;
...
...
x11vnc/pointer.c
View file @
06af02b5
...
...
@@ -121,6 +121,7 @@ static void buttonparse(int from, char **s) {
/*
* XXX may not work with -modtweak or -xkb
*/
char
*
str
;
X_LOCK
;
kcode
=
XKeysymToKeycode
(
dpy
,
ksym
);
...
...
@@ -143,9 +144,10 @@ static void buttonparse(int from, char **s) {
modisdown
[
kcode
]
=
1
;
}
}
str
=
XKeysymToString
(
ksym
);
rfbLog
(
" event %d: keysym %s (0x%x) -> "
"keycode 0x%x down=%d up=%d
\n
"
,
n
+
1
,
XKeysymToString
(
ksym
)
,
ksym
,
kcode
,
str
?
str
:
"null"
,
ksym
,
kcode
,
pointer_map
[
from
][
n
].
down
,
pointer_map
[
from
][
n
].
up
);
X_UNLOCK
;
...
...
@@ -364,13 +366,13 @@ void do_button_mask_change(int mask, int button) {
continue
;
}
if
(
debug_pointer
&&
dpy
)
{
char
*
str
=
XKeysymToString
(
XKeycodeToKeysym
(
dpy
,
key
,
0
));
rfbLog
(
"pointer(): sending button %d "
"down as keycode 0x%x (event %d)
\n
"
,
i
+
1
,
key
,
k
+
1
);
rfbLog
(
" down=%d up=%d "
"keysym: %s
\n
"
,
down
,
up
,
XKeysymToString
(
XKeycodeToKeysym
(
dpy
,
key
,
0
)));
rfbLog
(
" down=%d up=%d keysym: "
"%s
\n
"
,
down
,
up
,
str
?
str
:
"null"
);
}
if
(
down
)
{
XTestFakeKeyEvent_wr
(
dpy
,
key
,
True
,
...
...
x11vnc/xwrappers.c
View file @
06af02b5
...
...
@@ -547,9 +547,9 @@ static void upup_downdown_warning(KeyCode key, Bool down) {
RAWFB_RET_VOID
if
((
down
?
1
:
0
)
==
keycode_state
[(
int
)
key
])
{
char
*
str
=
XKeysymToString
(
XKeycodeToKeysym
(
dpy
,
key
,
0
));
rfbLog
(
"XTestFakeKeyEvent: keycode=0x%x
\"
%s
\"
is *already* "
"%s
\n
"
,
key
,
XKeysymToString
(
XKeycodeToKeysym
(
dpy
,
key
,
0
)),
down
?
"down"
:
"up"
);
"%s
\n
"
,
key
,
str
?
str
:
"null"
,
down
?
"down"
:
"up"
);
}
}
...
...
@@ -589,9 +589,9 @@ void XTestFakeKeyEvent_wr(Display* dpy, KeyCode key, Bool down,
RAWFB_RET_VOID
if
(
debug_keyboard
)
{
char
*
str
=
XKeysymToString
(
XKeycodeToKeysym
(
dpy
,
key
,
0
));
rfbLog
(
"XTestFakeKeyEvent(dpy, keycode=0x%x
\"
%s
\"
, %s)
\n
"
,
key
,
XKeysymToString
(
XKeycodeToKeysym
(
dpy
,
key
,
0
)),
down
?
"down"
:
"up"
);
key
,
str
?
str
:
"null"
,
down
?
"down"
:
"up"
);
}
if
(
first
)
{
init_track_keycode_state
();
...
...
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