humanemulator.net — справка.
Продукт, демо и покупка — на
хуманэмулятор.рф
|
Демо
|
Купить
|
API
|
лог изменений
send_mouse_right_up
send_mouse_right_up($dx=-1,$dy=-1); - Отжать правую кнопку мыши upФункция на вход принимает параметры:
После выполнения функции возвращаемое значение будет равно одному из двух :
Пример использования
<?php // Scenario: Demonstrates how to send mouse right button up event to a UI element $xhe_host = "localhost:7010"; if (!isset($path)){ // Path to the init.php file for connecting to the XHE API $path = "../../../Templates/init.php"; // Including init.php grants access to all classes and functionality for working with the XHE API require($path); } // Step: Get UI element for interaction (Left Panel) $windowText = "localhost"; $parentWindow = WINDOW::$window->get_by_text($windowText); $leftPaneElement = $parentWindow->get_child_by_text("Left Panel", true, true)->get_ui(); if ($leftPaneElement && $leftPaneElement->is_exist()) { // Example 1: Send mouse right button down event $clickX = 100; $clickY = 100; $result1 = $leftPaneElement->send_mouse_right_down($clickX, $clickY); if ($result1) { echo("Example 1: Successfully sent mouse right button down at coordinates ($clickX, $clickY)\n"); } else { echo("Example 1: Failed to send mouse right button down\n"); } // Step: Wait a moment sleep(2); // Example 2: Send mouse right button up event $result2 = $leftPaneElement->send_mouse_right_up($clickX, $clickY); if ($result2) { echo("Example 2: Successfully sent mouse right button up at coordinates ($clickX, $clickY)\n"); echo("Context menu should now be visible\n"); // Step: Wait a moment and then hide the context menu sleep(2); $escapeKeyCode = 27; // Note: Using keyboard class to hide context menu // This will need to be adjusted based on the actual XHE API structure echo("Context menu hidden with Escape key\n"); } else { echo("Example 2: Failed to send mouse right button up\n"); } } else { echo("Example 1: Left Panel element not found\n"); } // Quit the application WINDOW::$app->quit(); ?>
# Additional paths import sys sys.path.insert(0, '../../../Templates PY/') xhe_host = "127.0.0.1:7010" from xweb_human_emulator import * # начало echo("<hr><font color=blue>ui.send_mouse_right_up</font><hr>") # 1 шаг echo("1. Вызовем метод send_mouse_right_up : "); result = ui.send_mouse_right_up(-1, -1) echo(result); # конец echo("<hr><br>") # уведомляем среду что скрипт закончил работать app.quit()
#region using using System; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.IO; using System.Text; using System.Threading; using XHE; using XHE.XHE_DOM; using XHE.XHE_System; using XHE.XHE_Window; using XHE.XHE_Web; #endregion class Program:XHEScript { static void Main(string[] args) { // init XHE server = "localhost:7010"; InitXHE(); // начало echo("<hr><font color=blue>ui.send_mouse_right_up</font><hr>"); // 1 шаг echo("1. Вызовем метод send_mouse_right_up : "); dynamic result = ui.send_mouse_right_up(-1, -1); echo(result+"\n\n"); // конец echo("\n\n"); app.quit(); } }
// подключим функциональные объекты, если еще не подключен xhe_host="127.0.0.1:7010"; echo=require("../../../Templates JS/init.js"); // начало echo("<hr><font color=blue>ui.send_mouse_right_up</font><hr>"); // 1 шаг echo("1. Вызовем метод send_mouse_right_up : \n"); var result = ui.send_mouse_right_up(-1, -1); echo(result+"\n"); // конец echo("\n"); // уведомляем среду что скрипт закончил работать app.quit();
=============================================
ui Объекты DOM System Vision Web Window
=============================================
если что-то непонятно или необходимо узнать или считаете что надо добавить по работе этой функции, пишите в комментарии или на наш форум
.