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");
|
11
examples/select_window.php
Normal file
11
examples/select_window.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
require_once __DIR__."/../vendor/autoload.php";
|
||||
|
||||
use NoccyLabs\X11\WindowSelector;
|
||||
|
||||
$selector = new WindowSelector();
|
||||
|
||||
printf("Click a window to select it...\n");
|
||||
$window = $selector->select();
|
||||
$window->dump();
|
8
examples/self_keys.php
Normal file
8
examples/self_keys.php
Normal file
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
require_once __DIR__."/../vendor/autoload.php";
|
||||
|
||||
use NoccyLabs\X11\Window;
|
||||
|
||||
$me = new Window();
|
||||
$me->sendKeys("l s Return", true);
|
Reference in New Issue
Block a user