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
c0fd2223
Commit
c0fd2223
authored
Aug 23, 2011
by
Lucas Fialho Zawacki
Committed by
Alexandre Julliard
Aug 24, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Common implementation of BuildActionMap for keyboard and mouse.
parent
bebc425b
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
49 deletions
+47
-49
device.c
dlls/dinput/device.c
+42
-0
device_private.h
dlls/dinput/device_private.h
+2
-0
keyboard.c
dlls/dinput/keyboard.c
+1
-25
mouse.c
dlls/dinput/mouse.c
+2
-24
No files found.
dlls/dinput/device.c
View file @
c0fd2223
...
...
@@ -598,6 +598,48 @@ DWORD semantic_to_obj_id(IDirectInputDeviceImpl* This, DWORD dwSemantic)
return
type
|
(
0x0000ff00
&
(
obj_instance
<<
8
));
}
HRESULT
_build_action_map
(
LPDIRECTINPUTDEVICE8W
iface
,
LPDIACTIONFORMATW
lpdiaf
,
LPCWSTR
lpszUserName
,
DWORD
dwFlags
,
DWORD
devMask
,
LPCDIDATAFORMAT
df
)
{
IDirectInputDeviceImpl
*
This
=
impl_from_IDirectInputDevice8W
(
iface
);
int
i
,
has_actions
=
0
;
for
(
i
=
0
;
i
<
lpdiaf
->
dwNumActions
;
i
++
)
{
if
((
lpdiaf
->
rgoAction
[
i
].
dwSemantic
&
devMask
)
==
devMask
)
{
DWORD
obj_id
=
semantic_to_obj_id
(
This
,
lpdiaf
->
rgoAction
[
i
].
dwSemantic
);
DWORD
type
=
DIDFT_GETTYPE
(
obj_id
);
DWORD
inst
=
DIDFT_GETINSTANCE
(
obj_id
);
LPDIOBJECTDATAFORMAT
odf
;
if
(
type
==
DIDFT_PSHBUTTON
)
type
=
DIDFT_BUTTON
;
if
(
type
==
DIDFT_RELAXIS
)
type
=
DIDFT_AXIS
;
/* Assure that the object exists */
odf
=
dataformat_to_odf_by_type
(
df
,
inst
,
type
);
if
(
odf
!=
NULL
)
{
lpdiaf
->
rgoAction
[
i
].
dwObjID
=
obj_id
;
lpdiaf
->
rgoAction
[
i
].
guidInstance
=
This
->
guid
;
lpdiaf
->
rgoAction
[
i
].
dwHow
=
DIAH_DEFAULT
;
has_actions
=
1
;
}
}
else
if
(
!
(
dwFlags
&
DIDBAM_PRESERVE
))
{
/* we must clear action data belonging to other devices */
memset
(
&
lpdiaf
->
rgoAction
[
i
].
guidInstance
,
0
,
sizeof
(
GUID
));
lpdiaf
->
rgoAction
[
i
].
dwHow
=
DIAH_UNMAPPED
;
}
}
if
(
!
has_actions
)
return
DI_NOEFFECT
;
return
IDirectInputDevice8WImpl_BuildActionMap
(
iface
,
lpdiaf
,
lpszUserName
,
dwFlags
);
}
/******************************************************************************
* queue_event - add new event to the ring queue
*/
...
...
dlls/dinput/device_private.h
View file @
c0fd2223
...
...
@@ -127,6 +127,8 @@ extern const char *_dump_dinput_GUID(const GUID *guid) DECLSPEC_HIDDEN;
extern
DWORD
semantic_to_obj_id
(
IDirectInputDeviceImpl
*
This
,
DWORD
dwSemantic
)
DECLSPEC_HIDDEN
;
extern
LPDIOBJECTDATAFORMAT
dataformat_to_odf_by_type
(
LPCDIDATAFORMAT
df
,
int
n
,
DWORD
type
)
DECLSPEC_HIDDEN
;
extern
HRESULT
_build_action_map
(
LPDIRECTINPUTDEVICE8W
iface
,
LPDIACTIONFORMATW
lpdiaf
,
LPCWSTR
lpszUserName
,
DWORD
dwFlags
,
DWORD
devMask
,
LPCDIDATAFORMAT
df
)
DECLSPEC_HIDDEN
;
/* And the stubs */
extern
HRESULT
WINAPI
IDirectInputDevice2AImpl_Acquire
(
LPDIRECTINPUTDEVICE8A
iface
)
DECLSPEC_HIDDEN
;
extern
HRESULT
WINAPI
IDirectInputDevice2WImpl_Acquire
(
LPDIRECTINPUTDEVICE8W
iface
)
DECLSPEC_HIDDEN
;
...
...
dlls/dinput/keyboard.c
View file @
c0fd2223
...
...
@@ -529,33 +529,9 @@ static HRESULT WINAPI SysKeyboardWImpl_BuildActionMap(LPDIRECTINPUTDEVICE8W ifac
LPCWSTR
lpszUserName
,
DWORD
dwFlags
)
{
SysKeyboardImpl
*
This
=
impl_from_IDirectInputDevice8W
(
iface
);
int
i
,
has_actions
=
0
;
FIXME
(
"(%p)->(%p,%s,%08x): semi-stub !
\n
"
,
iface
,
lpdiaf
,
debugstr_w
(
lpszUserName
),
dwFlags
);
for
(
i
=
0
;
i
<
lpdiaf
->
dwNumActions
;
i
++
)
{
if
((
lpdiaf
->
rgoAction
[
i
].
dwSemantic
&
DIKEYBOARD_MASK
)
==
DIKEYBOARD_MASK
)
{
DWORD
obj_id
=
semantic_to_obj_id
(
&
This
->
base
,
lpdiaf
->
rgoAction
[
i
].
dwSemantic
);
lpdiaf
->
rgoAction
[
i
].
dwObjID
=
obj_id
;
lpdiaf
->
rgoAction
[
i
].
guidInstance
=
This
->
base
.
guid
;
lpdiaf
->
rgoAction
[
i
].
dwHow
=
DIAH_DEFAULT
;
has_actions
=
1
;
}
else
if
(
!
(
dwFlags
&
DIDBAM_PRESERVE
))
{
/* we must clear action data belonging to other devices */
memset
(
&
lpdiaf
->
rgoAction
[
i
].
guidInstance
,
0
,
sizeof
(
GUID
));
lpdiaf
->
rgoAction
[
i
].
dwHow
=
DIAH_UNMAPPED
;
}
}
if
(
!
has_actions
)
return
DI_NOEFFECT
;
return
IDirectInputDevice8WImpl_BuildActionMap
(
iface
,
lpdiaf
,
lpszUserName
,
dwFlags
);
return
_build_action_map
(
iface
,
lpdiaf
,
lpszUserName
,
dwFlags
,
DIKEYBOARD_MASK
,
&
c_dfDIKeyboard
);
}
static
HRESULT
WINAPI
SysKeyboardAImpl_BuildActionMap
(
LPDIRECTINPUTDEVICE8A
iface
,
...
...
dlls/dinput/mouse.c
View file @
c0fd2223
...
...
@@ -778,31 +778,9 @@ static HRESULT WINAPI SysMouseWImpl_BuildActionMap(LPDIRECTINPUTDEVICE8W iface,
LPCWSTR
lpszUserName
,
DWORD
dwFlags
)
{
SysMouseImpl
*
This
=
impl_from_IDirectInputDevice8W
(
iface
);
int
i
,
has_actions
=
0
;
for
(
i
=
0
;
i
<
lpdiaf
->
dwNumActions
;
i
++
)
{
if
((
lpdiaf
->
rgoAction
[
i
].
dwSemantic
&
DIMOUSE_MASK
)
==
DIMOUSE_MASK
)
{
DWORD
obj_id
=
semantic_to_obj_id
(
&
This
->
base
,
lpdiaf
->
rgoAction
[
i
].
dwSemantic
);
lpdiaf
->
rgoAction
[
i
].
dwObjID
=
obj_id
;
lpdiaf
->
rgoAction
[
i
].
guidInstance
=
This
->
base
.
guid
;
lpdiaf
->
rgoAction
[
i
].
dwHow
=
DIAH_DEFAULT
;
has_actions
=
1
;
}
else
if
(
!
(
dwFlags
&
DIDBAM_PRESERVE
))
{
/* we must clear action data belonging to other devices */
memset
(
&
lpdiaf
->
rgoAction
[
i
].
guidInstance
,
0
,
sizeof
(
GUID
));
lpdiaf
->
rgoAction
[
i
].
dwHow
=
DIAH_UNMAPPED
;
}
}
if
(
!
has_actions
)
return
DI_NOEFFECT
;
FIXME
(
"(%p)->(%p,%s,%08x): semi-stub !
\n
"
,
iface
,
lpdiaf
,
debugstr_w
(
lpszUserName
),
dwFlags
);
return
IDirectInputDevice8WImpl_BuildActionMap
(
iface
,
lpdiaf
,
lpszUserName
,
dwFlags
);
return
_build_action_map
(
iface
,
lpdiaf
,
lpszUserName
,
dwFlags
,
DIMOUSE_MASK
,
&
c_dfDIMouse2
);
}
static
HRESULT
WINAPI
SysMouseAImpl_BuildActionMap
(
LPDIRECTINPUTDEVICE8A
iface
,
...
...
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