diff options
| author | NeoBrainX <NeoBrainX@gmail.com> | 2013-04-25 14:01:07 +0200 |
|---|---|---|
| committer | NeoBrainX <NeoBrainX@gmail.com> | 2013-04-25 14:05:54 +0200 |
| commit | 5e6b712651dc042b06ce59bcfb4becda5ee15022 (patch) | |
| tree | c82731464d76517cce5ffb6d7e9764c47a433804 /Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputKeyboardMouse.cpp | |
| parent | eef95fa4c5919bf93335e10dd61cd5a9fd6a5f6d (diff) | |
| parent | d18b71ccf91c9578236b44ae26e8bc35314cc180 (diff) | |
Merge 'master' into shader-uids-awesome.
Conflicts:
Source/Core/VideoCommon/Src/BPMemory.h
Source/Core/VideoCommon/Src/LightingShaderGen.cpp
Source/Core/VideoCommon/Src/PixelShaderGen.cpp
Source/Core/VideoCommon/Src/PixelShaderGen.h
Source/Core/VideoCommon/Src/PixelShaderManager.cpp
Source/Core/VideoCommon/Src/VertexShaderGen.cpp
Source/Core/VideoCommon/Src/VertexShaderGen.h
Diffstat (limited to 'Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputKeyboardMouse.cpp')
| -rw-r--r-- | Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputKeyboardMouse.cpp | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputKeyboardMouse.cpp b/Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputKeyboardMouse.cpp index aea12c065c..ea6452376d 100644 --- a/Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputKeyboardMouse.cpp +++ b/Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputKeyboardMouse.cpp @@ -6,7 +6,7 @@ #include "DInput.h" // (lower would be more sensitive) user can lower sensitivity by setting range - // seems decent here ( at 8 ), I dont think anyone would need more sensitive than this + // seems decent here ( at 8 ), I don't think anyone would need more sensitive than this // and user can lower it much farther than they would want to with the range #define MOUSE_AXIS_SENSITIVITY 8 @@ -47,7 +47,7 @@ void InitKeyboardMouse(IDirectInput8* const idi8, std::vector<ControllerInterfac hwnd = _hwnd; // mouse and keyboard are a combined device, to allow shift+click and stuff - // if thats dumb, i will make a VirtualDevice class that just uses ranges of inputs/outputs from other devices + // if that's dumb, I will make a VirtualDevice class that just uses ranges of inputs/outputs from other devices // so there can be a separated Keyboard and mouse, as well as combined KeyboardMouse LPDIRECTINPUTDEVICE8 kb_device = NULL; @@ -56,15 +56,19 @@ void InitKeyboardMouse(IDirectInput8* const idi8, std::vector<ControllerInterfac if (SUCCEEDED(idi8->CreateDevice( GUID_SysKeyboard, &kb_device, NULL))) { if (SUCCEEDED(kb_device->SetDataFormat(&c_dfDIKeyboard))) - if (SUCCEEDED(kb_device->SetCooperativeLevel(NULL, DISCL_BACKGROUND | DISCL_NONEXCLUSIVE))) { - if (SUCCEEDED(idi8->CreateDevice( GUID_SysMouse, &mo_device, NULL ))) + if (SUCCEEDED(kb_device->SetCooperativeLevel(NULL, DISCL_BACKGROUND | DISCL_NONEXCLUSIVE))) { - if (SUCCEEDED(mo_device->SetDataFormat(&c_dfDIMouse2))) - if (SUCCEEDED(mo_device->SetCooperativeLevel(NULL, DISCL_BACKGROUND | DISCL_NONEXCLUSIVE))) + if (SUCCEEDED(idi8->CreateDevice( GUID_SysMouse, &mo_device, NULL ))) { - devices.push_back(new KeyboardMouse(kb_device, mo_device)); - return; + if (SUCCEEDED(mo_device->SetDataFormat(&c_dfDIMouse2))) + { + if (SUCCEEDED(mo_device->SetCooperativeLevel(NULL, DISCL_BACKGROUND | DISCL_NONEXCLUSIVE))) + { + devices.push_back(new KeyboardMouse(kb_device, mo_device)); + return; + } + } } } } @@ -177,7 +181,7 @@ bool KeyboardMouse::UpdateInput() if (SUCCEEDED(kb_hr) && SUCCEEDED(mo_hr)) { - // need to smooth out the axes, otherwise it doesnt work for shit + // need to smooth out the axes, otherwise it doesn't work for shit for (unsigned int i = 0; i < 3; ++i) ((&m_state_in.mouse.lX)[i] += (&tmp_mouse.lX)[i]) /= 2; @@ -203,7 +207,9 @@ bool KeyboardMouse::UpdateOutput() memset( this, 0, sizeof(*this) ); type = INPUT_KEYBOARD; ki.wVk = key; - if (up) ki.dwFlags = KEYEVENTF_KEYUP; + + if (up) + ki.dwFlags = KEYEVENTF_KEYUP; } }; |
