Proof of concept xdo FFI

This commit is contained in:
Eric Jiang 2020-10-29 14:17:21 -07:00
parent 2a47f41901
commit 50a792d04c
3 changed files with 5440 additions and 2 deletions

5425
_xdo_cffi.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -427,8 +427,11 @@ int xdo_send_keysequence_window_list_do(const xdo_t *xdo, Window window,
* by this function.
* @param nkeys Pointer to integer where the number of keys will be stored.
*/
int xdo_get_active_keys_to_keycode_list(const xdo_t *xdo, charcodemap_t **keys,
int *nkeys);
// commenting out because for some reason this prevents the python module from being loaded successfully:
// ImportError: /home/user/foo/_xdo_cffi.cpython-38-x86_64-linux-gnu.so: undefined symbol: xdo_get_active_keys_to_keycode_list
//int xdo_get_active_keys_to_keycode_list(const xdo_t *xdo, charcodemap_t **keys,
// int *nkeys);
/**
* Wait for a window to have a specific map state.

10
xdo_test.py Normal file
View File

@ -0,0 +1,10 @@
import time
from _xdo_cffi import ffi, lib
X = 200
xdo = lib.xdo_new(ffi.NULL)
for i in range(20):
lib.xdo_move_mouse(xdo, X * i, 500, 0)
time.sleep(0.1)