joy.cpl: Added a Graphical Axis test.

This commit is contained in:
Lucas Zawacki 2012-06-07 14:44:13 -03:00 committed by Alexandre Julliard
parent fd951a7ec2
commit af55e7dc45
48 changed files with 646 additions and 45 deletions

View File

@ -37,6 +37,7 @@ struct Joystick {
};
#define TEST_MAX_BUTTONS 32
#define TEST_MAX_AXES 3
struct JoystickData {
IDirectInput8W *di;
@ -45,6 +46,7 @@ struct JoystickData {
int cur_joystick;
int chosen_joystick;
HWND buttons[TEST_MAX_BUTTONS];
HWND axes[TEST_MAX_AXES];
BOOL stop;
};
@ -68,6 +70,7 @@ struct JoystickData {
#define IDC_TESTSELECTCOMBO 2004
#define IDC_JOYSTICKBUTTON 3000
#define IDC_JOYSTICKAXES 4000
/* constants */
#define TEST_POLL_TIME 100
@ -80,4 +83,12 @@ struct JoystickData {
#define TEST_BUTTON_SIZE_X 30
#define TEST_BUTTON_SIZE_Y 25
#define TEST_AXIS_X 65
#define TEST_AXIS_Y 98
#define TEST_NEXT_AXIS_X 115
#define TEST_AXIS_SIZE_X 5
#define TEST_AXIS_SIZE_Y 5
#define TEST_AXIS_MIN -40
#define TEST_AXIS_MAX 40
#endif

View File

@ -48,6 +48,9 @@ FONT 8, "Ms Shell Dlg"
{
COMBOBOX IDC_TESTSELECTCOMBO, 5, 5, 100, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS
GROUPBOX "Buttons", IDC_STATIC, 0, 110, 250, 90
GROUPBOX "X,Y", IDC_STATIC, 15, 30, 60, 60
GROUPBOX "Rx,Ry", IDC_STATIC, 92, 30, 60, 60
GROUPBOX "Z, Rz", IDC_STATIC, 169, 30, 60, 60
}
IDD_FORCEFEEDBACK DIALOG 0, 0, 250, 200

View File

@ -194,6 +194,7 @@ static void poll_input(const struct Joystick *joy, DIJOYSTATE *state)
static DWORD WINAPI input_thread(void *param)
{
int axes_pos[TEST_MAX_AXES][2];
DIJOYSTATE state;
struct JoystickData *data = param;
@ -209,6 +210,20 @@ static DWORD WINAPI input_thread(void *param)
if (state.rgbButtons[i])
SendMessageW(data->buttons[i], BM_SETSTATE, TRUE, 0);
/* Indicate axis positions, axes showing are hardcoded for now */
axes_pos[0][0] = state.lX;
axes_pos[0][1] = state.lY;
axes_pos[1][0] = state.lRx;
axes_pos[1][1] = state.lRy;
axes_pos[2][0] = state.lZ;
axes_pos[2][1] = state.lRz;
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],
TEST_AXIS_Y + axes_pos[i][1],
0, 0, SWP_NOZORDER | SWP_NOSIZE);
Sleep(TEST_POLL_TIME);
/* Reset button state */
@ -271,6 +286,37 @@ static void draw_joystick_buttons(HWND hwnd, struct JoystickData* data)
}
}
static void draw_joystick_axes(HWND hwnd, struct JoystickData* data)
{
int i;
struct Joystick *joy;
DIPROPRANGE propRange;
HINSTANCE hinst = (HINSTANCE) GetWindowLongPtrW(hwnd, GWLP_HINSTANCE);
static WCHAR button_class[] = {'B','u','t','t','o','n','\0'};
/* Set axis range to ease the GUI visualization */
for (i = 0; i < data->num_joysticks; i++)
{
joy = &data->joysticks[i];
propRange.diph.dwSize = sizeof(DIPROPRANGE);
propRange.diph.dwHeaderSize = sizeof(DIPROPHEADER);
propRange.diph.dwHow = DIPH_DEVICE;
propRange.diph.dwObj = 0;
propRange.lMin = TEST_AXIS_MIN;
propRange.lMax = TEST_AXIS_MAX;
IDirectInputDevice_SetProperty(joy->device, DIPROP_RANGE, &propRange.diph);
}
for (i = 0; i < TEST_MAX_AXES; i++)
{
data->axes[i] = CreateWindowW( button_class, NULL, WS_CHILD | WS_VISIBLE,
TEST_AXIS_X + TEST_NEXT_AXIS_X*i, TEST_AXIS_Y,
TEST_AXIS_SIZE_X, TEST_AXIS_SIZE_Y,
hwnd, (HMENU) IDC_JOYSTICKAXES + i, NULL, hinst);
}
}
/*********************************************************************
* test_dlgproc [internal]
*
@ -297,6 +343,7 @@ static INT_PTR CALLBACK test_dlgproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM
}
draw_joystick_buttons(hwnd, data);
draw_joystick_axes(hwnd, data);
return TRUE;
}

View File

@ -3424,7 +3424,19 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:55
#: joy.rc:51
msgid "X,Y"
msgstr ""
#: joy.rc:52
msgid "Rx,Ry"
msgstr ""
#: joy.rc:53
msgid "Z, Rz"
msgstr ""
#: joy.rc:58
msgid "Test Force Feedback"
msgstr ""

View File

@ -3450,7 +3450,19 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:55
#: joy.rc:51
msgid "X,Y"
msgstr ""
#: joy.rc:52
msgid "Rx,Ry"
msgstr ""
#: joy.rc:53
msgid "Z, Rz"
msgstr ""
#: joy.rc:58
msgid "Test Force Feedback"
msgstr ""

View File

@ -3494,7 +3494,19 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:55
#: joy.rc:51
msgid "X,Y"
msgstr ""
#: joy.rc:52
msgid "Rx,Ry"
msgstr ""
#: joy.rc:53
msgid "Z, Rz"
msgstr ""
#: joy.rc:58
msgid "Test Force Feedback"
msgstr ""

View File

@ -3498,7 +3498,19 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:55
#: joy.rc:51
msgid "X,Y"
msgstr ""
#: joy.rc:52
msgid "Rx,Ry"
msgstr ""
#: joy.rc:53
msgid "Z, Rz"
msgstr ""
#: joy.rc:58
msgid "Test Force Feedback"
msgstr ""

View File

@ -3470,7 +3470,19 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:55
#: joy.rc:51
msgid "X,Y"
msgstr ""
#: joy.rc:52
msgid "Rx,Ry"
msgstr ""
#: joy.rc:53
msgid "Z, Rz"
msgstr ""
#: joy.rc:58
msgid "Test Force Feedback"
msgstr ""

View File

@ -3457,7 +3457,19 @@ msgstr "Joystick testen"
msgid "Buttons"
msgstr ""
#: joy.rc:55
#: joy.rc:51
msgid "X,Y"
msgstr ""
#: joy.rc:52
msgid "Rx,Ry"
msgstr ""
#: joy.rc:53
msgid "Z, Rz"
msgstr ""
#: joy.rc:58
msgid "Test Force Feedback"
msgstr "Force Feedback testen"

View File

@ -3384,7 +3384,19 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:55
#: joy.rc:51
msgid "X,Y"
msgstr ""
#: joy.rc:52
msgid "Rx,Ry"
msgstr ""
#: joy.rc:53
msgid "Z, Rz"
msgstr ""
#: joy.rc:58
msgid "Test Force Feedback"
msgstr ""

View File

@ -3448,7 +3448,19 @@ msgstr "Test Joystick"
msgid "Buttons"
msgstr "Buttons"
#: joy.rc:55
#: joy.rc:51
msgid "X,Y"
msgstr "X,Y"
#: joy.rc:52
msgid "Rx,Ry"
msgstr "Rx,Ry"
#: joy.rc:53
msgid "Z, Rz"
msgstr "Z, Rz"
#: joy.rc:58
msgid "Test Force Feedback"
msgstr "Test Force Feedback"

View File

@ -3450,7 +3450,19 @@ msgstr "Test Joystick"
msgid "Buttons"
msgstr "Buttons"
#: joy.rc:55
#: joy.rc:51
msgid "X,Y"
msgstr "X,Y"
#: joy.rc:52
msgid "Rx,Ry"
msgstr "Rx,Ry"
#: joy.rc:53
msgid "Z, Rz"
msgstr "Z, Rz"
#: joy.rc:58
msgid "Test Force Feedback"
msgstr "Test Force Feedback"

View File

@ -3360,7 +3360,19 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:55
#: joy.rc:51
msgid "X,Y"
msgstr ""
#: joy.rc:52
msgid "Rx,Ry"
msgstr ""
#: joy.rc:53
msgid "Z, Rz"
msgstr ""
#: joy.rc:58
msgid "Test Force Feedback"
msgstr ""

View File

@ -3484,7 +3484,19 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:55
#: joy.rc:51
msgid "X,Y"
msgstr ""
#: joy.rc:52
msgid "Rx,Ry"
msgstr ""
#: joy.rc:53
msgid "Z, Rz"
msgstr ""
#: joy.rc:58
msgid "Test Force Feedback"
msgstr ""

View File

@ -3424,7 +3424,19 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:55
#: joy.rc:51
msgid "X,Y"
msgstr ""
#: joy.rc:52
msgid "Rx,Ry"
msgstr ""
#: joy.rc:53
msgid "Z, Rz"
msgstr ""
#: joy.rc:58
msgid "Test Force Feedback"
msgstr ""

View File

@ -3445,7 +3445,19 @@ msgstr "Testaa joystickia"
msgid "Buttons"
msgstr ""
#: joy.rc:55
#: joy.rc:51
msgid "X,Y"
msgstr ""
#: joy.rc:52
msgid "Rx,Ry"
msgstr ""
#: joy.rc:53
msgid "Z, Rz"
msgstr ""
#: joy.rc:58
msgid "Test Force Feedback"
msgstr "Testaa voimapalautetta"

View File

@ -3480,7 +3480,19 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:55
#: joy.rc:51
msgid "X,Y"
msgstr ""
#: joy.rc:52
msgid "Rx,Ry"
msgstr ""
#: joy.rc:53
msgid "Z, Rz"
msgstr ""
#: joy.rc:58
msgid "Test Force Feedback"
msgstr ""

View File

@ -3447,7 +3447,19 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:55
#: joy.rc:51
msgid "X,Y"
msgstr ""
#: joy.rc:52
msgid "Rx,Ry"
msgstr ""
#: joy.rc:53
msgid "Z, Rz"
msgstr ""
#: joy.rc:58
msgid "Test Force Feedback"
msgstr ""

View File

@ -3362,7 +3362,19 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:55
#: joy.rc:51
msgid "X,Y"
msgstr ""
#: joy.rc:52
msgid "Rx,Ry"
msgstr ""
#: joy.rc:53
msgid "Z, Rz"
msgstr ""
#: joy.rc:58
msgid "Test Force Feedback"
msgstr ""

View File

@ -3486,7 +3486,19 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:55
#: joy.rc:51
msgid "X,Y"
msgstr ""
#: joy.rc:52
msgid "Rx,Ry"
msgstr ""
#: joy.rc:53
msgid "Z, Rz"
msgstr ""
#: joy.rc:58
msgid "Test Force Feedback"
msgstr ""

View File

@ -3494,7 +3494,19 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:55
#: joy.rc:51
msgid "X,Y"
msgstr ""
#: joy.rc:52
msgid "Rx,Ry"
msgstr ""
#: joy.rc:53
msgid "Z, Rz"
msgstr ""
#: joy.rc:58
msgid "Test Force Feedback"
msgstr ""

View File

@ -3442,7 +3442,19 @@ msgstr "ジョイスティックのテスト"
msgid "Buttons"
msgstr ""
#: joy.rc:55
#: joy.rc:51
msgid "X,Y"
msgstr ""
#: joy.rc:52
msgid "Rx,Ry"
msgstr ""
#: joy.rc:53
msgid "Z, Rz"
msgstr ""
#: joy.rc:58
msgid "Test Force Feedback"
msgstr "フォース フィードバックのテスト"

View File

@ -3446,7 +3446,19 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:55
#: joy.rc:51
msgid "X,Y"
msgstr ""
#: joy.rc:52
msgid "Rx,Ry"
msgstr ""
#: joy.rc:53
msgid "Z, Rz"
msgstr ""
#: joy.rc:58
msgid "Test Force Feedback"
msgstr ""

View File

@ -3464,7 +3464,19 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:55
#: joy.rc:51
msgid "X,Y"
msgstr ""
#: joy.rc:52
msgid "Rx,Ry"
msgstr ""
#: joy.rc:53
msgid "Z, Rz"
msgstr ""
#: joy.rc:58
msgid "Test Force Feedback"
msgstr ""

View File

@ -3362,7 +3362,19 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:55
#: joy.rc:51
msgid "X,Y"
msgstr ""
#: joy.rc:52
msgid "Rx,Ry"
msgstr ""
#: joy.rc:53
msgid "Z, Rz"
msgstr ""
#: joy.rc:58
msgid "Test Force Feedback"
msgstr ""

View File

@ -3619,7 +3619,19 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:55
#: joy.rc:51
msgid "X,Y"
msgstr ""
#: joy.rc:52
msgid "Rx,Ry"
msgstr ""
#: joy.rc:53
msgid "Z, Rz"
msgstr ""
#: joy.rc:58
msgid "Test Force Feedback"
msgstr ""

View File

@ -3511,7 +3511,19 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:55
#: joy.rc:51
msgid "X,Y"
msgstr ""
#: joy.rc:52
msgid "Rx,Ry"
msgstr ""
#: joy.rc:53
msgid "Z, Rz"
msgstr ""
#: joy.rc:58
msgid "Test Force Feedback"
msgstr ""

View File

@ -3362,7 +3362,19 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:55
#: joy.rc:51
msgid "X,Y"
msgstr ""
#: joy.rc:52
msgid "Rx,Ry"
msgstr ""
#: joy.rc:53
msgid "Z, Rz"
msgstr ""
#: joy.rc:58
msgid "Test Force Feedback"
msgstr ""

View File

@ -3362,7 +3362,19 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:55
#: joy.rc:51
msgid "X,Y"
msgstr ""
#: joy.rc:52
msgid "Rx,Ry"
msgstr ""
#: joy.rc:53
msgid "Z, Rz"
msgstr ""
#: joy.rc:58
msgid "Test Force Feedback"
msgstr ""

View File

@ -3488,7 +3488,19 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:55
#: joy.rc:51
msgid "X,Y"
msgstr ""
#: joy.rc:52
msgid "Rx,Ry"
msgstr ""
#: joy.rc:53
msgid "Z, Rz"
msgstr ""
#: joy.rc:58
msgid "Test Force Feedback"
msgstr ""

View File

@ -3492,7 +3492,19 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:55
#: joy.rc:51
msgid "X,Y"
msgstr ""
#: joy.rc:52
msgid "Rx,Ry"
msgstr ""
#: joy.rc:53
msgid "Z, Rz"
msgstr ""
#: joy.rc:58
msgid "Test Force Feedback"
msgstr ""

View File

@ -3491,7 +3491,19 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:55
#: joy.rc:51
msgid "X,Y"
msgstr ""
#: joy.rc:52
msgid "Rx,Ry"
msgstr ""
#: joy.rc:53
msgid "Z, Rz"
msgstr ""
#: joy.rc:58
msgid "Test Force Feedback"
msgstr ""

View File

@ -3390,7 +3390,19 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:55
#: joy.rc:51
msgid "X,Y"
msgstr ""
#: joy.rc:52
msgid "Rx,Ry"
msgstr ""
#: joy.rc:53
msgid "Z, Rz"
msgstr ""
#: joy.rc:58
msgid "Test Force Feedback"
msgstr ""

View File

@ -3451,7 +3451,19 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:55
#: joy.rc:51
msgid "X,Y"
msgstr ""
#: joy.rc:52
msgid "Rx,Ry"
msgstr ""
#: joy.rc:53
msgid "Z, Rz"
msgstr ""
#: joy.rc:58
msgid "Test Force Feedback"
msgstr ""

View File

@ -3463,7 +3463,19 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:55
#: joy.rc:51
msgid "X,Y"
msgstr ""
#: joy.rc:52
msgid "Rx,Ry"
msgstr ""
#: joy.rc:53
msgid "Z, Rz"
msgstr ""
#: joy.rc:58
msgid "Test Force Feedback"
msgstr ""

View File

@ -3393,7 +3393,19 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:55
#: joy.rc:51
msgid "X,Y"
msgstr ""
#: joy.rc:52
msgid "Rx,Ry"
msgstr ""
#: joy.rc:53
msgid "Z, Rz"
msgstr ""
#: joy.rc:58
msgid "Test Force Feedback"
msgstr ""

View File

@ -3483,7 +3483,19 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:55
#: joy.rc:51
msgid "X,Y"
msgstr ""
#: joy.rc:52
msgid "Rx,Ry"
msgstr ""
#: joy.rc:53
msgid "Z, Rz"
msgstr ""
#: joy.rc:58
msgid "Test Force Feedback"
msgstr ""

View File

@ -3481,7 +3481,19 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:55
#: joy.rc:51
msgid "X,Y"
msgstr ""
#: joy.rc:52
msgid "Rx,Ry"
msgstr ""
#: joy.rc:53
msgid "Z, Rz"
msgstr ""
#: joy.rc:58
msgid "Test Force Feedback"
msgstr ""

View File

@ -3559,7 +3559,19 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:55
#: joy.rc:51
msgid "X,Y"
msgstr ""
#: joy.rc:52
msgid "Rx,Ry"
msgstr ""
#: joy.rc:53
msgid "Z, Rz"
msgstr ""
#: joy.rc:58
msgid "Test Force Feedback"
msgstr ""

View File

@ -3440,7 +3440,19 @@ msgstr "Testa joysticken"
msgid "Buttons"
msgstr ""
#: joy.rc:55
#: joy.rc:51
msgid "X,Y"
msgstr ""
#: joy.rc:52
msgid "Rx,Ry"
msgstr ""
#: joy.rc:53
msgid "Z, Rz"
msgstr ""
#: joy.rc:58
msgid "Test Force Feedback"
msgstr "Testa kraftåterkoppling"

View File

@ -3362,7 +3362,19 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:55
#: joy.rc:51
msgid "X,Y"
msgstr ""
#: joy.rc:52
msgid "Rx,Ry"
msgstr ""
#: joy.rc:53
msgid "Z, Rz"
msgstr ""
#: joy.rc:58
msgid "Test Force Feedback"
msgstr ""

View File

@ -3401,7 +3401,19 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:55
#: joy.rc:51
msgid "X,Y"
msgstr ""
#: joy.rc:52
msgid "Rx,Ry"
msgstr ""
#: joy.rc:53
msgid "Z, Rz"
msgstr ""
#: joy.rc:58
msgid "Test Force Feedback"
msgstr ""

View File

@ -3355,7 +3355,19 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:55
#: joy.rc:51
msgid "X,Y"
msgstr ""
#: joy.rc:52
msgid "Rx,Ry"
msgstr ""
#: joy.rc:53
msgid "Z, Rz"
msgstr ""
#: joy.rc:58
msgid "Test Force Feedback"
msgstr ""

View File

@ -3477,7 +3477,19 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:55
#: joy.rc:51
msgid "X,Y"
msgstr ""
#: joy.rc:52
msgid "Rx,Ry"
msgstr ""
#: joy.rc:53
msgid "Z, Rz"
msgstr ""
#: joy.rc:58
msgid "Test Force Feedback"
msgstr ""

View File

@ -3409,7 +3409,19 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:55
#: joy.rc:51
msgid "X,Y"
msgstr ""
#: joy.rc:52
msgid "Rx,Ry"
msgstr ""
#: joy.rc:53
msgid "Z, Rz"
msgstr ""
#: joy.rc:58
msgid "Test Force Feedback"
msgstr ""

View File

@ -3324,7 +3324,19 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:55
#: joy.rc:51
msgid "X,Y"
msgstr ""
#: joy.rc:52
msgid "Rx,Ry"
msgstr ""
#: joy.rc:53
msgid "Z, Rz"
msgstr ""
#: joy.rc:58
msgid "Test Force Feedback"
msgstr ""

View File

@ -3370,7 +3370,19 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:55
#: joy.rc:51
msgid "X,Y"
msgstr ""
#: joy.rc:52
msgid "Rx,Ry"
msgstr ""
#: joy.rc:53
msgid "Z, Rz"
msgstr ""
#: joy.rc:58
msgid "Test Force Feedback"
msgstr ""

View File

@ -3374,7 +3374,19 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: joy.rc:55
#: joy.rc:51
msgid "X,Y"
msgstr ""
#: joy.rc:52
msgid "Rx,Ry"
msgstr ""
#: joy.rc:53
msgid "Z, Rz"
msgstr ""
#: joy.rc:58
msgid "Test Force Feedback"
msgstr ""