mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 08:44:19 -04:00
input: rename "action_x" button handles to "face_x"
This commit is contained in:
parent
e30b597926
commit
8d8c5a546d
@ -906,10 +906,10 @@ map_button(int code, DeviceClass device_class) {
|
|||||||
if (device_class == DC_gamepad) {
|
if (device_class == DC_gamepad) {
|
||||||
// Based on "Jess Tech Colour Rumble Pad"
|
// Based on "Jess Tech Colour Rumble Pad"
|
||||||
static const ButtonHandle mapping[] = {
|
static const ButtonHandle mapping[] = {
|
||||||
GamepadButton::action_x(),
|
GamepadButton::face_x(),
|
||||||
GamepadButton::action_y(),
|
GamepadButton::face_y(),
|
||||||
GamepadButton::action_a(),
|
GamepadButton::face_a(),
|
||||||
GamepadButton::action_b(),
|
GamepadButton::face_b(),
|
||||||
GamepadButton::lshoulder(),
|
GamepadButton::lshoulder(),
|
||||||
GamepadButton::ltrigger(),
|
GamepadButton::ltrigger(),
|
||||||
GamepadButton::rshoulder(),
|
GamepadButton::rshoulder(),
|
||||||
@ -929,22 +929,22 @@ map_button(int code, DeviceClass device_class) {
|
|||||||
|
|
||||||
switch (code) {
|
switch (code) {
|
||||||
case BTN_A:
|
case BTN_A:
|
||||||
return GamepadButton::action_a();
|
return GamepadButton::face_a();
|
||||||
|
|
||||||
case BTN_B:
|
case BTN_B:
|
||||||
return GamepadButton::action_b();
|
return GamepadButton::face_b();
|
||||||
|
|
||||||
case BTN_C:
|
case BTN_C:
|
||||||
return GamepadButton::action_c();
|
return GamepadButton::face_c();
|
||||||
|
|
||||||
case BTN_X:
|
case BTN_X:
|
||||||
return GamepadButton::action_x();
|
return GamepadButton::face_x();
|
||||||
|
|
||||||
case BTN_Y:
|
case BTN_Y:
|
||||||
return GamepadButton::action_y();
|
return GamepadButton::face_y();
|
||||||
|
|
||||||
case BTN_Z:
|
case BTN_Z:
|
||||||
return GamepadButton::action_z();
|
return GamepadButton::face_z();
|
||||||
|
|
||||||
case BTN_TL:
|
case BTN_TL:
|
||||||
return GamepadButton::lshoulder();
|
return GamepadButton::lshoulder();
|
||||||
@ -959,10 +959,10 @@ map_button(int code, DeviceClass device_class) {
|
|||||||
return GamepadButton::rtrigger();
|
return GamepadButton::rtrigger();
|
||||||
|
|
||||||
case BTN_1:
|
case BTN_1:
|
||||||
return GamepadButton::action_1();
|
return GamepadButton::face_1();
|
||||||
|
|
||||||
case BTN_2:
|
case BTN_2:
|
||||||
return GamepadButton::action_2();
|
return GamepadButton::face_2();
|
||||||
|
|
||||||
case BTN_SELECT:
|
case BTN_SELECT:
|
||||||
case KEY_PREVIOUS:
|
case KEY_PREVIOUS:
|
||||||
|
@ -632,10 +632,10 @@ parse_element(IOHIDElementRef element) {
|
|||||||
// SNES-style USB gamepad
|
// SNES-style USB gamepad
|
||||||
static const ButtonHandle gamepad_buttons[] = {
|
static const ButtonHandle gamepad_buttons[] = {
|
||||||
ButtonHandle::none(),
|
ButtonHandle::none(),
|
||||||
GamepadButton::action_x(),
|
GamepadButton::face_x(),
|
||||||
GamepadButton::action_a(),
|
GamepadButton::face_a(),
|
||||||
GamepadButton::action_b(),
|
GamepadButton::face_b(),
|
||||||
GamepadButton::action_y(),
|
GamepadButton::face_y(),
|
||||||
GamepadButton::lshoulder(),
|
GamepadButton::lshoulder(),
|
||||||
GamepadButton::rshoulder(),
|
GamepadButton::rshoulder(),
|
||||||
ButtonHandle::none(),
|
ButtonHandle::none(),
|
||||||
@ -651,10 +651,10 @@ parse_element(IOHIDElementRef element) {
|
|||||||
// driver. I don't know if other drivers do the same thing at all.
|
// driver. I don't know if other drivers do the same thing at all.
|
||||||
static const ButtonHandle gamepad_buttons[] = {
|
static const ButtonHandle gamepad_buttons[] = {
|
||||||
ButtonHandle::none(),
|
ButtonHandle::none(),
|
||||||
GamepadButton::action_a(),
|
GamepadButton::face_a(),
|
||||||
GamepadButton::action_b(),
|
GamepadButton::face_b(),
|
||||||
GamepadButton::action_x(),
|
GamepadButton::face_x(),
|
||||||
GamepadButton::action_y(),
|
GamepadButton::face_y(),
|
||||||
GamepadButton::lshoulder(),
|
GamepadButton::lshoulder(),
|
||||||
GamepadButton::rshoulder(),
|
GamepadButton::rshoulder(),
|
||||||
GamepadButton::lstick(),
|
GamepadButton::lstick(),
|
||||||
|
@ -134,7 +134,7 @@ open_device() {
|
|||||||
device_cat.debug() << "Unmapped /dev/input/js" << _index
|
device_cat.debug() << "Unmapped /dev/input/js" << _index
|
||||||
<< " button " << (int)i << ": 0x" << std::hex << btnmap[i] << "\n";
|
<< " button " << (int)i << ": 0x" << std::hex << btnmap[i] << "\n";
|
||||||
}
|
}
|
||||||
} else if (handle == GamepadButton::action_a()) {
|
} else if (handle == GamepadButton::face_a()) {
|
||||||
_device_class = DC_gamepad;
|
_device_class = DC_gamepad;
|
||||||
} else if (handle == GamepadButton::trigger()) {
|
} else if (handle == GamepadButton::trigger()) {
|
||||||
_device_class = DC_flight_stick;
|
_device_class = DC_flight_stick;
|
||||||
|
@ -332,10 +332,10 @@ on_arrival(HANDLE handle, const RID_DEVICE_INFO &info, std::string name) {
|
|||||||
// Do we have a button mapping?
|
// Do we have a button mapping?
|
||||||
static const ButtonHandle gamepad_buttons_common[] = {
|
static const ButtonHandle gamepad_buttons_common[] = {
|
||||||
ButtonHandle::none(),
|
ButtonHandle::none(),
|
||||||
GamepadButton::action_a(),
|
GamepadButton::face_a(),
|
||||||
GamepadButton::action_b(),
|
GamepadButton::face_b(),
|
||||||
GamepadButton::action_x(),
|
GamepadButton::face_x(),
|
||||||
GamepadButton::action_y(),
|
GamepadButton::face_y(),
|
||||||
GamepadButton::lshoulder(),
|
GamepadButton::lshoulder(),
|
||||||
GamepadButton::rshoulder(),
|
GamepadButton::rshoulder(),
|
||||||
GamepadButton::start(),
|
GamepadButton::start(),
|
||||||
@ -348,10 +348,10 @@ on_arrival(HANDLE handle, const RID_DEVICE_INFO &info, std::string name) {
|
|||||||
// SNES-style USB gamepad
|
// SNES-style USB gamepad
|
||||||
static const ButtonHandle gamepad_buttons_snes[] = {
|
static const ButtonHandle gamepad_buttons_snes[] = {
|
||||||
ButtonHandle::none(),
|
ButtonHandle::none(),
|
||||||
GamepadButton::action_x(),
|
GamepadButton::face_x(),
|
||||||
GamepadButton::action_a(),
|
GamepadButton::face_a(),
|
||||||
GamepadButton::action_b(),
|
GamepadButton::face_b(),
|
||||||
GamepadButton::action_y(),
|
GamepadButton::face_y(),
|
||||||
GamepadButton::lshoulder(),
|
GamepadButton::lshoulder(),
|
||||||
GamepadButton::rshoulder(),
|
GamepadButton::rshoulder(),
|
||||||
ButtonHandle::none(),
|
ButtonHandle::none(),
|
||||||
|
@ -386,11 +386,10 @@ init_device(const XINPUT_CAPABILITIES_EX &caps, const XINPUT_STATE &state) {
|
|||||||
set_button_map(8, GamepadButton::lshoulder());
|
set_button_map(8, GamepadButton::lshoulder());
|
||||||
set_button_map(9, GamepadButton::rshoulder());
|
set_button_map(9, GamepadButton::rshoulder());
|
||||||
set_button_map(10, GamepadButton::guide());
|
set_button_map(10, GamepadButton::guide());
|
||||||
set_button_map(11, GamepadButton::action_a());
|
set_button_map(11, GamepadButton::face_a());
|
||||||
set_button_map(12, GamepadButton::action_b());
|
set_button_map(12, GamepadButton::face_b());
|
||||||
set_button_map(13, GamepadButton::action_x());
|
set_button_map(13, GamepadButton::face_x());
|
||||||
set_button_map(14, GamepadButton::action_y());
|
set_button_map(14, GamepadButton::face_y());
|
||||||
|
|
||||||
|
|
||||||
if (caps.Vibration.wLeftMotorSpeed != 0 ||
|
if (caps.Vibration.wLeftMotorSpeed != 0 ||
|
||||||
caps.Vibration.wRightMotorSpeed != 0) {
|
caps.Vibration.wRightMotorSpeed != 0) {
|
||||||
|
@ -37,15 +37,15 @@ DEFINE_GAMEPAD_BUTTON_HANDLE(start)
|
|||||||
DEFINE_GAMEPAD_BUTTON_HANDLE(next)
|
DEFINE_GAMEPAD_BUTTON_HANDLE(next)
|
||||||
DEFINE_GAMEPAD_BUTTON_HANDLE(previous)
|
DEFINE_GAMEPAD_BUTTON_HANDLE(previous)
|
||||||
|
|
||||||
DEFINE_GAMEPAD_BUTTON_HANDLE(action_a)
|
DEFINE_GAMEPAD_BUTTON_HANDLE(face_a)
|
||||||
DEFINE_GAMEPAD_BUTTON_HANDLE(action_b)
|
DEFINE_GAMEPAD_BUTTON_HANDLE(face_b)
|
||||||
DEFINE_GAMEPAD_BUTTON_HANDLE(action_c)
|
DEFINE_GAMEPAD_BUTTON_HANDLE(face_c)
|
||||||
DEFINE_GAMEPAD_BUTTON_HANDLE(action_x)
|
DEFINE_GAMEPAD_BUTTON_HANDLE(face_x)
|
||||||
DEFINE_GAMEPAD_BUTTON_HANDLE(action_y)
|
DEFINE_GAMEPAD_BUTTON_HANDLE(face_y)
|
||||||
DEFINE_GAMEPAD_BUTTON_HANDLE(action_z)
|
DEFINE_GAMEPAD_BUTTON_HANDLE(face_z)
|
||||||
|
|
||||||
DEFINE_GAMEPAD_BUTTON_HANDLE(action_1)
|
DEFINE_GAMEPAD_BUTTON_HANDLE(face_1)
|
||||||
DEFINE_GAMEPAD_BUTTON_HANDLE(action_2)
|
DEFINE_GAMEPAD_BUTTON_HANDLE(face_2)
|
||||||
|
|
||||||
DEFINE_GAMEPAD_BUTTON_HANDLE(trigger)
|
DEFINE_GAMEPAD_BUTTON_HANDLE(trigger)
|
||||||
DEFINE_GAMEPAD_BUTTON_HANDLE(hat_up)
|
DEFINE_GAMEPAD_BUTTON_HANDLE(hat_up)
|
||||||
@ -100,15 +100,15 @@ init_gamepad_buttons() {
|
|||||||
ButtonRegistry::ptr()->register_button(_next, "next");
|
ButtonRegistry::ptr()->register_button(_next, "next");
|
||||||
ButtonRegistry::ptr()->register_button(_previous, "previous");
|
ButtonRegistry::ptr()->register_button(_previous, "previous");
|
||||||
|
|
||||||
ButtonRegistry::ptr()->register_button(_action_a, "action_a");
|
ButtonRegistry::ptr()->register_button(_face_a, "face_a");
|
||||||
ButtonRegistry::ptr()->register_button(_action_b, "action_b");
|
ButtonRegistry::ptr()->register_button(_face_b, "face_b");
|
||||||
ButtonRegistry::ptr()->register_button(_action_c, "action_c");
|
ButtonRegistry::ptr()->register_button(_face_c, "face_c");
|
||||||
ButtonRegistry::ptr()->register_button(_action_x, "action_x");
|
ButtonRegistry::ptr()->register_button(_face_x, "face_x");
|
||||||
ButtonRegistry::ptr()->register_button(_action_y, "action_y");
|
ButtonRegistry::ptr()->register_button(_face_y, "face_y");
|
||||||
ButtonRegistry::ptr()->register_button(_action_z, "action_z");
|
ButtonRegistry::ptr()->register_button(_face_z, "face_z");
|
||||||
|
|
||||||
ButtonRegistry::ptr()->register_button(_action_1, "action_1");
|
ButtonRegistry::ptr()->register_button(_face_1, "face_1");
|
||||||
ButtonRegistry::ptr()->register_button(_action_2, "action_2");
|
ButtonRegistry::ptr()->register_button(_face_2, "face_2");
|
||||||
|
|
||||||
ButtonRegistry::ptr()->register_button(_trigger, "trigger");
|
ButtonRegistry::ptr()->register_button(_trigger, "trigger");
|
||||||
ButtonRegistry::ptr()->register_button(_hat_up, "hat_up");
|
ButtonRegistry::ptr()->register_button(_hat_up, "hat_up");
|
||||||
|
@ -43,15 +43,15 @@ PUBLISHED:
|
|||||||
static ButtonHandle next();
|
static ButtonHandle next();
|
||||||
static ButtonHandle previous();
|
static ButtonHandle previous();
|
||||||
|
|
||||||
static ButtonHandle action_a();
|
static ButtonHandle face_a();
|
||||||
static ButtonHandle action_b();
|
static ButtonHandle face_b();
|
||||||
static ButtonHandle action_c();
|
static ButtonHandle face_c();
|
||||||
static ButtonHandle action_x();
|
static ButtonHandle face_x();
|
||||||
static ButtonHandle action_y();
|
static ButtonHandle face_y();
|
||||||
static ButtonHandle action_z();
|
static ButtonHandle face_z();
|
||||||
|
|
||||||
static ButtonHandle action_1();
|
static ButtonHandle face_1();
|
||||||
static ButtonHandle action_2();
|
static ButtonHandle face_2();
|
||||||
|
|
||||||
// Flight stick buttons, takes zero-based index. First is always trigger.
|
// Flight stick buttons, takes zero-based index. First is always trigger.
|
||||||
static ButtonHandle trigger();
|
static ButtonHandle trigger();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user