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
e2874d34
Commit
e2874d34
authored
Mar 12, 2009
by
dscho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Teach SDLvncviewer about scroll wheel events
Signed-off-by:
Johannes Schindelin
<
johannes.schindelin@gmx.de
>
parent
76db2202
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
8 deletions
+30
-8
ChangeLog
ChangeLog
+3
-0
SDLvncviewer.c
client_examples/SDLvncviewer.c
+27
-8
No files found.
ChangeLog
View file @
e2874d34
2009-03-12 Johannes E. Schindelin <Johannes.Schindelin@gmx.de>
* client_examples/SDLvncviewer.c: support mouse wheel operations
2009-03-08 Johannes E. Schindelin <Johannes.Schindelin@gmx.de>
2009-03-08 Johannes E. Schindelin <Johannes.Schindelin@gmx.de>
* client_examples/SDLvncviewer.c: support clipboard operations
* client_examples/SDLvncviewer.c: support clipboard operations
...
...
client_examples/SDLvncviewer.c
View file @
e2874d34
...
@@ -6,6 +6,8 @@ struct { int sdl; int rfb; } buttonMapping[]={
...
@@ -6,6 +6,8 @@ struct { int sdl; int rfb; } buttonMapping[]={
{
1
,
rfbButton1Mask
},
{
1
,
rfbButton1Mask
},
{
2
,
rfbButton2Mask
},
{
2
,
rfbButton2Mask
},
{
3
,
rfbButton3Mask
},
{
3
,
rfbButton3Mask
},
{
4
,
rfbButton4Mask
},
{
5
,
rfbButton5Mask
},
{
0
,
0
}
{
0
,
0
}
};
};
...
@@ -357,20 +359,37 @@ static void handleSDLEvent(rfbClient *cl, SDL_Event *e)
...
@@ -357,20 +359,37 @@ static void handleSDLEvent(rfbClient *cl, SDL_Event *e)
#endif
#endif
case
SDL_MOUSEBUTTONUP
:
case
SDL_MOUSEBUTTONUP
:
case
SDL_MOUSEBUTTONDOWN
:
case
SDL_MOUSEBUTTONDOWN
:
case
SDL_MOUSEMOTION
:
{
case
SDL_MOUSEMOTION
:
{
int
x
,
y
,
state
,
i
;
int
x
,
y
,
state
,
i
;
if
(
viewOnly
)
if
(
viewOnly
)
break
;
break
;
state
=
SDL_GetMouseState
(
&
x
,
&
y
);
if
(
e
->
type
==
SDL_MOUSEMOTION
)
{
x
=
e
->
motion
.
x
;
y
=
e
->
motion
.
y
;
state
=
e
->
motion
.
state
;
}
else
{
x
=
e
->
button
.
x
;
y
=
e
->
button
.
y
;
state
=
e
->
button
.
button
;
for
(
i
=
0
;
buttonMapping
[
i
].
sdl
;
i
++
)
if
(
state
==
buttonMapping
[
i
].
sdl
)
{
state
=
buttonMapping
[
i
].
rfb
;
if
(
e
->
type
==
SDL_MOUSEBUTTONDOWN
)
buttonMask
|=
state
;
else
buttonMask
&=
~
state
;
break
;
}
}
if
(
sdlPixels
)
{
if
(
sdlPixels
)
{
x
=
x
*
cl
->
width
/
realWidth
;
x
=
x
*
cl
->
width
/
realWidth
;
y
=
y
*
cl
->
height
/
realHeight
;
y
=
y
*
cl
->
height
/
realHeight
;
}
}
for
(
buttonMask
=
0
,
i
=
0
;
buttonMapping
[
i
].
sdl
;
i
++
)
if
(
state
&
SDL_BUTTON
(
buttonMapping
[
i
].
sdl
))
buttonMask
|=
buttonMapping
[
i
].
rfb
;
SendPointerEvent
(
cl
,
x
,
y
,
buttonMask
);
SendPointerEvent
(
cl
,
x
,
y
,
buttonMask
);
buttonMask
&=
~
(
rfbButton4Mask
|
rfbButton5Mask
);
break
;
break
;
}
}
case
SDL_KEYUP
:
case
SDL_KEYUP
:
...
...
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