Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
6b8cedfd
Commit
6b8cedfd
authored
Sep 19, 2001
by
Brad Campbell
Committed by
Alexandre Julliard
Sep 19, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed mouse position processing for use with a touchscreen.
parent
cde7d63b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
33 deletions
+29
-33
input.c
windows/input.c
+22
-25
event.c
windows/x11drv/event.c
+2
-2
mouse.c
windows/x11drv/mouse.c
+5
-6
No files found.
windows/input.c
View file @
6b8cedfd
...
...
@@ -159,32 +159,29 @@ static void queue_kbd_event( const KEYBDINPUT *ki )
*/
static
void
queue_mouse_event
(
const
MOUSEINPUT
*
mi
,
WORD
keystate
)
{
if
(
mi
->
dwFlags
&
MOUSEEVENTF_
MOV
E
)
if
(
mi
->
dwFlags
&
MOUSEEVENTF_
ABSOLUT
E
)
{
if
(
mi
->
dwFlags
&
MOUSEEVENTF_ABSOLUTE
)
{
PosX
=
(
mi
->
dx
*
GetSystemMetrics
(
SM_CXSCREEN
))
>>
16
;
PosY
=
(
mi
->
dy
*
GetSystemMetrics
(
SM_CYSCREEN
))
>>
16
;
}
else
{
int
width
=
GetSystemMetrics
(
SM_CXSCREEN
);
int
height
=
GetSystemMetrics
(
SM_CYSCREEN
);
long
posX
=
(
long
)
PosX
,
posY
=
(
long
)
PosY
;
/* dx and dy can be negative numbers for relative movements */
posX
+=
(
long
)
mi
->
dx
;
posY
+=
(
long
)
mi
->
dy
;
/* Clip to the current screen size */
if
(
posX
<
0
)
PosX
=
0
;
else
if
(
posX
>=
width
)
PosX
=
width
-
1
;
else
PosX
=
posX
;
if
(
posY
<
0
)
PosY
=
0
;
else
if
(
posY
>=
height
)
PosY
=
height
-
1
;
else
PosY
=
posY
;
}
PosX
=
(
mi
->
dx
*
GetSystemMetrics
(
SM_CXSCREEN
))
>>
16
;
PosY
=
(
mi
->
dy
*
GetSystemMetrics
(
SM_CYSCREEN
))
>>
16
;
}
else
if
(
mi
->
dwFlags
&
MOUSEEVENTF_MOVE
)
{
int
width
=
GetSystemMetrics
(
SM_CXSCREEN
);
int
height
=
GetSystemMetrics
(
SM_CYSCREEN
);
long
posX
=
(
long
)
PosX
,
posY
=
(
long
)
PosY
;
/* dx and dy can be negative numbers for relative movements */
posX
+=
(
long
)
mi
->
dx
;
posY
+=
(
long
)
mi
->
dy
;
/* Clip to the current screen size */
if
(
posX
<
0
)
PosX
=
0
;
else
if
(
posX
>=
width
)
PosX
=
width
-
1
;
else
PosX
=
posX
;
if
(
posY
<
0
)
PosY
=
0
;
else
if
(
posY
>=
height
)
PosY
=
height
-
1
;
else
PosY
=
posY
;
}
if
(
mi
->
dwFlags
&
MOUSEEVENTF_MOVE
)
...
...
windows/x11drv/event.c
View file @
6b8cedfd
...
...
@@ -477,7 +477,7 @@ static void EVENT_ButtonPress( HWND hWnd, XButtonEvent *event )
break
;
}
X11DRV_SendEvent
(
statusCodes
[
buttonNum
],
pt
.
x
,
pt
.
y
,
X11DRV_SendEvent
(
statusCodes
[
buttonNum
]
|
MOUSEEVENTF_ABSOLUTE
,
pt
.
x
,
pt
.
y
,
keystate
,
wData
,
event
->
time
-
X11DRV_server_startticks
,
hWnd
);
}
...
...
@@ -518,7 +518,7 @@ static void EVENT_ButtonRelease( HWND hWnd, XButtonEvent *event )
default:
return
;
}
X11DRV_SendEvent
(
statusCodes
[
buttonNum
],
pt
.
x
,
pt
.
y
,
X11DRV_SendEvent
(
statusCodes
[
buttonNum
]
|
MOUSEEVENTF_ABSOLUTE
,
pt
.
x
,
pt
.
y
,
keystate
,
0
,
event
->
time
-
X11DRV_server_startticks
,
hWnd
);
}
...
...
windows/x11drv/mouse.c
View file @
6b8cedfd
...
...
@@ -292,8 +292,6 @@ void X11DRV_InitMouse( LPMOUSE_EVENT_PROC proc )
void
X11DRV_SendEvent
(
DWORD
mouseStatus
,
DWORD
posX
,
DWORD
posY
,
WORD
keyState
,
DWORD
data
,
DWORD
time
,
HWND
hWnd
)
{
int
width
=
GetSystemMetrics
(
SM_CXSCREEN
);
int
height
=
GetSystemMetrics
(
SM_CYSCREEN
);
int
iWndsLocks
;
WINE_MOUSEEVENT
wme
;
...
...
@@ -301,19 +299,20 @@ void X11DRV_SendEvent( DWORD mouseStatus, DWORD posX, DWORD posY,
TRACE
(
"(%04lX,%ld,%ld)
\n
"
,
mouseStatus
,
posX
,
posY
);
if
(
mouseStatus
&
MOUSEEVENTF_MOVE
)
{
if
(
mouseStatus
&
MOUSEEVENTF_ABSOLUTE
)
{
if
(
mouseStatus
&
MOUSEEVENTF_ABSOLUTE
)
{
int
width
=
GetSystemMetrics
(
SM_CXSCREEN
);
int
height
=
GetSystemMetrics
(
SM_CYSCREEN
);
/* Relative mouse movements seems not to be scaled as absolute ones */
posX
=
(((
long
)
posX
<<
16
)
+
width
-
1
)
/
width
;
posY
=
(((
long
)
posY
<<
16
)
+
height
-
1
)
/
height
;
}
}
wme
.
magic
=
WINE_MOUSEEVENT_MAGIC
;
wme
.
time
=
time
;
wme
.
hWnd
=
hWnd
;
wme
.
keyState
=
keyState
;
InterlockedDecrement
(
&
X11DRV_MOUSE_WarpPointer
);
/* To avoid deadlocks, we have to suspend all locks on windows structures
before the program control is passed to the mouse driver */
...
...
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