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
39684c7e
Commit
39684c7e
authored
Jul 02, 2011
by
Lucas Fialho Zawacki
Committed by
Alexandre Julliard
Jul 04, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: SetActionMap and queue_event setting mapped data.
parent
b590090a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
2 deletions
+36
-2
device.c
dlls/dinput/device.c
+19
-0
device_private.h
dlls/dinput/device_private.h
+7
-0
keyboard.c
dlls/dinput/keyboard.c
+4
-0
mouse.c
dlls/dinput/mouse.c
+5
-1
device.c
dlls/dinput8/tests/device.c
+1
-1
No files found.
dlls/dinput/device.c
View file @
39684c7e
...
...
@@ -604,6 +604,22 @@ void queue_event(LPDIRECTINPUTDEVICE8A iface, int inst_id, DWORD data, DWORD tim
This
->
data_queue
[
This
->
queue_head
].
dwData
=
data
;
This
->
data_queue
[
This
->
queue_head
].
dwTimeStamp
=
time
;
This
->
data_queue
[
This
->
queue_head
].
dwSequence
=
seq
;
/* Set uAppData by means of action mapping */
if
(
This
->
num_actions
>
0
)
{
int
i
;
for
(
i
=
0
;
i
<
This
->
num_actions
;
i
++
)
{
if
(
This
->
action_map
[
i
].
offset
==
ofs
)
{
TRACE
(
"Offset %d mapped to uAppData %lu
\n
"
,
ofs
,
This
->
action_map
[
i
].
uAppData
);
This
->
data_queue
[
This
->
queue_head
].
uAppData
=
This
->
action_map
[
i
].
uAppData
;
break
;
}
}
}
This
->
queue_head
=
next_pos
;
/* Send event if asked */
}
...
...
@@ -783,6 +799,9 @@ ULONG WINAPI IDirectInputDevice2WImpl_Release(LPDIRECTINPUTDEVICE8W iface)
HeapFree
(
GetProcessHeap
(),
0
,
This
->
data_format
.
wine_df
);
release_DataFormat
(
&
This
->
data_format
);
/* Free action mapping */
HeapFree
(
GetProcessHeap
(),
0
,
This
->
action_map
);
EnterCriticalSection
(
&
This
->
dinput
->
crit
);
list_remove
(
&
This
->
entry
);
LeaveCriticalSection
(
&
This
->
dinput
->
crit
);
...
...
dlls/dinput/device_private.h
View file @
39684c7e
...
...
@@ -47,6 +47,12 @@ typedef struct
LPDIDATAFORMAT
user_df
;
/* user defined data format */
}
DataFormat
;
typedef
struct
{
unsigned
int
offset
;
UINT_PTR
uAppData
;
}
ActionMap
;
/* Device implementation */
typedef
struct
IDirectInputDeviceImpl
IDirectInputDeviceImpl
;
struct
IDirectInputDeviceImpl
...
...
@@ -74,6 +80,7 @@ struct IDirectInputDeviceImpl
/* Action mapping */
int
num_actions
;
/* number of actions mapped */
ActionMap
*
action_map
;
/* array of mappings */
};
extern
BOOL
get_app_key
(
HKEY
*
,
HKEY
*
)
DECLSPEC_HIDDEN
;
...
...
dlls/dinput/keyboard.c
View file @
39684c7e
...
...
@@ -609,6 +609,8 @@ static HRESULT WINAPI SysKeyboardWImpl_SetActionMap(LPDIRECTINPUTDEVICE8W iface,
data_format
.
rgodf
=
(
LPDIOBJECTDATAFORMAT
)
obj_df
;
data_format
.
dwNumObjs
=
num_actions
;
This
->
base
.
action_map
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
ActionMap
)
*
num_actions
);
for
(
i
=
0
;
i
<
lpdiaf
->
dwNumActions
;
i
++
)
{
if
(
IsEqualGUID
(
&
This
->
base
.
guid
,
&
lpdiaf
->
rgoAction
[
i
].
guidInstance
))
...
...
@@ -616,6 +618,8 @@ static HRESULT WINAPI SysKeyboardWImpl_SetActionMap(LPDIRECTINPUTDEVICE8W iface,
int
instance
=
DIDFT_GETINSTANCE
(
lpdiaf
->
rgoAction
[
i
].
dwObjID
);
memcpy
(
&
obj_df
[
action
],
&
c_dfDIKeyboard
.
rgodf
[
instance
],
c_dfDIKeyboard
.
dwObjSize
);
This
->
base
.
action_map
[
action
].
uAppData
=
lpdiaf
->
rgoAction
[
i
].
uAppData
;
This
->
base
.
action_map
[
action
].
offset
=
action
;
obj_df
[
action
].
dwOfs
=
action
;
action
++
;
}
...
...
dlls/dinput/mouse.c
View file @
39684c7e
...
...
@@ -834,6 +834,7 @@ static HRESULT WINAPI SysMouseWImpl_SetActionMap(LPDIRECTINPUTDEVICE8W iface,
DIDATAFORMAT
data_format
;
DIOBJECTDATAFORMAT
*
obj_df
=
NULL
;
int
i
,
action
=
0
,
num_actions
=
0
;
unsigned
int
offset
=
0
;
if
(
This
->
base
.
acquired
)
return
DIERR_ACQUIRED
;
...
...
@@ -856,15 +857,18 @@ static HRESULT WINAPI SysMouseWImpl_SetActionMap(LPDIRECTINPUTDEVICE8W iface,
data_format
.
rgodf
=
(
LPDIOBJECTDATAFORMAT
)
obj_df
;
data_format
.
dwNumObjs
=
num_actions
;
This
->
base
.
action_map
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
ActionMap
)
*
num_actions
);
for
(
i
=
0
;
i
<
lpdiaf
->
dwNumActions
;
i
++
)
{
unsigned
int
offset
=
0
;
if
(
IsEqualGUID
(
&
This
->
base
.
guid
,
&
lpdiaf
->
rgoAction
[
i
].
guidInstance
))
{
int
instance
=
DIDFT_GETINSTANCE
(
lpdiaf
->
rgoAction
[
i
].
dwObjID
);
memcpy
(
&
obj_df
[
action
],
&
c_dfDIMouse
.
rgodf
[
instance
],
c_dfDIMouse
.
dwObjSize
);
This
->
base
.
action_map
[
action
].
uAppData
=
lpdiaf
->
rgoAction
[
i
].
uAppData
;
This
->
base
.
action_map
[
action
].
offset
=
offset
;
obj_df
[
action
].
dwOfs
=
offset
;
offset
+=
(
obj_df
[
action
].
dwType
&
DIDFT_BUTTON
)
?
1
:
4
;
...
...
dlls/dinput8/tests/device.c
View file @
39684c7e
...
...
@@ -89,7 +89,7 @@ static void test_device_input(
return
;
}
todo_wine
ok
(
obj_data
.
uAppData
==
expected
,
"Retrieval of action failed uAppData=%lu expected=%d
\n
"
,
obj_data
.
uAppData
,
expected
);
ok
(
obj_data
.
uAppData
==
expected
,
"Retrieval of action failed uAppData=%lu expected=%d
\n
"
,
obj_data
.
uAppData
,
expected
);
}
static
void
test_build_action_map
(
...
...
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