mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
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
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ protected:
|
||||
friend class Keyboard;
|
||||
|
||||
protected:
|
||||
virtual ControlState GetState(const State* const state) = 0;
|
||||
virtual ControlState GetState(const State* const state) const = 0;
|
||||
};
|
||||
|
||||
class Key : public Input
|
||||
@ -42,7 +42,7 @@ protected:
|
||||
|
||||
protected:
|
||||
Key(Display* const display, KeyCode keycode);
|
||||
ControlState GetState(const State* const state);
|
||||
ControlState GetState(const State* const state) const;
|
||||
|
||||
private:
|
||||
Display* const m_display;
|
||||
@ -60,7 +60,7 @@ protected:
|
||||
|
||||
protected:
|
||||
Button(const unsigned int index) : m_index(index) {}
|
||||
ControlState GetState(const State* const state);
|
||||
ControlState GetState(const State* const state) const;
|
||||
|
||||
private:
|
||||
const unsigned int m_index;
|
||||
@ -69,7 +69,7 @@ protected:
|
||||
bool UpdateInput();
|
||||
bool UpdateOutput();
|
||||
|
||||
ControlState GetInputState(const ControllerInterface::Device::Input* const input);
|
||||
ControlState GetInputState(const ControllerInterface::Device::Input* const input) const;
|
||||
void SetOutputState(const ControllerInterface::Device::Output* const output, const ControlState state);
|
||||
|
||||
public:
|
||||
|
Reference in New Issue
Block a user