i would like to read the movements of the mouse so then i can read out a proper response such as if i move the mouse to the right it prints mouse moved to the right and same for left. where i need help is where i put "help here"
#include <iostream>
#include <Windows.h>
#define WINDOW_POS_X 0
#define WINDOW_PoS_Y 0
usingnamespace std;
int main()
{
cout << "Running Keyboard Drive Train Prototype" << endl;
while (true)
{
Sleep(10);
//full speed forward
if (GetAsyncKeyState(0x57) && !(GetAsyncKeyState(VK_SHIFT)))
{
cout << "Robot moving forward at full speed" << endl;
}
//full speed back
if (GetAsyncKeyState(0x53) && !(GetAsyncKeyState(VK_SHIFT)))
{
cout << "Robot moving back at full speed" << endl;
}
//full speed straf right
if (GetAsyncKeyState(0x44) && !(GetAsyncKeyState(VK_SHIFT)))
{
cout << "Robot strafing right at full speed" << endl;
}
//full speed straf left
if (GetAsyncKeyState(0x41) && !(GetAsyncKeyState(VK_SHIFT)))
{
cout << "Robot strafing left at full speed" << endl;
}
//full speed rotate right help here
if (WM_NCMOUSEMOVE(left) && !(GetAsyncKeyState(VK_SHIFT)))
{
cout << "Robot rotationg right" << endl;
}
//full speed rotate left help here
if (WM_NCMOUSEMOVE(left) && !(GetAsyncKeyState(VK_SHIFT)))
{
cout << "Robot rotationg right" << endl;
}
//half speed forward
if (GetAsyncKeyState(0x57) && (GetAsyncKeyState(VK_SHIFT)))
{
cout << "Robot moving forward at half speed" << endl;
}
//half speed back
if (GetAsyncKeyState(0x53) && (GetAsyncKeyState(VK_SHIFT)))
{
cout << "Robot moving back at half speed" << endl;
}
//half speed straf right
if (GetAsyncKeyState(0x44) && (GetAsyncKeyState(VK_SHIFT)))
{
cout << "Robot strafing right at half speed" << endl;
}
//half speed straf left
if (GetAsyncKeyState(0x41) && (GetAsyncKeyState(VK_SHIFT)))
{
cout << "Robot strafing left at half speed" << endl;
}
//half speed rotate right help here
if (WM_NCMOUSEMOVE(right) && (GetAsyncKeyState(VK_SHIFT)))
{
cout << "Robot rotationg right" << endl;
}
//half speed rotate left help here
if (WM_NCMOUSEMOVE(left) && (GetAsyncKeyState(VK_SHIFT)))
{
cout << "Robot rotationg right" << endl;
}
}
}
//w = forward full speed
//s = back full speed
//d = straf right full speed
//a = straf left full speed
//mouse right = rotate right full speed
//mouse left = rotate left full speed
//w + shif = forward half speed
//s + shif = back half speed
//d + shif = straf right half speed
//a + shif = straf left half speed
//mouse right + shif = rotate right half speed
//mouse left + shift = rotate left half speed