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
91496918
Commit
91496918
authored
Sep 01, 2011
by
Lucas Fialho Zawacki
Committed by
Alexandre Julliard
Sep 06, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Added display of available actions to ConfigureDevices dialog.
parent
a4b209b1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
0 deletions
+48
-0
config.c
dlls/dinput/config.c
+48
-0
No files found.
dlls/dinput/config.c
View file @
91496918
...
...
@@ -110,6 +110,11 @@ static void init_listview_columns(HWND dialog)
SendDlgItemMessageW
(
dialog
,
IDC_DEVICEOBJECTSLIST
,
LVM_INSERTCOLUMNW
,
1
,
(
LPARAM
)
&
listColumn
);
}
static
int
lv_get_cur_item
(
HWND
dialog
)
{
return
SendDlgItemMessageW
(
dialog
,
IDC_DEVICEOBJECTSLIST
,
LVM_GETNEXTITEM
,
-
1
,
LVNI_SELECTED
);
}
static
void
lv_set_action
(
HWND
dialog
,
int
item
,
int
action
,
LPDIACTIONFORMATW
lpdiaf
)
{
static
const
WCHAR
no_action
[]
=
{
'-'
,
'\0'
};
...
...
@@ -225,6 +230,37 @@ static void fill_device_object_list(HWND dialog)
}
}
static
void
show_suitable_actions
(
HWND
dialog
)
{
DeviceData
*
device
=
get_cur_device
(
dialog
);
LPDIACTIONFORMATW
lpdiaf
=
get_cur_lpdiaf
(
dialog
);
int
i
,
added
=
0
;
int
obj
=
lv_get_cur_item
(
dialog
);
if
(
obj
<
0
)
return
;
SendDlgItemMessageW
(
dialog
,
IDC_ACTIONLIST
,
LB_RESETCONTENT
,
0
,
0
);
for
(
i
=
0
;
i
<
lpdiaf
->
dwNumActions
;
i
++
)
{
/* Skip keyboard actions for non keyboards */
if
(
GET_DIDEVICE_TYPE
(
device
->
ddi
.
dwDevType
)
!=
DI8DEVTYPE_KEYBOARD
&&
(
lpdiaf
->
rgoAction
[
i
].
dwSemantic
&
DIKEYBOARD_MASK
)
==
DIKEYBOARD_MASK
)
continue
;
/* Skip mouse actions for non mouses */
if
(
GET_DIDEVICE_TYPE
(
device
->
ddi
.
dwDevType
)
!=
DI8DEVTYPE_MOUSE
&&
(
lpdiaf
->
rgoAction
[
i
].
dwSemantic
&
DIMOUSE_MASK
)
==
DIMOUSE_MASK
)
continue
;
/* Add action string and index in the action format to the list entry */
if
(
DIDFT_GETINSTANCE
(
lpdiaf
->
rgoAction
[
i
].
dwSemantic
)
&
DIDFT_GETTYPE
(
device
->
ddo
[
obj
].
dwType
))
{
SendDlgItemMessageW
(
dialog
,
IDC_ACTIONLIST
,
LB_ADDSTRING
,
0
,
(
LPARAM
)
lpdiaf
->
rgoAction
[
i
].
lptszActionName
);
SendDlgItemMessageW
(
dialog
,
IDC_ACTIONLIST
,
LB_SETITEMDATA
,
added
,
(
LPARAM
)
i
);
added
++
;
}
}
}
static
INT_PTR
CALLBACK
ConfigureDevicesDlgProc
(
HWND
dialog
,
UINT
uMsg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
switch
(
uMsg
)
...
...
@@ -243,6 +279,18 @@ static INT_PTR CALLBACK ConfigureDevicesDlgProc(HWND dialog, UINT uMsg, WPARAM w
break
;
}
case
WM_NOTIFY
:
switch
(((
LPNMHDR
)
lParam
)
->
code
)
{
case
LVN_ITEMCHANGED
:
show_suitable_actions
(
dialog
);
break
;
}
break
;
case
WM_COMMAND
:
switch
(
LOWORD
(
wParam
))
...
...
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