Fixed joystick POV values on Windows (PovX and PovY were inverted)
This reverts commit f1c30f106a
, which contained the wrong file, and adds the right modification.
This commit is contained in:
parent
f1c30f106a
commit
ef1d29bf73
@ -167,8 +167,8 @@ JoystickState JoystickImpl::update()
|
|||||||
if (pos.dwPOV != 0xFFFF)
|
if (pos.dwPOV != 0xFFFF)
|
||||||
{
|
{
|
||||||
float angle = pos.dwPOV / 18000.f * 3.141592654f;
|
float angle = pos.dwPOV / 18000.f * 3.141592654f;
|
||||||
state.axes[Joystick::PovX] = std::cos(angle) * 100;
|
state.axes[Joystick::PovX] = std::sin(angle) * 100;
|
||||||
state.axes[Joystick::PovY] = std::sin(angle) * 100;
|
state.axes[Joystick::PovY] = std::cos(angle) * 100;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -40,8 +40,6 @@
|
|||||||
#include <SFML/System/Utf.hpp>
|
#include <SFML/System/Utf.hpp>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
// MinGW lacks the definition of some Win32 constants
|
// MinGW lacks the definition of some Win32 constants
|
||||||
#ifndef XBUTTON1
|
#ifndef XBUTTON1
|
||||||
#define XBUTTON1 0x0001
|
#define XBUTTON1 0x0001
|
||||||
@ -771,8 +769,6 @@ void WindowImplWin32::processEvent(UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
Keyboard::Key WindowImplWin32::virtualKeyCodeToSF(WPARAM key, LPARAM flags)
|
Keyboard::Key WindowImplWin32::virtualKeyCodeToSF(WPARAM key, LPARAM flags)
|
||||||
{
|
{
|
||||||
std::cout << "VM = " << std::hex << key << std::endl;
|
|
||||||
|
|
||||||
switch (key)
|
switch (key)
|
||||||
{
|
{
|
||||||
// Check the scancode to distinguish between left and right shift
|
// Check the scancode to distinguish between left and right shift
|
||||||
|
Loading…
Reference in New Issue
Block a user