### Godot version

4.2 RC1

### System information

Windows 11 

### Issue description

While working with the TileMap following a tutorial I've ran into several issues that turned out to be related to persistence of modes between tools (Select, Scale, Erase, and Move). I tried to write a report only to stumble on the reproduction steps, but solved most the issue myself when figuring out persistence of these modes. 

The remaining bug I've identified is when in paint mode in the tilemap, select mode in the editor, where you paint a large line between move positions when using hotkeys to switch between move and select mode.

### Steps to reproduce

1) Pain a tile line of tiles (any direction or length)
2) Press W to switch to move mode while having not released the left mouse button
3) Let got of left mouse, use move mode drag the screen to a new position (method doesn't matter middles click or left mouse)
4) Press Q to switch editor to select mode.
5) A line will be created for the entire path you have move the mouse through, further you'll be stuck active painting where ever the mouse moves until you left click again.

I've also observed some others behaviors that are odd such as snap moving to the mouse position when transitioning to move mode. I suspect its related.

### Minimal reproduction project

N/A
Ref<PackedScene> scene = scenes_collection_source->get_scene_tile_scene(scene_id);
		int item_index = 0;
		if (scene.is_valid()) {
			item_index = scene_tiles_list->add_item(vformat("%s (Path: %s, ID: %d)", scene->get_path().get_file().get_basename(), scene->get_path(), scene_id));
			Variant udata = i;
			EditorResourcePreview::get_singleton()->queue_edited_resource_preview(scene, this, "_scene_thumbnail_done", udata);
		} else {
			item_index = scene_tiles_list->add_item(TTR("Tile with Invalid Scene"), tiles_bottom_panel->get_editor_theme_icon(SNAME("PackedScene")));
		}
		scene_tiles_list->set_item_metadata(item_index, scene_id);
		
		if (tile_set_selection.has(TileMapCell(source_id, Vector2i(), scene_id))) {
			scene_tiles_list->select(item_index, false);
		}
	}
	if (scene_tiles_list->get_item_count() == 0) {
		scene_tiles_list->add_item(TTR("The selected scene collection source has no scenes. Add scenes in the TileSet bottom tab."));
		scene_tiles_list->set_item_disabled(-1, true);
	}
	
	int int_size = int(EDITOR_GET("filesystem/file_dialog/thumbnail_size")) * EDSCALE;
	scene_tiles_list->set_fixed_icon_size(Vector2(int_size, int_size));
}
void TileMapEditorTilesPlugin::_scene_thumbnail_done(const String &p_path, const Ref<Texture2D> &p_preview, const Ref<Texture2D> &p_small_preview, Variant p_ud) {
	int index = p_ud;
	if (index >= 0 && index < scene_tiles_list->get_item_count()) {
		scene_tiles_list->set_item_icon(index, p_preview);
	}
}
void TileMapEditorTilesPlugin::_scenes_list_multi_selected(int p_index, bool p_selected) {