Initial commit
This commit is contained in:
20
examples/find_windows.php
Normal file
20
examples/find_windows.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
require_once __DIR__."/../vendor/autoload.php";
|
||||
|
||||
use NoccyLabs\X11\WindowList;
|
||||
|
||||
// Create a list of all windows
|
||||
$windows = new WindowList();
|
||||
$windows->dump();
|
||||
|
||||
// Select all the windows with a title matching *code*
|
||||
$windows = $windows->visible()->find("*code*");
|
||||
$windows->dump();
|
||||
|
||||
// Grab the first window
|
||||
$window = $windows->first();
|
||||
$window->dump();
|
||||
|
||||
// Focus the window and simulate F1 being pressed
|
||||
$window->focus()->sendKeys("F1");
|
Reference in New Issue
Block a user