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
43536e2a
Commit
43536e2a
authored
Dec 20, 2002
by
dscho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AltGr fixes in x11vnc, renamed from altgr to modtweak
parent
545988d0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
19 deletions
+26
-19
x11vnc.c
contrib/x11vnc.c
+26
-19
No files found.
contrib/x11vnc.c
View file @
43536e2a
...
@@ -127,7 +127,7 @@ int shared = 0; /* share vnc display. */
...
@@ -127,7 +127,7 @@ int shared = 0; /* share vnc display. */
int
view_only
=
0
;
/* client can only watch. */
int
view_only
=
0
;
/* client can only watch. */
int
connect_once
=
1
;
/* allow only one client connection. */
int
connect_once
=
1
;
/* allow only one client connection. */
int
use_
altgr
=
0
;
/* use the altgr_keyboard modifier tweak */
int
use_
modifier_tweak
=
0
;
/* use the altgr_keyboard modifier tweak */
/*
/*
* waitms is the msec to wait between screen polls. Not too old h/w shows
* waitms is the msec to wait between screen polls. Not too old h/w shows
...
@@ -256,7 +256,14 @@ void initialize_keycodes() {
...
@@ -256,7 +256,14 @@ void initialize_keycodes() {
XFree
((
void
*
)
keymap
);
XFree
((
void
*
)
keymap
);
}
}
void
tweak_mod
(
char
mod
,
Bool
down
)
{
void
DebugXTestFakeKeyEvent
(
Display
*
dpy
,
KeyCode
keysym
,
Bool
down
,
time_t
cur_time
)
{
fprintf
(
stderr
,
"XTestFakeKeyEvent(dpy,%s(0x%x),%s,CurrentTime)
\n
"
,
XKeysymToString
(
XKeycodeToKeysym
(
dpy
,
keysym
,
0
)),
keysym
,
down
?
"down"
:
"up"
);
XTestFakeKeyEvent
(
dpy
,
keysym
,
down
,
cur_time
);
}
void
tweak_mod
(
signed
char
mod
,
Bool
down
)
{
Bool
is_shift
=
mod_state
&
(
LEFTSHIFT
|
RIGHTSHIFT
);
Bool
is_shift
=
mod_state
&
(
LEFTSHIFT
|
RIGHTSHIFT
);
X_Bool
dn
=
(
X_Bool
)
down
;
X_Bool
dn
=
(
X_Bool
)
down
;
...
@@ -276,16 +283,16 @@ void tweak_mod(char mod, Bool down) {
...
@@ -276,16 +283,16 @@ void tweak_mod(char mod, Bool down) {
if
(
!
is_shift
&&
mod
==
1
)
{
if
(
!
is_shift
&&
mod
==
1
)
{
XTestFakeKeyEvent
(
dpy
,
left_shift_code
,
dn
,
CurrentTime
);
XTestFakeKeyEvent
(
dpy
,
left_shift_code
,
dn
,
CurrentTime
);
}
}
if
(
(
mod_state
&
ALTGR
)
&&
mod
!=
2
)
{
if
(
altgr_code
&&
(
mod_state
&
ALTGR
)
&&
mod
!=
2
)
{
XTestFakeKeyEvent
(
dpy
,
altgr_code
,
!
dn
,
CurrentTime
);
XTestFakeKeyEvent
(
dpy
,
altgr_code
,
!
dn
,
CurrentTime
);
}
}
if
(
!
(
mod_state
&
ALTGR
)
&&
mod
==
2
)
{
if
(
altgr_code
&&
!
(
mod_state
&
ALTGR
)
&&
mod
==
2
)
{
XTestFakeKeyEvent
(
dpy
,
altgr_code
,
dn
,
CurrentTime
);
XTestFakeKeyEvent
(
dpy
,
altgr_code
,
dn
,
CurrentTime
);
}
}
X_UNLOCK
X_UNLOCK
}
}
static
void
altgr
_keyboard
(
Bool
down
,
KeySym
keysym
,
rfbClientPtr
client
)
{
static
void
modifier_tweak
_keyboard
(
Bool
down
,
KeySym
keysym
,
rfbClientPtr
client
)
{
KeyCode
k
;
KeyCode
k
;
int
tweak
=
0
;
int
tweak
=
0
;
...
@@ -334,8 +341,8 @@ static void keyboard(Bool down, KeySym keysym, rfbClientPtr client) {
...
@@ -334,8 +341,8 @@ static void keyboard(Bool down, KeySym keysym, rfbClientPtr client) {
return
;
return
;
}
}
if
(
use_
altgr
)
{
if
(
use_
modifier_tweak
)
{
altgr
_keyboard
(
down
,
keysym
,
client
);
modifier_tweak
_keyboard
(
down
,
keysym
,
client
);
return
;
return
;
}
}
...
@@ -1344,9 +1351,9 @@ void print_help() {
...
@@ -1344,9 +1351,9 @@ void print_help() {
" horizontal tiles into one big rectangle) (default %s).
\n
"
" horizontal tiles into one big rectangle) (default %s).
\n
"
"-nohints do not use hints; send each tile separately.
\n
"
"-nohints do not use hints; send each tile separately.
\n
"
"
\n
"
"
\n
"
"-
altgr use a mechanism to properly handle the AltGr modifier
\n
"
"-
modtweak handle AltGr/Shift modifiers for differing languages
\n
"
"
on certain keyboards
(default %d).
\n
"
"
between client and host
(default %d).
\n
"
"-no
altgr
send the keysym directly to the X server.
\n
"
"-no
modtweak
send the keysym directly to the X server.
\n
"
"-threads use threaded algorithm [rfbRunEventLoop] if compiled
\n
"
"-threads use threaded algorithm [rfbRunEventLoop] if compiled
\n
"
" with threads (default %s).
\n
"
" with threads (default %s).
\n
"
"-nothreads do not use [rfbRunEventLoop].
\n
"
"-nothreads do not use [rfbRunEventLoop].
\n
"
...
@@ -1358,7 +1365,7 @@ void print_help() {
...
@@ -1358,7 +1365,7 @@ void print_help() {
;
;
fprintf
(
stderr
,
help
,
defer_update
,
waitms
,
gaps_fill
,
grow_fill
,
fprintf
(
stderr
,
help
,
defer_update
,
waitms
,
gaps_fill
,
grow_fill
,
fs_frac
,
tile_fuzz
,
fs_frac
,
tile_fuzz
,
use_hints
?
"on"
:
"off"
,
use_
altgr
?
"on"
:
"off"
,
use_hints
?
"on"
:
"off"
,
use_
modifier_tweak
?
"on"
:
"off"
,
use_threads
?
"on"
:
"off"
,
view_only
?
"on"
:
"off"
,
use_threads
?
"on"
:
"off"
,
view_only
?
"on"
:
"off"
,
shared
?
"on"
:
"off"
);
shared
?
"on"
:
"off"
);
rfbUsage
();
rfbUsage
();
...
@@ -1399,10 +1406,10 @@ int main(int argc, char** argv) {
...
@@ -1399,10 +1406,10 @@ int main(int argc, char** argv) {
use_threads
=
1
;
use_threads
=
1
;
}
else
if
(
!
strcmp
(
argv
[
i
],
"-nothreads"
))
{
}
else
if
(
!
strcmp
(
argv
[
i
],
"-nothreads"
))
{
use_threads
=
0
;
use_threads
=
0
;
}
else
if
(
!
strcmp
(
argv
[
i
],
"-
altgr
"
))
{
}
else
if
(
!
strcmp
(
argv
[
i
],
"-
modtweak
"
))
{
use_
altgr
=
1
;
use_
modifier_tweak
=
1
;
}
else
if
(
!
strcmp
(
argv
[
i
],
"-no
altgr
"
))
{
}
else
if
(
!
strcmp
(
argv
[
i
],
"-no
modtweak
"
))
{
use_
altgr
=
0
;
use_
modifier_tweak
=
0
;
}
else
if
(
!
strcmp
(
argv
[
i
],
"-viewonly"
))
{
}
else
if
(
!
strcmp
(
argv
[
i
],
"-viewonly"
))
{
view_only
=
1
;
view_only
=
1
;
}
else
if
(
!
strcmp
(
argv
[
i
],
"-shared"
))
{
}
else
if
(
!
strcmp
(
argv
[
i
],
"-shared"
))
{
...
@@ -1491,7 +1498,7 @@ int main(int argc, char** argv) {
...
@@ -1491,7 +1498,7 @@ int main(int argc, char** argv) {
initialize_shm
();
initialize_shm
();
if
(
use_
altgr
)
{
if
(
use_
modifier_tweak
)
{
initialize_keycodes
();
initialize_keycodes
();
}
}
...
...
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