KEYMAPPER: Enable remapping of the mouse buttons
This commit is contained in:
parent
519b4a57e2
commit
e973092aef
9 changed files with 161 additions and 44 deletions
|
@ -217,6 +217,13 @@ const ModifierTableEntry defaultModifiers[] = {
|
||||||
{ 0, nullptr, nullptr }
|
{ 0, nullptr, nullptr }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const HardwareInputTableEntry defaultMouseButtons[] = {
|
||||||
|
{ "MOUSE_LEFT", MOUSE_BUTTON_LEFT, _s("Left Mouse Button") },
|
||||||
|
{ "MOUSE_RIGHT", MOUSE_BUTTON_RIGHT, _s("Right Mouse Button") },
|
||||||
|
{ "MOUSE_MIDDLE", MOUSE_BUTTON_MIDDLE, _s("Middle Mouse Button") },
|
||||||
|
{ nullptr, 0, nullptr }
|
||||||
|
};
|
||||||
|
|
||||||
const HardwareInputTableEntry defaultJoystickButtons[] = {
|
const HardwareInputTableEntry defaultJoystickButtons[] = {
|
||||||
{ "JOY_A", JOYSTICK_BUTTON_A, _s("Joy A") },
|
{ "JOY_A", JOYSTICK_BUTTON_A, _s("Joy A") },
|
||||||
{ "JOY_B", JOYSTICK_BUTTON_B, _s("Joy B") },
|
{ "JOY_B", JOYSTICK_BUTTON_B, _s("Joy B") },
|
||||||
|
@ -329,18 +336,59 @@ HardwareInput KeyboardHardwareInputSet::findHardwareInput(const Event &event) co
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MouseHardwareInputSet::MouseHardwareInputSet(const HardwareInputTableEntry *buttonEntries) :
|
||||||
|
_buttonEntries(buttonEntries) {
|
||||||
|
assert(_buttonEntries);
|
||||||
|
}
|
||||||
|
|
||||||
|
HardwareInput MouseHardwareInputSet::findHardwareInput(const String &id) const {
|
||||||
|
const HardwareInputTableEntry *hw = HardwareInputTableEntry::findWithId(_buttonEntries, id);
|
||||||
|
if (!hw || !hw->hwId) {
|
||||||
|
return HardwareInput();
|
||||||
|
}
|
||||||
|
|
||||||
|
return HardwareInput::createMouse(hw->hwId, hw->code, hw->desc);
|
||||||
|
}
|
||||||
|
|
||||||
|
HardwareInput MouseHardwareInputSet::findHardwareInput(const Event &event) const {
|
||||||
|
int button;
|
||||||
|
switch (event.type) {
|
||||||
|
case EVENT_LBUTTONDOWN:
|
||||||
|
case EVENT_LBUTTONUP:
|
||||||
|
button = MOUSE_BUTTON_LEFT;
|
||||||
|
break;
|
||||||
|
case EVENT_RBUTTONDOWN:
|
||||||
|
case EVENT_RBUTTONUP:
|
||||||
|
button = MOUSE_BUTTON_RIGHT;
|
||||||
|
break;
|
||||||
|
case EVENT_MBUTTONDOWN:
|
||||||
|
case EVENT_MBUTTONUP:
|
||||||
|
button = MOUSE_BUTTON_MIDDLE;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
button = -1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (button == -1) {
|
||||||
|
return HardwareInput();
|
||||||
|
}
|
||||||
|
|
||||||
|
const HardwareInputTableEntry *hw = HardwareInputTableEntry::findWithCode(_buttonEntries, button);
|
||||||
|
if (!hw || !hw->hwId) {
|
||||||
|
return HardwareInput();
|
||||||
|
}
|
||||||
|
|
||||||
|
return HardwareInput::createMouse(hw->hwId, hw->code, hw->desc);
|
||||||
|
}
|
||||||
|
|
||||||
JoystickHardwareInputSet::JoystickHardwareInputSet(const HardwareInputTableEntry *buttonEntries) :
|
JoystickHardwareInputSet::JoystickHardwareInputSet(const HardwareInputTableEntry *buttonEntries) :
|
||||||
_buttonEntries(buttonEntries) {
|
_buttonEntries(buttonEntries) {
|
||||||
|
assert(_buttonEntries);
|
||||||
}
|
}
|
||||||
|
|
||||||
HardwareInput JoystickHardwareInputSet::findHardwareInput(const String &id) const {
|
HardwareInput JoystickHardwareInputSet::findHardwareInput(const String &id) const {
|
||||||
const HardwareInputTableEntry *hw = nullptr;
|
const HardwareInputTableEntry *hw = HardwareInputTableEntry::findWithId(_buttonEntries, id);
|
||||||
for (hw = _buttonEntries; hw->hwId; hw++) {
|
|
||||||
if (id.equals(hw->hwId)) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!hw || !hw->hwId) {
|
if (!hw || !hw->hwId) {
|
||||||
return HardwareInput();
|
return HardwareInput();
|
||||||
}
|
}
|
||||||
|
@ -352,13 +400,7 @@ HardwareInput JoystickHardwareInputSet::findHardwareInput(const Event &event) co
|
||||||
switch (event.type) {
|
switch (event.type) {
|
||||||
case EVENT_JOYBUTTON_DOWN:
|
case EVENT_JOYBUTTON_DOWN:
|
||||||
case EVENT_JOYBUTTON_UP: {
|
case EVENT_JOYBUTTON_UP: {
|
||||||
const HardwareInputTableEntry *hw = nullptr;
|
const HardwareInputTableEntry *hw = HardwareInputTableEntry::findWithCode(_buttonEntries, event.joystick.button);
|
||||||
for (hw = _buttonEntries; hw->hwId; hw++) {
|
|
||||||
if (event.joystick.button == hw->code) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!hw || !hw->hwId) {
|
if (!hw || !hw->hwId) {
|
||||||
return HardwareInput();
|
return HardwareInput();
|
||||||
}
|
}
|
||||||
|
@ -376,13 +418,7 @@ CustomHardwareInputSet::CustomHardwareInputSet(const HardwareInputTableEntry *ha
|
||||||
}
|
}
|
||||||
|
|
||||||
HardwareInput CustomHardwareInputSet::findHardwareInput(const String &id) const {
|
HardwareInput CustomHardwareInputSet::findHardwareInput(const String &id) const {
|
||||||
const HardwareInputTableEntry *hw = nullptr;
|
const HardwareInputTableEntry *hw = HardwareInputTableEntry::findWithId(_hardwareEntries, id);
|
||||||
for (hw = _hardwareEntries; hw->hwId; hw++) {
|
|
||||||
if (id.equals(hw->hwId)) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!hw || !hw->hwId) {
|
if (!hw || !hw->hwId) {
|
||||||
return HardwareInput();
|
return HardwareInput();
|
||||||
}
|
}
|
||||||
|
@ -393,13 +429,7 @@ HardwareInput CustomHardwareInputSet::findHardwareInput(const String &id) const
|
||||||
HardwareInput CustomHardwareInputSet::findHardwareInput(const Event &event) const {
|
HardwareInput CustomHardwareInputSet::findHardwareInput(const Event &event) const {
|
||||||
switch (event.type) {
|
switch (event.type) {
|
||||||
case EVENT_CUSTOM_BACKEND_HARDWARE: {
|
case EVENT_CUSTOM_BACKEND_HARDWARE: {
|
||||||
const HardwareInputTableEntry *hw = nullptr;
|
const HardwareInputTableEntry *hw = HardwareInputTableEntry::findWithCode(_hardwareEntries, event.customType);
|
||||||
for (hw = _hardwareEntries; hw->hwId; hw++) {
|
|
||||||
if (event.customType == hw->code) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!hw || !hw->hwId) {
|
if (!hw || !hw->hwId) {
|
||||||
return HardwareInput();
|
return HardwareInput();
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,12 +37,14 @@ typedef uint32 HardwareInputCode;
|
||||||
enum HardwareInputType {
|
enum HardwareInputType {
|
||||||
/** Empty / invalid input type */
|
/** Empty / invalid input type */
|
||||||
kHardwareInputTypeInvalid,
|
kHardwareInputTypeInvalid,
|
||||||
/** Input that sends single events */
|
|
||||||
kHardwareInputTypeCustom,
|
|
||||||
/** Keyboard input that sends -up and -down events */
|
/** Keyboard input that sends -up and -down events */
|
||||||
kHardwareInputTypeKeyboard,
|
kHardwareInputTypeKeyboard,
|
||||||
|
/** Mouse input that sends -up and -down events */
|
||||||
|
kHardwareInputTypeMouse,
|
||||||
/** Joystick input that sends -up and -down events */
|
/** Joystick input that sends -up and -down events */
|
||||||
kHardwareInputTypeJoystick
|
kHardwareInputTypeJoystick,
|
||||||
|
/** Input that sends single events */
|
||||||
|
kHardwareInputTypeCustom
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -76,12 +78,7 @@ struct HardwareInput {
|
||||||
: inputCode(0), type(kHardwareInputTypeInvalid) { }
|
: inputCode(0), type(kHardwareInputTypeInvalid) { }
|
||||||
|
|
||||||
static HardwareInput createCustom(const String &i, HardwareInputCode ic, const String &desc) {
|
static HardwareInput createCustom(const String &i, HardwareInputCode ic, const String &desc) {
|
||||||
HardwareInput hardwareInput;
|
return createSimple(kHardwareInputTypeCustom, i, ic, desc);
|
||||||
hardwareInput.id = i;
|
|
||||||
hardwareInput.description = desc;
|
|
||||||
hardwareInput.type = kHardwareInputTypeCustom;
|
|
||||||
hardwareInput.inputCode = ic;
|
|
||||||
return hardwareInput;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static HardwareInput createKeyboard(const String &i, KeyState ky, const String &desc) {
|
static HardwareInput createKeyboard(const String &i, KeyState ky, const String &desc) {
|
||||||
|
@ -95,11 +92,21 @@ struct HardwareInput {
|
||||||
}
|
}
|
||||||
|
|
||||||
static HardwareInput createJoystick(const String &i, uint8 button, const String &desc) {
|
static HardwareInput createJoystick(const String &i, uint8 button, const String &desc) {
|
||||||
|
return createSimple(kHardwareInputTypeJoystick, i, button, desc);
|
||||||
|
}
|
||||||
|
|
||||||
|
static HardwareInput createMouse(const String &i, uint8 button, const String &desc) {
|
||||||
|
return createSimple(kHardwareInputTypeMouse, i, button, desc);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
static HardwareInput createSimple(HardwareInputType type, const String &i, HardwareInputCode ic, const String &desc) {
|
||||||
HardwareInput hardwareInput;
|
HardwareInput hardwareInput;
|
||||||
hardwareInput.id = i;
|
hardwareInput.id = i;
|
||||||
hardwareInput.description = desc;
|
hardwareInput.description = desc;
|
||||||
hardwareInput.type = kHardwareInputTypeJoystick;
|
hardwareInput.type = type;
|
||||||
hardwareInput.inputCode = button;
|
hardwareInput.inputCode = ic;
|
||||||
return hardwareInput;
|
return hardwareInput;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -111,6 +118,24 @@ struct HardwareInputTableEntry {
|
||||||
const char *hwId;
|
const char *hwId;
|
||||||
HardwareInputCode code;
|
HardwareInputCode code;
|
||||||
const char *desc;
|
const char *desc;
|
||||||
|
|
||||||
|
static const HardwareInputTableEntry *findWithCode(const HardwareInputTableEntry *_entries, HardwareInputCode code) {
|
||||||
|
for (const HardwareInputTableEntry *hw = _entries; hw->hwId; hw++) {
|
||||||
|
if (hw->code == code) {
|
||||||
|
return hw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
static const HardwareInputTableEntry *findWithId(const HardwareInputTableEntry *_entries, const String &id) {
|
||||||
|
for (const HardwareInputTableEntry *hw = _entries; hw->hwId; hw++) {
|
||||||
|
if (id.equals(hw->hwId)) {
|
||||||
|
return hw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -176,6 +201,23 @@ private:
|
||||||
const ModifierTableEntry *_modifiers;
|
const ModifierTableEntry *_modifiers;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A mouse input device
|
||||||
|
*
|
||||||
|
* Describes the mouse buttons
|
||||||
|
*/
|
||||||
|
class MouseHardwareInputSet : public HardwareInputSet {
|
||||||
|
public:
|
||||||
|
MouseHardwareInputSet(const HardwareInputTableEntry *buttonEntries);
|
||||||
|
|
||||||
|
// HardwareInputSet API
|
||||||
|
HardwareInput findHardwareInput(const String &id) const override;
|
||||||
|
HardwareInput findHardwareInput(const Event &event) const override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
const HardwareInputTableEntry *_buttonEntries;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A joystick input device
|
* A joystick input device
|
||||||
*/
|
*/
|
||||||
|
@ -236,6 +278,9 @@ extern const KeyTableEntry defaultKeys[];
|
||||||
/** A standard set of keyboard modifiers */
|
/** A standard set of keyboard modifiers */
|
||||||
extern const ModifierTableEntry defaultModifiers[];
|
extern const ModifierTableEntry defaultModifiers[];
|
||||||
|
|
||||||
|
/** A standard set of mouse buttons */
|
||||||
|
extern const HardwareInputTableEntry defaultMouseButtons[];
|
||||||
|
|
||||||
/** A standard set of joystick buttons based on the ScummVM event model */
|
/** A standard set of joystick buttons based on the ScummVM event model */
|
||||||
extern const HardwareInputTableEntry defaultJoystickButtons[];
|
extern const HardwareInputTableEntry defaultJoystickButtons[];
|
||||||
|
|
||||||
|
|
|
@ -60,9 +60,15 @@ bool InputWatcher::notifyEvent(const Event &event) {
|
||||||
switch (event.type) {
|
switch (event.type) {
|
||||||
case EVENT_KEYDOWN:
|
case EVENT_KEYDOWN:
|
||||||
case EVENT_JOYBUTTON_DOWN:
|
case EVENT_JOYBUTTON_DOWN:
|
||||||
|
case EVENT_LBUTTONDOWN:
|
||||||
|
case EVENT_RBUTTONDOWN:
|
||||||
|
case EVENT_MBUTTONDOWN:
|
||||||
return true;
|
return true;
|
||||||
case EVENT_KEYUP:
|
case EVENT_KEYUP:
|
||||||
case EVENT_JOYBUTTON_UP:
|
case EVENT_JOYBUTTON_UP:
|
||||||
|
case EVENT_LBUTTONUP:
|
||||||
|
case EVENT_RBUTTONUP:
|
||||||
|
case EVENT_MBUTTONUP:
|
||||||
case EVENT_CUSTOM_BACKEND_HARDWARE:
|
case EVENT_CUSTOM_BACKEND_HARDWARE:
|
||||||
_hwInput = _keymapper->findHardwareInput(event);
|
_hwInput = _keymapper->findHardwareInput(event);
|
||||||
if (_hwInput.type != kHardwareInputTypeInvalid) {
|
if (_hwInput.type != kHardwareInputTypeInvalid) {
|
||||||
|
|
|
@ -119,6 +119,21 @@ Keymap::ActionArray Keymap::getMappedActions(const Event &event) const {
|
||||||
HardwareInput hardwareInput = HardwareInput::createKeyboard("", event.kbd, "");
|
HardwareInput hardwareInput = HardwareInput::createKeyboard("", event.kbd, "");
|
||||||
return _hwActionMap[hardwareInput];
|
return _hwActionMap[hardwareInput];
|
||||||
}
|
}
|
||||||
|
case EVENT_LBUTTONDOWN:
|
||||||
|
case EVENT_LBUTTONUP: {
|
||||||
|
HardwareInput hardwareInput = HardwareInput::createMouse("", MOUSE_BUTTON_LEFT, "");
|
||||||
|
return _hwActionMap[hardwareInput];
|
||||||
|
}
|
||||||
|
case EVENT_RBUTTONDOWN:
|
||||||
|
case EVENT_RBUTTONUP: {
|
||||||
|
HardwareInput hardwareInput = HardwareInput::createMouse("", MOUSE_BUTTON_RIGHT, "");
|
||||||
|
return _hwActionMap[hardwareInput];
|
||||||
|
}
|
||||||
|
case EVENT_MBUTTONDOWN:
|
||||||
|
case EVENT_MBUTTONUP: {
|
||||||
|
HardwareInput hardwareInput = HardwareInput::createMouse("", MOUSE_BUTTON_MIDDLE, "");
|
||||||
|
return _hwActionMap[hardwareInput];
|
||||||
|
}
|
||||||
case EVENT_JOYBUTTON_DOWN:
|
case EVENT_JOYBUTTON_DOWN:
|
||||||
case EVENT_JOYBUTTON_UP: {
|
case EVENT_JOYBUTTON_UP: {
|
||||||
HardwareInput hardwareInput = HardwareInput::createJoystick("", event.joystick.button, "");
|
HardwareInput hardwareInput = HardwareInput::createJoystick("", event.joystick.button, "");
|
||||||
|
|
|
@ -56,7 +56,10 @@ void Keymapper::registerHardwareInputSet(HardwareInputSet *inputs) {
|
||||||
|
|
||||||
if (!inputs) {
|
if (!inputs) {
|
||||||
warning("No hardware input were defined, using defaults");
|
warning("No hardware input were defined, using defaults");
|
||||||
inputs = new KeyboardHardwareInputSet(defaultKeys, defaultModifiers);
|
CompositeHardwareInputSet *compositeInputs = new CompositeHardwareInputSet();
|
||||||
|
compositeInputs->addHardwareInputSet(new MouseHardwareInputSet(defaultMouseButtons));
|
||||||
|
compositeInputs->addHardwareInputSet(new KeyboardHardwareInputSet(defaultKeys, defaultModifiers));
|
||||||
|
inputs = compositeInputs;
|
||||||
}
|
}
|
||||||
|
|
||||||
_hardwareInputs = inputs;
|
_hardwareInputs = inputs;
|
||||||
|
@ -191,7 +194,11 @@ List<Event> Keymapper::mapEvent(const Event &ev) {
|
||||||
Keymapper::IncomingEventType Keymapper::convertToIncomingEventType(const Event &ev) const {
|
Keymapper::IncomingEventType Keymapper::convertToIncomingEventType(const Event &ev) const {
|
||||||
if (ev.type == EVENT_CUSTOM_BACKEND_HARDWARE) {
|
if (ev.type == EVENT_CUSTOM_BACKEND_HARDWARE) {
|
||||||
return kIncomingEventInstant;
|
return kIncomingEventInstant;
|
||||||
} else if (ev.type == EVENT_KEYDOWN || ev.type == EVENT_JOYBUTTON_DOWN) {
|
} else if (ev.type == EVENT_KEYDOWN
|
||||||
|
|| ev.type == EVENT_LBUTTONDOWN
|
||||||
|
|| ev.type == EVENT_RBUTTONDOWN
|
||||||
|
|| ev.type == EVENT_MBUTTONDOWN
|
||||||
|
|| ev.type == EVENT_JOYBUTTON_DOWN) {
|
||||||
return kIncomingEventStart;
|
return kIncomingEventStart;
|
||||||
} else {
|
} else {
|
||||||
return kIncomingEventEnd;
|
return kIncomingEventEnd;
|
||||||
|
|
|
@ -185,6 +185,7 @@ static const Common::KeyTableEntry maemoKeys[] = {
|
||||||
|
|
||||||
Common::HardwareInputSet *OSystem_SDL_Maemo::getHardwareInputSet() {
|
Common::HardwareInputSet *OSystem_SDL_Maemo::getHardwareInputSet() {
|
||||||
Common::CompositeHardwareInputSet *inputSet = new Common::CompositeHardwareInputSet();
|
Common::CompositeHardwareInputSet *inputSet = new Common::CompositeHardwareInputSet();
|
||||||
|
inputSet->addHardwareInputSet(new Common::MouseHardwareInputSet(Common::defaultMouseButtons));
|
||||||
inputSet->addHardwareInputSet(new Common::KeyboardHardwareInputSet(maemoKeys, Common::defaultModifiers));
|
inputSet->addHardwareInputSet(new Common::KeyboardHardwareInputSet(maemoKeys, Common::defaultModifiers));
|
||||||
inputSet->addHardwareInputSet(new Common::KeyboardHardwareInputSet(Common::defaultKeys, Common::defaultModifiers));
|
inputSet->addHardwareInputSet(new Common::KeyboardHardwareInputSet(Common::defaultKeys, Common::defaultModifiers));
|
||||||
|
|
||||||
|
|
|
@ -403,6 +403,7 @@ Common::HardwareInputSet *OSystem_SDL::getHardwareInputSet() {
|
||||||
using namespace Common;
|
using namespace Common;
|
||||||
|
|
||||||
CompositeHardwareInputSet *inputSet = new CompositeHardwareInputSet();
|
CompositeHardwareInputSet *inputSet = new CompositeHardwareInputSet();
|
||||||
|
inputSet->addHardwareInputSet(new MouseHardwareInputSet(defaultMouseButtons));
|
||||||
inputSet->addHardwareInputSet(new KeyboardHardwareInputSet(defaultKeys, defaultModifiers));
|
inputSet->addHardwareInputSet(new KeyboardHardwareInputSet(defaultKeys, defaultModifiers));
|
||||||
|
|
||||||
bool joystickSupportEnabled = ConfMan.getInt("joystick_num") >= 0;
|
bool joystickSupportEnabled = ConfMan.getInt("joystick_num") >= 0;
|
||||||
|
|
|
@ -137,6 +137,15 @@ enum JoystickButton {
|
||||||
JOYSTICK_BUTTON_DPAD_RIGHT
|
JOYSTICK_BUTTON_DPAD_RIGHT
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The list named buttons available from a mouse
|
||||||
|
*/
|
||||||
|
enum MouseButton {
|
||||||
|
MOUSE_BUTTON_LEFT = 0,
|
||||||
|
MOUSE_BUTTON_RIGHT = 1,
|
||||||
|
MOUSE_BUTTON_MIDDLE = 2
|
||||||
|
};
|
||||||
|
|
||||||
typedef uint32 CustomEventType;
|
typedef uint32 CustomEventType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -407,8 +416,8 @@ public:
|
||||||
virtual ~EventManager() {}
|
virtual ~EventManager() {}
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
LBUTTON = 1 << 0,
|
LBUTTON = 1 << MOUSE_BUTTON_LEFT,
|
||||||
RBUTTON = 1 << 1
|
RBUTTON = 1 << MOUSE_BUTTON_RIGHT
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -56,15 +56,18 @@ Common::KeymapArray MetaEngine::initKeymaps(const char *target) const {
|
||||||
|
|
||||||
act = new Action("LCLK", _("Left Click"));
|
act = new Action("LCLK", _("Left Click"));
|
||||||
act->setLeftClickEvent();
|
act->setLeftClickEvent();
|
||||||
|
act->addDefaultInputMapping("MOUSE_LEFT");
|
||||||
act->addDefaultInputMapping("JOY_A");
|
act->addDefaultInputMapping("JOY_A");
|
||||||
engineKeyMap->addAction(act);
|
engineKeyMap->addAction(act);
|
||||||
|
|
||||||
act = new Action("MCLK", _("Middle Click"));
|
act = new Action("MCLK", _("Middle Click"));
|
||||||
|
act->addDefaultInputMapping("MOUSE_MIDDLE");
|
||||||
act->setMiddleClickEvent();
|
act->setMiddleClickEvent();
|
||||||
engineKeyMap->addAction(act);
|
engineKeyMap->addAction(act);
|
||||||
|
|
||||||
act = new Action("RCLK", _("Right Click"));
|
act = new Action("RCLK", _("Right Click"));
|
||||||
act->setRightClickEvent();
|
act->setRightClickEvent();
|
||||||
|
act->addDefaultInputMapping("MOUSE_RIGHT");
|
||||||
act->addDefaultInputMapping("JOY_B");
|
act->addDefaultInputMapping("JOY_B");
|
||||||
engineKeyMap->addAction(act);
|
engineKeyMap->addAction(act);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue