summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/Src/ControllerInterface/Xlib/Xlib.cpp
diff options
context:
space:
mode:
authorJordan Woyak <jordan.woyak@gmail.com>2010-06-21 03:12:16 +0000
committerJordan Woyak <jordan.woyak@gmail.com>2010-06-21 03:12:16 +0000
commit9e3b65368873fd26f21e2568b2c67d00ec96d6a5 (patch)
treeb5eff0d77ae7e4327069116f6440dcc2a70a1a5f /Source/Core/InputCommon/Src/ControllerInterface/Xlib/Xlib.cpp
parentfde15c1bc633792bead817b2f87faf54477765b5 (diff)
GCPad/New Wiimote Plugin: Individual keyboard and mouse devices are now listed on Windows(2 player with 2 keyboards possible). Improved the ability to map multiple inputs to the same control. Inputs from different devices can be mapped to the same button (example: Mouse Left and XInput A). More advanced mappings such as "Button 1 or 2 and NOT button 3" are possible. I hope the GUI after right clicking a button isn't too confusing(may change it to be a bit more user friendly). Hopefully, I didn't break OSX stuff by 'const'ing a few functions.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5757 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/InputCommon/Src/ControllerInterface/Xlib/Xlib.cpp')
-rw-r--r--Source/Core/InputCommon/Src/ControllerInterface/Xlib/Xlib.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/Source/Core/InputCommon/Src/ControllerInterface/Xlib/Xlib.cpp b/Source/Core/InputCommon/Src/ControllerInterface/Xlib/Xlib.cpp
index a2396ae9ea..0eac61eac2 100644
--- a/Source/Core/InputCommon/Src/ControllerInterface/Xlib/Xlib.cpp
+++ b/Source/Core/InputCommon/Src/ControllerInterface/Xlib/Xlib.cpp
@@ -26,17 +26,17 @@ Keyboard::Keyboard(Display* display) : m_display(display)
{
Key *temp_key = new Key(m_display, i);
if (temp_key->m_keyname.length())
- inputs.push_back(temp_key);
+ AddInput(temp_key);
else
delete temp_key;
}
// Mouse Buttons
- inputs.push_back(new Button(Button1Mask));
- inputs.push_back(new Button(Button2Mask));
- inputs.push_back(new Button(Button3Mask));
- inputs.push_back(new Button(Button4Mask));
- inputs.push_back(new Button(Button5Mask));
+ AddInput(new Button(Button1Mask));
+ AddInput(new Button(Button2Mask));
+ AddInput(new Button(Button3Mask));
+ AddInput(new Button(Button4Mask));
+ AddInput(new Button(Button5Mask));
}
Keyboard::~Keyboard()
@@ -44,7 +44,7 @@ Keyboard::~Keyboard()
}
-ControlState Keyboard::GetInputState(const ControllerInterface::Device::Input* const input)
+ControlState Keyboard::GetInputState(const ControllerInterface::Device::Input* const input) const
{
return ((Input*)input)->GetState(&m_state);
}
@@ -112,12 +112,12 @@ Keyboard::Key::Key(Display* const display, KeyCode keycode)
m_keyname = std::string(XKeysymToString(keysym));
}
-ControlState Keyboard::Key::GetState(const State* const state)
+ControlState Keyboard::Key::GetState(const State* const state) const
{
return (state->keyboard[m_keycode/8] & (1 << (m_keycode%8))) != 0;
}
-ControlState Keyboard::Button::GetState(const State* const state)
+ControlState Keyboard::Button::GetState(const State* const state) const
{
return ((state->buttons & m_index) > 0);
}