diff options
Diffstat (limited to 'core/os')
-rw-r--r-- | core/os/input.cpp | 68 | ||||
-rw-r--r-- | core/os/main_loop.cpp | 12 |
2 files changed, 40 insertions, 40 deletions
diff --git a/core/os/input.cpp b/core/os/input.cpp index 4e7b037453..e20c966ff2 100644 --- a/core/os/input.cpp +++ b/core/os/input.cpp @@ -49,40 +49,40 @@ Input::MouseMode Input::get_mouse_mode() const { void Input::_bind_methods() { - ClassDB::bind_method(_MD("is_key_pressed","scancode"),&Input::is_key_pressed); - ClassDB::bind_method(_MD("is_mouse_button_pressed","button"),&Input::is_mouse_button_pressed); - ClassDB::bind_method(_MD("is_joy_button_pressed","device","button"),&Input::is_joy_button_pressed); - ClassDB::bind_method(_MD("is_action_pressed","action"),&Input::is_action_pressed); - ClassDB::bind_method(_MD("is_action_just_pressed","action"),&Input::is_action_just_pressed); - ClassDB::bind_method(_MD("is_action_just_released","action"),&Input::is_action_just_released); - ClassDB::bind_method(_MD("add_joy_mapping","mapping", "update_existing"),&Input::add_joy_mapping, DEFVAL(false)); - ClassDB::bind_method(_MD("remove_joy_mapping","guid"),&Input::remove_joy_mapping); - ClassDB::bind_method(_MD("is_joy_known","device"),&Input::is_joy_known); - 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_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); - ClassDB::bind_method(_MD("get_joy_button_index_from_string", "button"), &Input::get_joy_button_index_from_string); - ClassDB::bind_method(_MD("get_joy_axis_string", "axis_index"), &Input::get_joy_axis_string); - ClassDB::bind_method(_MD("get_joy_axis_index_from_string", "axis"), &Input::get_joy_axis_index_from_string); - ClassDB::bind_method(_MD("start_joy_vibration", "device", "weak_magnitude", "strong_magnitude", "duration"), &Input::start_joy_vibration, DEFVAL(0)); - ClassDB::bind_method(_MD("stop_joy_vibration", "device"), &Input::stop_joy_vibration); - ClassDB::bind_method(_MD("get_gravity"),&Input::get_gravity); - ClassDB::bind_method(_MD("get_accelerometer"),&Input::get_accelerometer); - ClassDB::bind_method(_MD("get_magnetometer"),&Input::get_magnetometer); - ClassDB::bind_method(_MD("get_gyroscope"),&Input::get_gyroscope); - //ClassDB::bind_method(_MD("get_mouse_pos"),&Input::get_mouse_pos); - this is not the function you want - ClassDB::bind_method(_MD("get_last_mouse_speed"),&Input::get_last_mouse_speed); - ClassDB::bind_method(_MD("get_mouse_button_mask"),&Input::get_mouse_button_mask); - ClassDB::bind_method(_MD("set_mouse_mode","mode"),&Input::set_mouse_mode); - ClassDB::bind_method(_MD("get_mouse_mode"),&Input::get_mouse_mode); - ClassDB::bind_method(_MD("warp_mouse_pos","to"),&Input::warp_mouse_pos); - ClassDB::bind_method(_MD("action_press","action"),&Input::action_press); - ClassDB::bind_method(_MD("action_release","action"),&Input::action_release); - ClassDB::bind_method(_MD("set_custom_mouse_cursor","image:Texture","hotspot"),&Input::set_custom_mouse_cursor,DEFVAL(Vector2())); + ClassDB::bind_method(D_METHOD("is_key_pressed","scancode"),&Input::is_key_pressed); + ClassDB::bind_method(D_METHOD("is_mouse_button_pressed","button"),&Input::is_mouse_button_pressed); + ClassDB::bind_method(D_METHOD("is_joy_button_pressed","device","button"),&Input::is_joy_button_pressed); + ClassDB::bind_method(D_METHOD("is_action_pressed","action"),&Input::is_action_pressed); + ClassDB::bind_method(D_METHOD("is_action_just_pressed","action"),&Input::is_action_just_pressed); + ClassDB::bind_method(D_METHOD("is_action_just_released","action"),&Input::is_action_just_released); + ClassDB::bind_method(D_METHOD("add_joy_mapping","mapping", "update_existing"),&Input::add_joy_mapping, DEFVAL(false)); + ClassDB::bind_method(D_METHOD("remove_joy_mapping","guid"),&Input::remove_joy_mapping); + ClassDB::bind_method(D_METHOD("is_joy_known","device"),&Input::is_joy_known); + ClassDB::bind_method(D_METHOD("get_joy_axis","device","axis"),&Input::get_joy_axis); + ClassDB::bind_method(D_METHOD("get_joy_name","device"),&Input::get_joy_name); + ClassDB::bind_method(D_METHOD("get_joy_guid","device"),&Input::get_joy_guid); + ClassDB::bind_method(D_METHOD("get_connected_joypads"),&Input::get_connected_joypads); + ClassDB::bind_method(D_METHOD("get_joy_vibration_strength", "device"), &Input::get_joy_vibration_strength); + ClassDB::bind_method(D_METHOD("get_joy_vibration_duration", "device"), &Input::get_joy_vibration_duration); + ClassDB::bind_method(D_METHOD("get_joy_button_string", "button_index"), &Input::get_joy_button_string); + ClassDB::bind_method(D_METHOD("get_joy_button_index_from_string", "button"), &Input::get_joy_button_index_from_string); + ClassDB::bind_method(D_METHOD("get_joy_axis_string", "axis_index"), &Input::get_joy_axis_string); + ClassDB::bind_method(D_METHOD("get_joy_axis_index_from_string", "axis"), &Input::get_joy_axis_index_from_string); + ClassDB::bind_method(D_METHOD("start_joy_vibration", "device", "weak_magnitude", "strong_magnitude", "duration"), &Input::start_joy_vibration, DEFVAL(0)); + ClassDB::bind_method(D_METHOD("stop_joy_vibration", "device"), &Input::stop_joy_vibration); + ClassDB::bind_method(D_METHOD("get_gravity"),&Input::get_gravity); + ClassDB::bind_method(D_METHOD("get_accelerometer"),&Input::get_accelerometer); + ClassDB::bind_method(D_METHOD("get_magnetometer"),&Input::get_magnetometer); + ClassDB::bind_method(D_METHOD("get_gyroscope"),&Input::get_gyroscope); + //ClassDB::bind_method(D_METHOD("get_mouse_pos"),&Input::get_mouse_pos); - this is not the function you want + ClassDB::bind_method(D_METHOD("get_last_mouse_speed"),&Input::get_last_mouse_speed); + ClassDB::bind_method(D_METHOD("get_mouse_button_mask"),&Input::get_mouse_button_mask); + ClassDB::bind_method(D_METHOD("set_mouse_mode","mode"),&Input::set_mouse_mode); + ClassDB::bind_method(D_METHOD("get_mouse_mode"),&Input::get_mouse_mode); + ClassDB::bind_method(D_METHOD("warp_mouse_pos","to"),&Input::warp_mouse_pos); + ClassDB::bind_method(D_METHOD("action_press","action"),&Input::action_press); + ClassDB::bind_method(D_METHOD("action_release","action"),&Input::action_release); + ClassDB::bind_method(D_METHOD("set_custom_mouse_cursor","image:Texture","hotspot"),&Input::set_custom_mouse_cursor,DEFVAL(Vector2())); BIND_CONSTANT( MOUSE_MODE_VISIBLE ); BIND_CONSTANT( MOUSE_MODE_HIDDEN ); diff --git a/core/os/main_loop.cpp b/core/os/main_loop.cpp index 11396666d2..dcda8e8952 100644 --- a/core/os/main_loop.cpp +++ b/core/os/main_loop.cpp @@ -31,12 +31,12 @@ void MainLoop::_bind_methods() { - ClassDB::bind_method(_MD("input_event","ev"),&MainLoop::input_event); - ClassDB::bind_method(_MD("input_text","text"),&MainLoop::input_text); - ClassDB::bind_method(_MD("init"),&MainLoop::init); - ClassDB::bind_method(_MD("iteration","delta"),&MainLoop::iteration); - ClassDB::bind_method(_MD("idle","delta"),&MainLoop::idle); - ClassDB::bind_method(_MD("finish"),&MainLoop::finish); + ClassDB::bind_method(D_METHOD("input_event","ev"),&MainLoop::input_event); + ClassDB::bind_method(D_METHOD("input_text","text"),&MainLoop::input_text); + ClassDB::bind_method(D_METHOD("init"),&MainLoop::init); + ClassDB::bind_method(D_METHOD("iteration","delta"),&MainLoop::iteration); + ClassDB::bind_method(D_METHOD("idle","delta"),&MainLoop::idle); + ClassDB::bind_method(D_METHOD("finish"),&MainLoop::finish); BIND_VMETHOD( MethodInfo("_input_event",PropertyInfo(Variant::INPUT_EVENT,"ev")) ); BIND_VMETHOD( MethodInfo("_input_text",PropertyInfo(Variant::STRING,"text")) ); |