Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
ce1398e3
Commit
ce1398e3
authored
Dec 16, 2000
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid a couple of dependencies on input.c internal variables.
parent
b583ed33
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
52 additions
and
62 deletions
+52
-62
main.c
dlls/dinput/mouse/main.c
+11
-12
input.h
include/input.h
+0
-11
cursoricon.c
windows/cursoricon.c
+0
-29
input.c
windows/input.c
+35
-3
winpos.c
windows/winpos.c
+2
-5
event.c
windows/x11drv/event.c
+4
-2
No files found.
dlls/dinput/mouse/main.c
View file @
ce1398e3
...
@@ -504,18 +504,18 @@ static HRESULT WINAPI SysMouseAImpl_Acquire(LPDIRECTINPUTDEVICE2A iface)
...
@@ -504,18 +504,18 @@ static HRESULT WINAPI SysMouseAImpl_Acquire(LPDIRECTINPUTDEVICE2A iface)
/* Init the mouse state */
/* Init the mouse state */
if
(
This
->
absolute
)
{
if
(
This
->
absolute
)
{
This
->
m_state
.
lX
=
PosX
;
GetCursorPos
(
&
point
)
;
This
->
m_state
.
l
Y
=
PosY
;
This
->
m_state
.
l
X
=
point
.
x
;
This
->
m_state
.
lY
=
point
.
y
;
This
->
prevX
=
PosX
;
This
->
prevX
=
point
.
x
;
This
->
prevY
=
PosY
;
This
->
prevY
=
point
.
y
;
}
else
{
}
else
{
This
->
m_state
.
lX
=
0
;
This
->
m_state
.
lX
=
0
;
This
->
m_state
.
lY
=
0
;
This
->
m_state
.
lY
=
0
;
}
}
This
->
m_state
.
rgbButtons
[
0
]
=
(
MouseButtonsStates
[
0
]
?
0xFF
:
0x00
);
This
->
m_state
.
rgbButtons
[
0
]
=
(
GetKeyState
(
VK_LBUTTON
)
?
0xFF
:
0x00
);
This
->
m_state
.
rgbButtons
[
1
]
=
(
MouseButtonsStates
[
1
]
?
0xFF
:
0x00
);
This
->
m_state
.
rgbButtons
[
1
]
=
(
GetKeyState
(
VK_MBUTTON
)
?
0xFF
:
0x00
);
This
->
m_state
.
rgbButtons
[
2
]
=
(
MouseButtonsStates
[
2
]
?
0xFF
:
0x00
);
This
->
m_state
.
rgbButtons
[
2
]
=
(
GetKeyState
(
VK_RBUTTON
)
?
0xFF
:
0x00
);
/* Install our own mouse event handler */
/* Install our own mouse event handler */
MOUSE_Enable
(
dinput_mouse_event
);
MOUSE_Enable
(
dinput_mouse_event
);
...
@@ -531,7 +531,7 @@ static HRESULT WINAPI SysMouseAImpl_Acquire(LPDIRECTINPUTDEVICE2A iface)
...
@@ -531,7 +531,7 @@ static HRESULT WINAPI SysMouseAImpl_Acquire(LPDIRECTINPUTDEVICE2A iface)
point
.
x
=
This
->
win_centerX
;
point
.
x
=
This
->
win_centerX
;
point
.
y
=
This
->
win_centerY
;
point
.
y
=
This
->
win_centerY
;
MapWindowPoints
(
This
->
win
,
HWND_DESKTOP
,
&
point
,
1
);
MapWindowPoints
(
This
->
win
,
HWND_DESKTOP
,
&
point
,
1
);
USER_Driver
.
pMoveCursor
(
point
.
x
,
point
.
y
);
SetCursorPos
(
point
.
x
,
point
.
y
);
#ifdef MOUSE_HACK
#ifdef MOUSE_HACK
This
->
need_warp
=
WARP_DONE
;
This
->
need_warp
=
WARP_DONE
;
#else
#else
...
@@ -602,7 +602,7 @@ static HRESULT WINAPI SysMouseAImpl_GetDeviceState(
...
@@ -602,7 +602,7 @@ static HRESULT WINAPI SysMouseAImpl_GetDeviceState(
point
.
x
=
This
->
win_centerX
;
point
.
x
=
This
->
win_centerX
;
point
.
y
=
This
->
win_centerY
;
point
.
y
=
This
->
win_centerY
;
MapWindowPoints
(
This
->
win
,
HWND_DESKTOP
,
&
point
,
1
);
MapWindowPoints
(
This
->
win
,
HWND_DESKTOP
,
&
point
,
1
);
USER_Driver
.
pMoveCursor
(
point
.
x
,
point
.
y
);
SetCursorPos
(
point
.
x
,
point
.
y
);
#ifdef MOUSE_HACK
#ifdef MOUSE_HACK
This
->
need_warp
=
WARP_DONE
;
This
->
need_warp
=
WARP_DONE
;
...
@@ -672,8 +672,7 @@ static HRESULT WINAPI SysMouseAImpl_GetDeviceData(LPDIRECTINPUTDEVICE2A iface,
...
@@ -672,8 +672,7 @@ static HRESULT WINAPI SysMouseAImpl_GetDeviceData(LPDIRECTINPUTDEVICE2A iface,
point
.
x
=
This
->
win_centerX
;
point
.
x
=
This
->
win_centerX
;
point
.
y
=
This
->
win_centerY
;
point
.
y
=
This
->
win_centerY
;
MapWindowPoints
(
This
->
win
,
HWND_DESKTOP
,
&
point
,
1
);
MapWindowPoints
(
This
->
win
,
HWND_DESKTOP
,
&
point
,
1
);
SetCursorPos
(
point
.
x
,
point
.
y
);
USER_Driver
.
pMoveCursor
(
point
.
x
,
point
.
y
);
#ifdef MOUSE_HACK
#ifdef MOUSE_HACK
This
->
need_warp
=
WARP_DONE
;
This
->
need_warp
=
WARP_DONE
;
...
...
include/input.h
View file @
ce1398e3
...
@@ -14,17 +14,6 @@ extern BOOL AsyncMouseButtonsStates[3];
...
@@ -14,17 +14,6 @@ extern BOOL AsyncMouseButtonsStates[3];
extern
BYTE
InputKeyStateTable
[
256
];
extern
BYTE
InputKeyStateTable
[
256
];
extern
BYTE
QueueKeyStateTable
[
256
];
extern
BYTE
QueueKeyStateTable
[
256
];
extern
BYTE
AsyncKeyStateTable
[
256
];
extern
BYTE
AsyncKeyStateTable
[
256
];
extern
DWORD
PosX
,
PosY
;
extern
BOOL
SwappedButtons
;
#define GET_KEYSTATE() \
((MouseButtonsStates[SwappedButtons ? 2 : 0] ? MK_LBUTTON : 0) | \
(MouseButtonsStates[1] ? MK_RBUTTON : 0) | \
(MouseButtonsStates[SwappedButtons ? 0 : 2] ? MK_MBUTTON : 0) | \
(InputKeyStateTable[VK_SHIFT] & 0x80 ? MK_SHIFT : 0) | \
(InputKeyStateTable[VK_CONTROL] & 0x80 ? MK_CONTROL : 0))
#endif
/* __WINE_INPUT_H */
#endif
/* __WINE_INPUT_H */
windows/cursoricon.c
View file @
ce1398e3
...
@@ -1519,35 +1519,6 @@ BOOL WINAPI ClipCursor( const RECT *rect )
...
@@ -1519,35 +1519,6 @@ BOOL WINAPI ClipCursor( const RECT *rect )
/***********************************************************************
/***********************************************************************
* GetCursorPos16 (USER.17)
*/
BOOL16
WINAPI
GetCursorPos16
(
POINT16
*
pt
)
{
if
(
!
pt
)
return
0
;
pt
->
x
=
PosX
;
pt
->
y
=
PosY
;
TRACE_
(
cursor
)(
"ret=%d,%d
\n
"
,
pt
->
x
,
pt
->
y
);
return
1
;
}
/***********************************************************************
* GetCursorPos (USER32.229)
*/
BOOL
WINAPI
GetCursorPos
(
POINT
*
pt
)
{
BOOL
ret
;
POINT16
pt16
;
ret
=
GetCursorPos16
(
&
pt16
);
if
(
pt
)
CONV_POINT16TO32
(
&
pt16
,
pt
);
return
((
pt
)
?
ret
:
0
);
}
/***********************************************************************
* GetClipCursor16 (USER.309)
* GetClipCursor16 (USER.309)
*/
*/
void
WINAPI
GetClipCursor16
(
RECT16
*
rect
)
void
WINAPI
GetClipCursor16
(
RECT16
*
rect
)
...
...
windows/input.c
View file @
ce1398e3
...
@@ -39,7 +39,7 @@ DECLARE_DEBUG_CHANNEL(keyboard);
...
@@ -39,7 +39,7 @@ DECLARE_DEBUG_CHANNEL(keyboard);
DECLARE_DEBUG_CHANNEL
(
win
);
DECLARE_DEBUG_CHANNEL
(
win
);
static
BOOL
InputEnabled
=
TRUE
;
static
BOOL
InputEnabled
=
TRUE
;
BOOL
SwappedButtons
=
FALSE
;
static
BOOL
SwappedButtons
;
BOOL
MouseButtonsStates
[
3
];
BOOL
MouseButtonsStates
[
3
];
BOOL
AsyncMouseButtonsStates
[
3
];
BOOL
AsyncMouseButtonsStates
[
3
];
...
@@ -48,7 +48,14 @@ BYTE QueueKeyStateTable[256];
...
@@ -48,7 +48,14 @@ BYTE QueueKeyStateTable[256];
BYTE
AsyncKeyStateTable
[
256
];
BYTE
AsyncKeyStateTable
[
256
];
/* Storage for the USER-maintained mouse positions */
/* Storage for the USER-maintained mouse positions */
DWORD
PosX
,
PosY
;
static
DWORD
PosX
,
PosY
;
#define GET_KEYSTATE() \
((MouseButtonsStates[SwappedButtons ? 2 : 0] ? MK_LBUTTON : 0) | \
(MouseButtonsStates[1] ? MK_RBUTTON : 0) | \
(MouseButtonsStates[SwappedButtons ? 0 : 2] ? MK_MBUTTON : 0) | \
(InputKeyStateTable[VK_SHIFT] & 0x80 ? MK_SHIFT : 0) | \
(InputKeyStateTable[VK_CONTROL] & 0x80 ? MK_CONTROL : 0))
typedef
union
typedef
union
{
{
...
@@ -201,7 +208,7 @@ void WINAPI mouse_event( DWORD dwFlags, DWORD dx, DWORD dy,
...
@@ -201,7 +208,7 @@ void WINAPI mouse_event( DWORD dwFlags, DWORD dx, DWORD dy,
* Otherwise, we need to determine that info ourselves (probably
* Otherwise, we need to determine that info ourselves (probably
* less accurate, but we can't help that ...).
* less accurate, but we can't help that ...).
*/
*/
if
(
!
IsBadReadPtr
(
(
LPVOID
)
dwExtraInfo
,
sizeof
(
WINE_MOUSEEVENT
)
)
if
(
dwExtraInfo
&&
!
IsBadReadPtr
(
(
LPVOID
)
dwExtraInfo
,
sizeof
(
WINE_MOUSEEVENT
)
)
&&
((
WINE_MOUSEEVENT
*
)
dwExtraInfo
)
->
magic
==
WINE_MOUSEEVENT_MAGIC
)
&&
((
WINE_MOUSEEVENT
*
)
dwExtraInfo
)
->
magic
==
WINE_MOUSEEVENT_MAGIC
)
{
{
WINE_MOUSEEVENT
*
wme
=
(
WINE_MOUSEEVENT
*
)
dwExtraInfo
;
WINE_MOUSEEVENT
*
wme
=
(
WINE_MOUSEEVENT
*
)
dwExtraInfo
;
...
@@ -332,6 +339,31 @@ BOOL WINAPI SwapMouseButton( BOOL fSwap )
...
@@ -332,6 +339,31 @@ BOOL WINAPI SwapMouseButton( BOOL fSwap )
return
ret
;
return
ret
;
}
}
/***********************************************************************
* GetCursorPos16 (USER.17)
*/
BOOL16
WINAPI
GetCursorPos16
(
POINT16
*
pt
)
{
if
(
!
pt
)
return
0
;
pt
->
x
=
PosX
;
pt
->
y
=
PosY
;
return
1
;
}
/***********************************************************************
* GetCursorPos (USER32.229)
*/
BOOL
WINAPI
GetCursorPos
(
POINT
*
pt
)
{
if
(
!
pt
)
return
0
;
pt
->
x
=
PosX
;
pt
->
y
=
PosY
;
return
1
;
}
/**********************************************************************
/**********************************************************************
* EVENT_Capture
* EVENT_Capture
*
*
...
...
windows/winpos.c
View file @
ce1398e3
...
@@ -2938,13 +2938,10 @@ Pos: /* -----------------------------------------------------------------------
...
@@ -2938,13 +2938,10 @@ Pos: /* -----------------------------------------------------------------------
EVENT_Synchronize
();
/* Synchronize with the host window system */
EVENT_Synchronize
();
/* Synchronize with the host window system */
if
(
!
GetCapture
()
&&
((
wndPtr
->
dwStyle
&
WS_VISIBLE
)
||
(
flags
&
SWP_HIDEWINDOW
)))
if
(
!
GetCapture
()
&&
((
wndPtr
->
dwStyle
&
WS_VISIBLE
)
||
(
flags
&
SWP_HIDEWINDOW
)))
{
{
/* Simulate a mouse event to set the cursor */
/* Simulate a mouse event to set the cursor */
int
iWndsLocks
=
WIN_SuspendWndsLock
();
int
iWndsLocks
=
WIN_SuspendWndsLock
();
mouse_event
(
MOUSEEVENTF_MOVE
,
0
,
0
,
0
,
0
);
hardware_event
(
WM_MOUSEMOVE
,
GET_KEYSTATE
(),
0
,
PosX
,
PosY
,
GetTickCount
(),
0
);
WIN_RestoreWndsLock
(
iWndsLocks
);
WIN_RestoreWndsLock
(
iWndsLocks
);
}
}
...
...
windows/x11drv/event.c
View file @
ce1398e3
...
@@ -277,11 +277,13 @@ static void EVENT_ProcessEvent( XEvent *event )
...
@@ -277,11 +277,13 @@ static void EVENT_ProcessEvent( XEvent *event )
if
((
event
->
type
==
DGAKeyPressEventType
)
||
if
((
event
->
type
==
DGAKeyPressEventType
)
||
(
event
->
type
==
DGAKeyReleaseEventType
))
{
(
event
->
type
==
DGAKeyReleaseEventType
))
{
/* Fill a XKeyEvent to send to EVENT_Key */
/* Fill a XKeyEvent to send to EVENT_Key */
POINT
pt
;
XKeyEvent
ke
;
XKeyEvent
ke
;
XDGAKeyEvent
*
evt
=
(
XDGAKeyEvent
*
)
event
;
XDGAKeyEvent
*
evt
=
(
XDGAKeyEvent
*
)
event
;
TRACE
(
"DGAKeyPress/ReleaseEvent received.
\n
"
);
TRACE
(
"DGAKeyPress/ReleaseEvent received.
\n
"
);
GetCursorPos
(
&
pt
);
if
(
evt
->
type
==
DGAKeyReleaseEventType
)
if
(
evt
->
type
==
DGAKeyReleaseEventType
)
ke
.
type
=
KeyRelease
;
ke
.
type
=
KeyRelease
;
else
else
...
@@ -293,8 +295,8 @@ static void EVENT_ProcessEvent( XEvent *event )
...
@@ -293,8 +295,8 @@ static void EVENT_ProcessEvent( XEvent *event )
ke
.
root
=
0
;
ke
.
root
=
0
;
ke
.
subwindow
=
0
;
ke
.
subwindow
=
0
;
ke
.
time
=
evt
->
time
;
ke
.
time
=
evt
->
time
;
ke
.
x
=
PosX
;
ke
.
x
=
pt
.
x
;
ke
.
y
=
PosY
;
ke
.
y
=
pt
.
y
;
ke
.
x_root
=
-
1
;
ke
.
x_root
=
-
1
;
ke
.
y_root
=
-
1
;
ke
.
y_root
=
-
1
;
ke
.
state
=
evt
->
state
;
ke
.
state
=
evt
->
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