libxdo
|
Go to the source code of this file.
Data Structures | |
struct | charcodemap |
struct | xdo |
The main context. More... | |
struct | xdo_search |
The window search query structure. More... | |
Typedefs | |
typedef struct charcodemap | charcodemap_t |
typedef struct xdo | xdo_t |
The main context. | |
typedef struct xdo_search | xdo_search_t |
The window search query structure. | |
Enumerations | |
enum | XDO_FEATURES { XDO_FEATURE_XTEST } |
Functions | |
xdo_t * | xdo_new (const char *display) |
Create a new xdo_t instance. | |
xdo_t * | xdo_new_with_opened_display (Display *xdpy, const char *display, int close_display_when_freed) |
Create a new xdo_t instance with an existing X11 Display instance. | |
const char * | xdo_version (void) |
Return a string representing the version of this library. | |
void | xdo_free (xdo_t *xdo) |
Free and destroy an xdo_t instance. | |
int | xdo_move_mouse (const xdo_t *xdo, int x, int y, int screen) |
Move the mouse to a specific location. | |
int | xdo_move_mouse_relative_to_window (const xdo_t *xdo, Window window, int x, int y) |
Move the mouse to a specific location relative to the top-left corner of a window. | |
int | xdo_move_mouse_relative (const xdo_t *xdo, int x, int y) |
Move the mouse relative to it's current position. | |
int | xdo_mouse_down (const xdo_t *xdo, Window window, int button) |
Send a mouse press (aka mouse down) for a given button at the current mouse location. | |
int | xdo_mouse_up (const xdo_t *xdo, Window window, int button) |
Send a mouse release (aka mouse up) for a given button at the current mouse location. | |
int | xdo_get_mouse_location (const xdo_t *xdo, int *x, int *y, int *screen_num) |
Get the current mouse location (coordinates and screen number). | |
int | xdo_get_window_at_mouse (const xdo_t *xdo, Window *window_ret) |
Get the window the mouse is currently over. | |
int | xdo_get_mouse_location2 (const xdo_t *xdo, int *x_ret, int *y_ret, int *screen_num_ret, Window *window_ret) |
Get all mouse location-related data. | |
int | xdo_wait_for_mouse_move_from (const xdo_t *xdo, int origin_x, int origin_y) |
Wait for the mouse to move from a location. | |
int | xdo_wait_for_mouse_move_to (const xdo_t *xdo, int dest_x, int dest_y) |
Wait for the mouse to move to a location. | |
int | xdo_click_window (const xdo_t *xdo, Window window, int button) |
Send a click for a specific mouse button at the current mouse location. | |
int | xdo_click_window_multiple (const xdo_t *xdo, Window window, int button, int repeat, useconds_t delay) |
Send a one or more clicks for a specific mouse button at the current mouse location. | |
int | xdo_enter_text_window (const xdo_t *xdo, Window window, const char *string, useconds_t delay) |
Type a string to the specified window. | |
int | xdo_send_keysequence_window (const xdo_t *xdo, Window window, const char *keysequence, useconds_t delay) |
Send a keysequence to the specified window. | |
int | xdo_send_keysequence_window_up (const xdo_t *xdo, Window window, const char *keysequence, useconds_t delay) |
Send key release (up) events for the given key sequence. | |
int | xdo_send_keysequence_window_down (const xdo_t *xdo, Window window, const char *keysequence, useconds_t delay) |
Send key press (down) events for the given key sequence. | |
int | xdo_send_keysequence_window_list_do (const xdo_t *xdo, Window window, charcodemap_t *keys, int nkeys, int pressed, int *modifier, useconds_t delay) |
Send a series of keystrokes. | |
int | xdo_get_active_keys_to_keycode_list (const xdo_t *xdo, charcodemap_t **keys, int *nkeys) |
Get a list of active keys. | |
int | xdo_wait_for_window_map_state (const xdo_t *xdo, Window wid, int map_state) |
Wait for a window to have a specific map state. | |
int | xdo_wait_for_window_size (const xdo_t *xdo, Window window, unsigned int width, unsigned int height, int flags, int to_or_from) |
int | xdo_move_window (const xdo_t *xdo, Window wid, int x, int y) |
Move a window to a specific location. | |
int | xdo_translate_window_with_sizehint (const xdo_t *xdo, Window window, unsigned int width, unsigned int height, unsigned int *width_ret, unsigned int *height_ret) |
Apply a window's sizing hints (if any) to a given width and height. | |
int | xdo_set_window_size (const xdo_t *xdo, Window wid, int w, int h, int flags) |
Change the window size. | |
int | xdo_set_window_property (const xdo_t *xdo, Window wid, const char *property, const char *value) |
Change a window property. | |
int | xdo_set_window_class (const xdo_t *xdo, Window wid, const char *name, const char *_class) |
Change the window's classname and or class. | |
int | xdo_set_window_urgency (const xdo_t *xdo, Window wid, int urgency) |
Sets the urgency hint for a window. | |
int | xdo_set_window_override_redirect (const xdo_t *xdo, Window wid, int override_redirect) |
Set the override_redirect value for a window. | |
int | xdo_focus_window (const xdo_t *xdo, Window wid) |
Focus a window. | |
int | xdo_raise_window (const xdo_t *xdo, Window wid) |
Raise a window to the top of the window stack. | |
int | xdo_get_focused_window (const xdo_t *xdo, Window *window_ret) |
Get the window currently having focus. | |
int | xdo_wait_for_window_focus (const xdo_t *xdo, Window window, int want_focus) |
Wait for a window to have or lose focus. | |
int | xdo_get_pid_window (const xdo_t *xdo, Window window) |
Get the PID owning a window. | |
int | xdo_get_focused_window_sane (const xdo_t *xdo, Window *window_ret) |
Like xdo_get_focused_window, but return the first ancestor-or-self window * having a property of WM_CLASS. | |
int | xdo_activate_window (const xdo_t *xdo, Window wid) |
Activate a window. | |
int | xdo_wait_for_window_active (const xdo_t *xdo, Window window, int active) |
Wait for a window to be active or not active. | |
int | xdo_map_window (const xdo_t *xdo, Window wid) |
Map a window. | |
int | xdo_unmap_window (const xdo_t *xdo, Window wid) |
Unmap a window. | |
int | xdo_minimize_window (const xdo_t *xdo, Window wid) |
Minimize a window. | |
int | xdo_reparent_window (const xdo_t *xdo, Window wid_source, Window wid_target) |
Reparents a window. | |
int | xdo_get_window_location (const xdo_t *xdo, Window wid, int *x_ret, int *y_ret, Screen **screen_ret) |
Get a window's location. | |
int | xdo_get_window_size (const xdo_t *xdo, Window wid, unsigned int *width_ret, unsigned int *height_ret) |
Get a window's size. | |
int | xdo_get_active_window (const xdo_t *xdo, Window *window_ret) |
Get the currently-active window. | |
int | xdo_select_window_with_click (const xdo_t *xdo, Window *window_ret) |
Get a window ID by clicking on it. | |
int | xdo_set_number_of_desktops (const xdo_t *xdo, long ndesktops) |
Set the number of desktops. | |
int | xdo_get_number_of_desktops (const xdo_t *xdo, long *ndesktops) |
Get the current number of desktops. | |
int | xdo_set_current_desktop (const xdo_t *xdo, long desktop) |
Switch to another desktop. | |
int | xdo_get_current_desktop (const xdo_t *xdo, long *desktop) |
Get the current desktop. | |
int | xdo_set_desktop_for_window (const xdo_t *xdo, Window wid, long desktop) |
Move a window to another desktop Uses _NET_WM_DESKTOP of the EWMH spec. | |
int | xdo_get_desktop_for_window (const xdo_t *xdo, Window wid, long *desktop) |
Get the desktop a window is on. | |
int | xdo_search_windows (const xdo_t *xdo, const xdo_search_t *search, Window **windowlist_ret, unsigned int *nwindows_ret) |
Search for windows. | |
unsigned char * | xdo_get_window_property_by_atom (const xdo_t *xdo, Window window, Atom atom, long *nitems, Atom *type, int *size) |
Generic property fetch. | |
int | xdo_get_window_property (const xdo_t *xdo, Window window, const char *property, unsigned char **value, long *nitems, Atom *type, int *size) |
Get property of window by name of atom. | |
unsigned int | xdo_get_input_state (const xdo_t *xdo) |
Get the current input state. | |
const char ** | xdo_get_symbol_map (void) |
If you need the symbol map, use this method. | |
int | xdo_get_active_modifiers (const xdo_t *xdo, charcodemap_t **keys, int *nkeys) |
Get a list of active keys. | |
int | xdo_clear_active_modifiers (const xdo_t *xdo, Window window, charcodemap_t *active_mods, int active_mods_n) |
Send any events necessary to clear the active modifiers. | |
int | xdo_set_active_modifiers (const xdo_t *xdo, Window window, charcodemap_t *active_mods, int active_mods_n) |
Send any events necessary to make these modifiers active. | |
int | xdo_get_desktop_viewport (const xdo_t *xdo, int *x_ret, int *y_ret) |
Get the position of the current viewport. | |
int | xdo_set_desktop_viewport (const xdo_t *xdo, int x, int y) |
Set the position of the current viewport. | |
int | xdo_kill_window (const xdo_t *xdo, Window window) |
Kill a window and the client owning it. | |
int | xdo_close_window (const xdo_t *xdo, Window window) |
Close a window without trying to kill the client. | |
int | xdo_find_window_client (const xdo_t *xdo, Window window, Window *window_ret, int direction) |
Find a client window (child) in a given window. | |
int | xdo_get_window_name (const xdo_t *xdo, Window window, unsigned char **name_ret, int *name_len_ret, int *name_type) |
Get a window's name, if any. | |
void | xdo_disable_feature (xdo_t *xdo, int feature) |
Disable an xdo feature. | |
void | xdo_enable_feature (xdo_t *xdo, int feature) |
Enable an xdo feature. | |
int | xdo_has_feature (xdo_t *xdo, int feature) |
Check if a feature is enabled. | |
int | xdo_get_viewport_dimensions (xdo_t *xdo, unsigned int *width, unsigned int *height, int screen) |
Query the viewport (your display) dimensions. | |
typedef struct xdo_search xdo_search_t |
The window search query structure.
int xdo_activate_window | ( | const xdo_t * | xdo, |
Window | wid | ||
) |
Activate a window.
This is generally a better choice than xdo_focus_window for a variety of reasons, but it requires window manager support:
Requires your window manager to support this. Uses _NET_ACTIVE_WINDOW from the EWMH spec.
wid | the window to activate |
int xdo_clear_active_modifiers | ( | const xdo_t * | xdo, |
Window | window, | ||
charcodemap_t * | active_mods, | ||
int | active_mods_n | ||
) |
Send any events necessary to clear the active modifiers.
For example, if you are holding 'alt' when xdo_get_active_modifiers is called, then this method will send a key-up for 'alt'
int xdo_click_window | ( | const xdo_t * | xdo, |
Window | window, | ||
int | button | ||
) |
Send a click for a specific mouse button at the current mouse location.
window | The window you want to send the event to or CURRENTWINDOW |
button | The mouse button. Generally, 1 is left, 2 is middle, 3 is right, 4 is wheel up, 5 is wheel down. |
int xdo_click_window_multiple | ( | const xdo_t * | xdo, |
Window | window, | ||
int | button, | ||
int | repeat, | ||
useconds_t | delay | ||
) |
Send a one or more clicks for a specific mouse button at the current mouse location.
window | The window you want to send the event to or CURRENTWINDOW |
button | The mouse button. Generally, 1 is left, 2 is middle, 3 is right, 4 is wheel up, 5 is wheel down. |
void xdo_disable_feature | ( | xdo_t * | xdo, |
int | feature | ||
) |
Disable an xdo feature.
This function is mainly used by libxdo itself, however, you may find it useful in your own applications.
void xdo_enable_feature | ( | xdo_t * | xdo, |
int | feature | ||
) |
Enable an xdo feature.
This function is mainly used by libxdo itself, however, you may find it useful in your own applications.
int xdo_enter_text_window | ( | const xdo_t * | xdo, |
Window | window, | ||
const char * | string, | ||
useconds_t | delay | ||
) |
Type a string to the specified window.
If you want to send a specific key or key sequence, such as "alt+l", you want instead xdo_send_keysequence_window(...).
window | The window you want to send keystrokes to or CURRENTWINDOW |
string | The string to type, like "Hello world!" |
delay | The delay between keystrokes in microseconds. 12000 is a decent choice if you don't have other plans. |
int xdo_find_window_client | ( | const xdo_t * | xdo, |
Window | window, | ||
Window * | window_ret, | ||
int | direction | ||
) |
Find a client window (child) in a given window.
Useful if you get the window manager's decorator window rather than the client window.
int xdo_focus_window | ( | const xdo_t * | xdo, |
Window | wid | ||
) |
void xdo_free | ( | xdo_t * | xdo | ) |
Free and destroy an xdo_t instance.
If close_display_when_freed is set, then we will also close the Display.
int xdo_get_active_keys_to_keycode_list | ( | const xdo_t * | xdo, |
charcodemap_t ** | keys, | ||
int * | nkeys | ||
) |
Get a list of active keys.
Uses XQueryKeymap.
keys | Pointer to the array of charcodemap_t that will be allocated by this function. |
nkeys | Pointer to integer where the number of keys will be stored. |
int xdo_get_active_modifiers | ( | const xdo_t * | xdo, |
charcodemap_t ** | keys, | ||
int * | nkeys | ||
) |
Get a list of active keys.
Uses XQueryKeymap.
keys | Pointer to the array of charcodemap_t that will be allocated by this function. |
nkeys | Pointer to integer where the number of keys will be stored. |
int xdo_get_active_window | ( | const xdo_t * | xdo, |
Window * | window_ret | ||
) |
Get the currently-active window.
Requires your window manager to support this. Uses _NET_ACTIVE_WINDOW from the EWMH spec.
window_ret | Pointer to Window where the active window is stored. |
int xdo_get_current_desktop | ( | const xdo_t * | xdo, |
long * | desktop | ||
) |
Get the current desktop.
Uses _NET_CURRENT_DESKTOP of the EWMH spec.
desktop | pointer to long where the current desktop number is stored. |
int xdo_get_desktop_for_window | ( | const xdo_t * | xdo, |
Window | wid, | ||
long * | desktop | ||
) |
Get the desktop a window is on.
Uses _NET_WM_DESKTOP of the EWMH spec.
If your desktop does not support _NET_WM_DESKTOP, then '*desktop' remains unmodified.
wid | the window to query |
deskto | pointer to long where the desktop of the window is stored |
int xdo_get_desktop_viewport | ( | const xdo_t * | xdo, |
int * | x_ret, | ||
int * | y_ret | ||
) |
Get the position of the current viewport.
This is only relevant if your window manager supports _NET_DESKTOP_VIEWPORT
int xdo_get_focused_window | ( | const xdo_t * | xdo, |
Window * | window_ret | ||
) |
Get the window currently having focus.
window_ret | Pointer to a window where the currently-focused window will be stored. |
int xdo_get_focused_window_sane | ( | const xdo_t * | xdo, |
Window * | window_ret | ||
) |
Like xdo_get_focused_window, but return the first ancestor-or-self window * having a property of WM_CLASS.
This allows you to get the "real" or top-level-ish window having focus rather than something you may not expect to be the window having focused.
window_ret | Pointer to a window where the currently-focused window will be stored. |
unsigned int xdo_get_input_state | ( | const xdo_t * | xdo | ) |
Get the current input state.
This is a mask value containing any of the following: ShiftMask, LockMask, ControlMask, Mod1Mask, Mod2Mask, Mod3Mask, Mod4Mask, or Mod5Mask.
int xdo_get_mouse_location | ( | const xdo_t * | xdo, |
int * | x, | ||
int * | y, | ||
int * | screen_num | ||
) |
Get the current mouse location (coordinates and screen number).
x | integer pointer where the X coordinate will be stored |
y | integer pointer where the Y coordinate will be stored |
screen_num | integer pointer where the screen number will be stored |
int xdo_get_mouse_location2 | ( | const xdo_t * | xdo, |
int * | x_ret, | ||
int * | y_ret, | ||
int * | screen_num_ret, | ||
Window * | window_ret | ||
) |
Get all mouse location-related data.
If null is passed for any parameter, we simply do not store it. Useful if you only want the 'y' coordinate, for example.
x | integer pointer where the X coordinate will be stored |
y | integer pointer where the Y coordinate will be stored |
screen_num | integer pointer where the screen number will be stored |
window | Window pointer where the window/client the mouse is over will be stored. |
int xdo_get_number_of_desktops | ( | const xdo_t * | xdo, |
long * | ndesktops | ||
) |
Get the current number of desktops.
Uses _NET_NUMBER_OF_DESKTOPS of the EWMH spec.
ndesktops | pointer to long where the current number of desktops is stored |
int xdo_get_pid_window | ( | const xdo_t * | xdo, |
Window | window | ||
) |
Get the PID owning a window.
Not all applications support this. It looks at the _NET_WM_PID property of the window.
window | the window to query. |
const char ** xdo_get_symbol_map | ( | void | ) |
If you need the symbol map, use this method.
The symbol map is an array of string pairs mapping common tokens to X Keysym strings, such as "alt" to "Alt_L"
int xdo_get_viewport_dimensions | ( | xdo_t * | xdo, |
unsigned int * | width, | ||
unsigned int * | height, | ||
int | screen | ||
) |
Query the viewport (your display) dimensions.
If Xinerama is active and supported, that api internally is used. If Xineram is disabled, we will report the root window's dimensions for the given screen.
int xdo_get_window_at_mouse | ( | const xdo_t * | xdo, |
Window * | window_ret | ||
) |
Get the window the mouse is currently over.
window_ret | Winter pointer where the window will be stored. |
int xdo_get_window_location | ( | const xdo_t * | xdo, |
Window | wid, | ||
int * | x_ret, | ||
int * | y_ret, | ||
Screen ** | screen_ret | ||
) |
Get a window's location.
wid | the window to query |
x_ret | pointer to int where the X location is stored. If NULL, X is ignored. |
y_ret | pointer to int where the Y location is stored. If NULL, X is ignored. |
screen_ret | Pointer to Screen* where the Screen* the window on is stored. If NULL, this parameter is ignored. |
int xdo_get_window_name | ( | const xdo_t * | xdo, |
Window | window, | ||
unsigned char ** | name_ret, | ||
int * | name_len_ret, | ||
int * | name_type | ||
) |
Get a window's name, if any.
TODO(sissel): Document
http://standards.freedesktop.org/wm-spec/1.3/ar01s05.html Prefer _NET_WM_NAME if available, otherwise use WM_NAME If no WM_NAME, set name_ret to NULL and set len to 0
int xdo_get_window_property | ( | const xdo_t * | xdo, |
Window | window, | ||
const char * | property, | ||
unsigned char ** | value, | ||
long * | nitems, | ||
Atom * | type, | ||
int * | size | ||
) |
Get property of window by name of atom.
window | the window to query |
property | the name of the atom |
nitems | the number of items |
type | the type of the return |
size | the size of the type |
unsigned char * xdo_get_window_property_by_atom | ( | const xdo_t * | xdo, |
Window | window, | ||
Atom | atom, | ||
long * | nitems, | ||
Atom * | type, | ||
int * | size | ||
) |
Generic property fetch.
window | the window to query |
atom | the Atom to request |
nitems | the number of items |
type | the type of the return |
size | the size of the type |
int xdo_get_window_size | ( | const xdo_t * | xdo, |
Window | wid, | ||
unsigned int * | width_ret, | ||
unsigned int * | height_ret | ||
) |
Get a window's size.
wid | the window to query |
width_ret | pointer to unsigned int where the width is stored. |
height_ret | pointer to unsigned int where the height is stored. |
int xdo_has_feature | ( | xdo_t * | xdo, |
int | feature | ||
) |
Check if a feature is enabled.
This function is mainly used by libxdo itself, however, you may find it useful in your own applications.
int xdo_map_window | ( | const xdo_t * | xdo, |
Window | wid | ||
) |
Map a window.
This mostly means to make the window visible if it is not currently mapped.
wid | the window to map. |
int xdo_mouse_down | ( | const xdo_t * | xdo, |
Window | window, | ||
int | button | ||
) |
Send a mouse press (aka mouse down) for a given button at the current mouse location.
window | The window you want to send the event to or CURRENTWINDOW |
button | The mouse button. Generally, 1 is left, 2 is middle, 3 is right, 4 is wheel up, 5 is wheel down. |
int xdo_mouse_up | ( | const xdo_t * | xdo, |
Window | window, | ||
int | button | ||
) |
Send a mouse release (aka mouse up) for a given button at the current mouse location.
window | The window you want to send the event to or CURRENTWINDOW |
button | The mouse button. Generally, 1 is left, 2 is middle, 3 is right, 4 is wheel up, 5 is wheel down. |
int xdo_move_mouse | ( | const xdo_t * | xdo, |
int | x, | ||
int | y, | ||
int | screen | ||
) |
Move the mouse to a specific location.
x | the target X coordinate on the screen in pixels. |
y | the target Y coordinate on the screen in pixels. |
screen | the screen (number) you want to move on. |
int xdo_move_mouse_relative | ( | const xdo_t * | xdo, |
int | x, | ||
int | y | ||
) |
Move the mouse relative to it's current position.
x | the distance in pixels to move on the X axis. |
y | the distance in pixels to move on the Y axis. |
int xdo_move_mouse_relative_to_window | ( | const xdo_t * | xdo, |
Window | window, | ||
int | x, | ||
int | y | ||
) |
Move the mouse to a specific location relative to the top-left corner of a window.
x | the target X coordinate on the screen in pixels. |
y | the target Y coordinate on the screen in pixels. |
int xdo_move_window | ( | const xdo_t * | xdo, |
Window | wid, | ||
int | x, | ||
int | y | ||
) |
Move a window to a specific location.
The top left corner of the window will be moved to the x,y coordinate.
wid | the window to move |
x | the X coordinate to move to. |
y | the Y coordinate to move to. |
xdo_t * xdo_new | ( | const char * | display | ) |
Create a new xdo_t instance.
display | the string display name, such as ":0". If null, uses the environment variable DISPLAY just like XOpenDisplay(NULL). |
xdo_t * xdo_new_with_opened_display | ( | Display * | xdpy, |
const char * | display, | ||
int | close_display_when_freed | ||
) |
Create a new xdo_t instance with an existing X11 Display instance.
xdpy | the Display pointer given by a previous XOpenDisplay() |
display | the string display name |
close_display_when_freed | If true, we will close the display when xdo_free is called. Otherwise, we leave it open. |
int xdo_raise_window | ( | const xdo_t * | xdo, |
Window | wid | ||
) |
Raise a window to the top of the window stack.
This is also sometimes termed as bringing the window forward.
wid | The window to raise. |
int xdo_reparent_window | ( | const xdo_t * | xdo, |
Window | wid_source, | ||
Window | wid_target | ||
) |
Reparents a window.
wid_source | the window to reparent |
wid_target | the new parent window |
int xdo_search_windows | ( | const xdo_t * | xdo, |
const xdo_search_t * | search, | ||
Window ** | windowlist_ret, | ||
unsigned int * | nwindows_ret | ||
) |
Search for windows.
search | the search query. |
windowlist_ret | the list of matching windows to return |
nwindows_ret | the number of windows (length of windowlist_ret) |
int xdo_select_window_with_click | ( | const xdo_t * | xdo, |
Window * | window_ret | ||
) |
Get a window ID by clicking on it.
This function blocks until a selection is made.
window_ret | Pointer to Window where the selected window is stored. |
int xdo_send_keysequence_window | ( | const xdo_t * | xdo, |
Window | window, | ||
const char * | keysequence, | ||
useconds_t | delay | ||
) |
Send a keysequence to the specified window.
This allows you to send keysequences by symbol name. Any combination of X11 KeySym names separated by '+' are valid. Single KeySym names are valid, too.
Examples: "l" "semicolon" "alt+Return" "Alt_L+Tab"
If you want to type a string, such as "Hello world." you want to instead use xdo_enter_text_window.
window | The window you want to send the keysequence to or CURRENTWINDOW |
keysequence | The string keysequence to send. |
delay | The delay between keystrokes in microseconds. |
int xdo_send_keysequence_window_down | ( | const xdo_t * | xdo, |
Window | window, | ||
const char * | keysequence, | ||
useconds_t | delay | ||
) |
Send key press (down) events for the given key sequence.
int xdo_send_keysequence_window_list_do | ( | const xdo_t * | xdo, |
Window | window, | ||
charcodemap_t * | keys, | ||
int | nkeys, | ||
int | pressed, | ||
int * | modifier, | ||
useconds_t | delay | ||
) |
Send a series of keystrokes.
window | The window to send events to or CURRENTWINDOW |
keys | The array of charcodemap_t entities to send. |
nkeys | The length of the keys parameter |
pressed | 1 for key press, 0 for key release. |
modifier | Pointer to integer to record the modifiers activated by the keys being pressed. If NULL, we don't save the modifiers. |
delay | The delay between keystrokes in microseconds. |
int xdo_send_keysequence_window_up | ( | const xdo_t * | xdo, |
Window | window, | ||
const char * | keysequence, | ||
useconds_t | delay | ||
) |
Send key release (up) events for the given key sequence.
int xdo_set_active_modifiers | ( | const xdo_t * | xdo, |
Window | window, | ||
charcodemap_t * | active_mods, | ||
int | active_mods_n | ||
) |
Send any events necessary to make these modifiers active.
This is useful if you just cleared the active modifiers and then wish to restore them after.
int xdo_set_current_desktop | ( | const xdo_t * | xdo, |
long | desktop | ||
) |
Switch to another desktop.
Uses _NET_CURRENT_DESKTOP of the EWMH spec.
desktop | The desktop number to switch to. |
int xdo_set_desktop_for_window | ( | const xdo_t * | xdo, |
Window | wid, | ||
long | desktop | ||
) |
Move a window to another desktop Uses _NET_WM_DESKTOP of the EWMH spec.
wid | the window to move |
desktop | the desktop destination for the window |
int xdo_set_desktop_viewport | ( | const xdo_t * | xdo, |
int | x, | ||
int | y | ||
) |
Set the position of the current viewport.
This is only relevant if your window manager supports _NET_DESKTOP_VIEWPORT
int xdo_set_number_of_desktops | ( | const xdo_t * | xdo, |
long | ndesktops | ||
) |
Set the number of desktops.
Uses _NET_NUMBER_OF_DESKTOPS of the EWMH spec.
ndesktops | the new number of desktops to set. |
int xdo_set_window_class | ( | const xdo_t * | xdo, |
Window | wid, | ||
const char * | name, | ||
const char * | _class | ||
) |
Change the window's classname and or class.
name | The new class name. If NULL, no change. |
_class | The new class. If NULL, no change. |
int xdo_set_window_override_redirect | ( | const xdo_t * | xdo, |
Window | wid, | ||
int | override_redirect | ||
) |
Set the override_redirect value for a window.
This generally means whether or not a window manager will manage this window.
If you set it to 1, the window manager will usually not draw borders on the window, etc. If you set it to 0, the window manager will see it like a normal application window.
int xdo_set_window_property | ( | const xdo_t * | xdo, |
Window | wid, | ||
const char * | property, | ||
const char * | value | ||
) |
Change a window property.
Example properties you can change are WM_NAME, WM_ICON_NAME, etc.
wid | The window to change a property of. |
property | the string name of the property. |
value | the string value of the property. |
int xdo_set_window_size | ( | const xdo_t * | xdo, |
Window | wid, | ||
int | w, | ||
int | h, | ||
int | flags | ||
) |
Change the window size.
wid | the window to resize |
w | the new desired width |
h | the new desired height |
flags | if 0, use pixels for units. If SIZE_USEHINTS, then the units will be relative to the window size hints. |
int xdo_translate_window_with_sizehint | ( | const xdo_t * | xdo, |
Window | window, | ||
unsigned int | width, | ||
unsigned int | height, | ||
unsigned int * | width_ret, | ||
unsigned int * | height_ret | ||
) |
Apply a window's sizing hints (if any) to a given width and height.
This function wraps XGetWMNormalHints() and applies any resize increment and base size to your given width and height values.
window | the window to use |
width | the unit width you want to translate |
height | the unit height you want to translate |
width_ret | the return location of the translated width |
height_ret | the return location of the translated height |
int xdo_unmap_window | ( | const xdo_t * | xdo, |
Window | wid | ||
) |
Unmap a window.
wid | the window to unmap |
int xdo_wait_for_mouse_move_from | ( | const xdo_t * | xdo, |
int | origin_x, | ||
int | origin_y | ||
) |
Wait for the mouse to move from a location.
This function will block until the condition has been satisfied.
origin_x | the X position you expect the mouse to move from |
origin_y | the Y position you expect the mouse to move from |
int xdo_wait_for_mouse_move_to | ( | const xdo_t * | xdo, |
int | dest_x, | ||
int | dest_y | ||
) |
Wait for the mouse to move to a location.
This function will block until the condition has been satisfied.
dest_x | the X position you expect the mouse to move to |
dest_y | the Y position you expect the mouse to move to |
int xdo_wait_for_window_active | ( | const xdo_t * | xdo, |
Window | window, | ||
int | active | ||
) |
Wait for a window to be active or not active.
Requires your window manager to support this. Uses _NET_ACTIVE_WINDOW from the EWMH spec.
window | the window to wait on |
active | If 1, wait for active. If 0, wait for inactive. |
int xdo_wait_for_window_focus | ( | const xdo_t * | xdo, |
Window | window, | ||
int | want_focus | ||
) |
Wait for a window to have or lose focus.
window | The window to wait on |
want_focus | If 1, wait for focus. If 0, wait for loss of focus. |
int xdo_wait_for_window_map_state | ( | const xdo_t * | xdo, |
Window | wid, | ||
int | map_state | ||
) |
Wait for a window to have a specific map state.
State possibilities: IsUnmapped - window is not displayed. IsViewable - window is mapped and shown (though may be clipped by windows on top of it) IsUnviewable - window is mapped but a parent window is unmapped.
wid | the window you want to wait for. |
map_state | the state to wait for. |