diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-01-08 17:05:51 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2017-01-08 17:06:33 -0300 |
commit | 547a57777b199f451305a6d4b6ad63fb0b2bd3ed (patch) | |
tree | 9fb9ce5851ea3ccc39c6ebce607ceeca771fd991 /core/os | |
parent | 6323779596dea0db7f58afef7d3d3d5588ef20cb (diff) |
renamed joystick to joypad everywhere around source code!
Diffstat (limited to 'core/os')
-rw-r--r-- | core/os/input.cpp | 2 | ||||
-rw-r--r-- | core/os/input.h | 2 | ||||
-rw-r--r-- | core/os/input_event.cpp | 16 | ||||
-rw-r--r-- | core/os/input_event.h | 14 | ||||
-rw-r--r-- | core/os/os.cpp | 2 |
5 files changed, 18 insertions, 18 deletions
diff --git a/core/os/input.cpp b/core/os/input.cpp index 259108802f..d2bd433ed9 100644 --- a/core/os/input.cpp +++ b/core/os/input.cpp @@ -61,7 +61,7 @@ void Input::_bind_methods() { ClassDB::bind_method(_MD("get_joy_axis","device","axis"),&Input::get_joy_axis); ClassDB::bind_method(_MD("get_joy_name","device"),&Input::get_joy_name); ClassDB::bind_method(_MD("get_joy_guid","device"),&Input::get_joy_guid); - ClassDB::bind_method(_MD("get_connected_joysticks"),&Input::get_connected_joysticks); + ClassDB::bind_method(_MD("get_connected_joypads"),&Input::get_connected_joypads); ClassDB::bind_method(_MD("get_joy_vibration_strength", "device"), &Input::get_joy_vibration_strength); ClassDB::bind_method(_MD("get_joy_vibration_duration", "device"), &Input::get_joy_vibration_duration); ClassDB::bind_method(_MD("get_joy_button_string", "button_index"), &Input::get_joy_button_string); diff --git a/core/os/input.h b/core/os/input.h index a137820972..c365894f46 100644 --- a/core/os/input.h +++ b/core/os/input.h @@ -64,7 +64,7 @@ public: virtual float get_joy_axis(int p_device,int p_axis) const=0; virtual String get_joy_name(int p_idx)=0; - virtual Array get_connected_joysticks()=0; + virtual Array get_connected_joypads()=0; virtual void joy_connection_changed(int p_idx, bool p_connected, String p_name, String p_guid)=0; virtual void add_joy_mapping(String p_mapping, bool p_update_existing=false)=0; virtual void remove_joy_mapping(String p_guid)=0; diff --git a/core/os/input_event.cpp b/core/os/input_event.cpp index b0008a0481..5c681f1a82 100644 --- a/core/os/input_event.cpp +++ b/core/os/input_event.cpp @@ -61,10 +61,10 @@ bool InputEvent::operator==(const InputEvent &p_event) const { && mouse_button.button_index == p_event.mouse_button.button_index && mouse_button.button_mask == p_event.mouse_button.button_mask && key.mod == p_event.key.mod; - case JOYSTICK_MOTION: + case JOYPAD_MOTION: return joy_motion.axis == p_event.joy_motion.axis && joy_motion.axis_value == p_event.joy_motion.axis_value; - case JOYSTICK_BUTTON: + case JOYPAD_BUTTON: return joy_button.pressed == p_event.joy_button.pressed && joy_button.button_index == p_event.joy_button.button_index && joy_button.pressure == p_event.joy_button.pressure; @@ -155,14 +155,14 @@ InputEvent::operator String() const { return str; } break; - case JOYSTICK_MOTION: { - str+= "Event: JoystickMotion "; + case JOYPAD_MOTION: { + str+= "Event: JoypadMotion "; str=str+"Axis: "+itos(joy_motion.axis)+" Value: " +rtos(joy_motion.axis_value); return str; } break; - case JOYSTICK_BUTTON: { - str+= "Event: JoystickButton "; + case JOYPAD_BUTTON: { + str+= "Event: JoypadButton "; str=str+"Pressed: "+itos(joy_button.pressed)+" Index: " +itos(joy_button.button_index)+" pressure "+rtos(joy_button.pressure); return str; @@ -203,9 +203,9 @@ bool InputEvent::is_pressed() const { case KEY: return key.pressed; case MOUSE_BUTTON: return mouse_button.pressed; - case JOYSTICK_BUTTON: return joy_button.pressed; + case JOYPAD_BUTTON: return joy_button.pressed; case SCREEN_TOUCH: return screen_touch.pressed; - case JOYSTICK_MOTION: return ABS(joy_motion.axis_value) > 0.5; + case JOYPAD_MOTION: return ABS(joy_motion.axis_value) > 0.5; case ACTION: return action.pressed; default: {} } diff --git a/core/os/input_event.h b/core/os/input_event.h index 8fe033aa3c..a557de2bd7 100644 --- a/core/os/input_event.h +++ b/core/os/input_event.h @@ -225,13 +225,13 @@ struct InputEventMouseMotion : public InputEventMouse { float speed_x,speed_y; }; -struct InputEventJoystickMotion { +struct InputEventJoypadMotion { - int axis; ///< Joystick axis + int axis; ///< Joypad axis float axis_value; ///< -1 to 1 }; -struct InputEventJoystickButton { +struct InputEventJoypadButton { int button_index; bool pressed; @@ -267,8 +267,8 @@ struct InputEvent { KEY, MOUSE_MOTION, MOUSE_BUTTON, - JOYSTICK_MOTION, - JOYSTICK_BUTTON, + JOYPAD_MOTION, + JOYPAD_BUTTON, SCREEN_TOUCH, SCREEN_DRAG, ACTION, @@ -282,8 +282,8 @@ struct InputEvent { union { InputEventMouseMotion mouse_motion; InputEventMouseButton mouse_button; - InputEventJoystickMotion joy_motion; - InputEventJoystickButton joy_button; + InputEventJoypadMotion joy_motion; + InputEventJoypadButton joy_button; InputEventKey key; InputEventScreenTouch screen_touch; InputEventScreenDrag screen_drag; diff --git a/core/os/os.cpp b/core/os/os.cpp index 82500f5423..677bf63e69 100644 --- a/core/os/os.cpp +++ b/core/os/os.cpp @@ -533,7 +533,7 @@ bool OS::is_joy_known(int p_device) { } String OS::get_joy_guid(int p_device) const { - return "Default Joystick"; + return "Default Joypad"; } void OS::set_context(int p_context) { |