Commit d0977a2b authored by Lucas Zawacki's avatar Lucas Zawacki Committed by Alexandre Julliard

joy.cpl: Added POV axis visualization.

parent 22e48bec
......@@ -37,7 +37,7 @@ struct Joystick {
};
#define TEST_MAX_BUTTONS 32
#define TEST_MAX_AXES 3
#define TEST_MAX_AXES 4
struct JoystickData {
IDirectInput8W *di;
......@@ -71,6 +71,7 @@ struct JoystickData {
#define IDC_TESTGROUPXY 2005
#define IDC_TESTGROUPRXRY 2006
#define IDC_TESTGROUPZRZ 2007
#define IDC_TESTGROUPPOV 2008
#define IDC_JOYSTICKBUTTON 3000
#define IDC_JOYSTICKAXES 4000
......
......@@ -51,6 +51,7 @@ FONT 8, "Ms Shell Dlg"
GROUPBOX "", IDC_TESTGROUPXY, 15, 30, 60, 60
GROUPBOX "", IDC_TESTGROUPRXRY, 92, 30, 60, 60
GROUPBOX "", IDC_TESTGROUPZRZ, 169, 30, 60, 60
GROUPBOX "", IDC_TESTGROUPPOV, 246, 30, 60, 60
}
IDD_FORCEFEEDBACK DIALOG 0, 0, 320, 220
......
......@@ -212,6 +212,19 @@ static DWORD WINAPI input_thread(void *param)
DIJOYSTATE state;
struct JoystickData *data = param;
/* Setup POV as clock positions
* 0
* 31500 4500
* 27000 -1 9000
* 22500 13500
* 18000
*/
int ma = TEST_AXIS_MAX;
int pov_val[9] = {0, 4500, 9000, 13500,
18000, 22500, 27000, 31500, -1};
int pov_pos[9][2] = { {0, -ma}, {ma/2, -ma/2}, {ma, 0}, {ma/2, ma/2},
{0, ma}, {-ma/2, ma/2}, {-ma, 0}, {-ma/2, -ma/2}, {0, 0} };
ZeroMemory(&state, sizeof(state));
while (!data->stop)
......@@ -234,6 +247,16 @@ static DWORD WINAPI input_thread(void *param)
axes_pos[2][0] = state.lZ;
axes_pos[2][1] = state.lRz;
/* Set pov values */
for (i = 0; i < sizeof(pov_val)/sizeof(pov_val[0]); i++)
{
if (state.rgdwPOV[0] == pov_val[i])
{
axes_pos[3][0] = pov_pos[i][0];
axes_pos[3][1] = pov_pos[i][1];
}
}
for (i = 0; i < TEST_MAX_AXES; i++)
SetWindowPos(data->axes[i], 0,
TEST_AXIS_X + TEST_NEXT_AXIS_X*i + axes_pos[i][0],
......@@ -309,8 +332,10 @@ static void draw_joystick_axes(HWND hwnd, struct JoystickData* data)
DIPROPRANGE propRange;
HINSTANCE hinst = (HINSTANCE) GetWindowLongPtrW(hwnd, GWLP_HINSTANCE);
static const WCHAR button_class[] = {'B','u','t','t','o','n','\0'};
static const WCHAR axes_names[TEST_MAX_AXES][7] = { {'X',',','Y','\0'}, {'R','x',',','R','y','\0'}, {'Z',',','R','z','\0'} };
static const DWORD axes_idc[TEST_MAX_AXES] = { IDC_TESTGROUPXY, IDC_TESTGROUPRXRY, IDC_TESTGROUPZRZ };
static const WCHAR axes_names[TEST_MAX_AXES][7] = { {'X',',','Y','\0'}, {'R','x',',','R','y','\0'},
{'Z',',','R','z','\0'}, {'P','O','V','\0'} };
static const DWORD axes_idc[TEST_MAX_AXES] = { IDC_TESTGROUPXY, IDC_TESTGROUPRXRY,
IDC_TESTGROUPZRZ, IDC_TESTGROUPPOV };
/* Set axis range to ease the GUI visualization */
for (i = 0; i < data->num_joysticks; i++)
......
......@@ -3424,7 +3424,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""
......
......@@ -3450,7 +3450,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""
......
......@@ -3499,7 +3499,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""
......
......@@ -3498,7 +3498,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""
......
......@@ -3470,7 +3470,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""
......
......@@ -3457,7 +3457,7 @@ msgstr "Joystick testen"
msgid "Buttons"
msgstr "Tasten"
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr "Force Feedback testen"
......
......@@ -3384,7 +3384,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""
......
......@@ -3448,7 +3448,7 @@ msgstr "Test Joystick"
msgid "Buttons"
msgstr "Buttons"
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr "Test Force Feedback"
......
......@@ -3450,7 +3450,7 @@ msgstr "Test Joystick"
msgid "Buttons"
msgstr "Buttons"
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr "Test Force Feedback"
......
......@@ -3365,7 +3365,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""
......
......@@ -3484,7 +3484,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""
......
......@@ -3424,7 +3424,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""
......
......@@ -3445,7 +3445,7 @@ msgstr "Testaa joystickia"
msgid "Buttons"
msgstr "Painikkeet"
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr "Testaa voimapalautetta"
......
......@@ -3474,7 +3474,7 @@ msgstr "Tester le joystick"
msgid "Buttons"
msgstr "Boutons"
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr "Tester le retour de force"
......
......@@ -3452,7 +3452,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""
......
......@@ -3362,7 +3362,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""
......
......@@ -3486,7 +3486,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""
......
......@@ -3499,7 +3499,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""
......
......@@ -3442,7 +3442,7 @@ msgstr "ジョイスティックのテスト"
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr "フォース フィードバックのテスト"
......
......@@ -3451,7 +3451,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""
......
......@@ -3458,7 +3458,7 @@ msgstr "Testuoti vairasvirtę"
msgid "Buttons"
msgstr "Mygtukai"
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr "Testuoti „Force Feedback“"
......
......@@ -3362,7 +3362,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""
......
......@@ -3596,7 +3596,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""
......
......@@ -3511,7 +3511,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""
......
......@@ -3362,7 +3362,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""
......
......@@ -3362,7 +3362,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""
......
......@@ -3470,7 +3470,7 @@ msgstr "Testuj Joystick"
msgid "Buttons"
msgstr "Przyciski"
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr "Testuj odczucie siły zwrotnej"
......
......@@ -3497,7 +3497,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""
......
......@@ -3496,7 +3496,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""
......
......@@ -3390,7 +3390,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""
......
......@@ -3456,7 +3456,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""
......
......@@ -3463,7 +3463,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""
......
......@@ -3398,7 +3398,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""
......
......@@ -3488,7 +3488,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""
......
......@@ -3481,7 +3481,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""
......
......@@ -3559,7 +3559,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""
......
......@@ -3440,7 +3440,7 @@ msgstr "Testa joysticken"
msgid "Buttons"
msgstr "Knappar"
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr "Testa kraftåterkoppling"
......
......@@ -3362,7 +3362,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""
......
......@@ -3401,7 +3401,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""
......
......@@ -3355,7 +3355,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""
......
......@@ -3477,7 +3477,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""
......
......@@ -3409,7 +3409,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""
......
......@@ -3324,7 +3324,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""
......
......@@ -3375,7 +3375,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""
......
......@@ -3379,7 +3379,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment