joy.cpl: Added POV axis visualization.

This commit is contained in:
Lucas Zawacki 2012-06-27 00:09:51 -03:00 committed by Alexandre Julliard
parent 22e48becaa
commit d0977a2b8b
48 changed files with 75 additions and 48 deletions

View File

@ -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

View File

@ -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

View File

@ -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++)

View File

@ -3424,7 +3424,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""

View File

@ -3450,7 +3450,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""

View File

@ -3499,7 +3499,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""

View File

@ -3498,7 +3498,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""

View File

@ -3470,7 +3470,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""

View File

@ -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"

View File

@ -3384,7 +3384,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""

View File

@ -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"

View File

@ -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"

View File

@ -3365,7 +3365,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""

View File

@ -3484,7 +3484,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""

View File

@ -3424,7 +3424,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""

View File

@ -3445,7 +3445,7 @@ msgstr "Testaa joystickia"
msgid "Buttons"
msgstr "Painikkeet"
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr "Testaa voimapalautetta"

View File

@ -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"

View File

@ -3452,7 +3452,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""

View File

@ -3362,7 +3362,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""

View File

@ -3486,7 +3486,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""

View File

@ -3499,7 +3499,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""

View File

@ -3442,7 +3442,7 @@ msgstr "ジョイスティックのテスト"
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr "フォース フィードバックのテスト"

View File

@ -3451,7 +3451,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""

View File

@ -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“"

View File

@ -3362,7 +3362,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""

View File

@ -3596,7 +3596,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""

View File

@ -3511,7 +3511,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""

View File

@ -3362,7 +3362,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""

View File

@ -3362,7 +3362,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""

View File

@ -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"

View File

@ -3497,7 +3497,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""

View File

@ -3496,7 +3496,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""

View File

@ -3390,7 +3390,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""

View File

@ -3456,7 +3456,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""

View File

@ -3463,7 +3463,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""

View File

@ -3398,7 +3398,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""

View File

@ -3488,7 +3488,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""

View File

@ -3481,7 +3481,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""

View File

@ -3559,7 +3559,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""

View File

@ -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"

View File

@ -3362,7 +3362,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""

View File

@ -3401,7 +3401,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""

View File

@ -3355,7 +3355,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""

View File

@ -3477,7 +3477,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""

View File

@ -3409,7 +3409,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""

View File

@ -3324,7 +3324,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""

View File

@ -3375,7 +3375,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""

View File

@ -3379,7 +3379,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:58
#: joy.rc:59
msgid "Test Force Feedback"
msgstr ""