Your message dated Tue, 14 Feb 2017 01:49:34 +0000
with message-id <[email protected]>
and subject line Bug#854994: fixed in python-xdo 0.4-1
has caused the Debian Bug report #854994,
regarding python-xdo: Please add support for send_keysequence_window()
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
854994: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=854994
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: python-xdo
Version: 0.3-2
Severity: wishlist
Tags: patch

Hi,

Please find attached patches adding support for the send_keysequence_window()
function, which lets me drive a fully automated Debian Installation within
kvm/qemu for regression testing purposes.

I haven't really checked the clearmodifiers part (which I've borrowed from
enter_text_window()) since I'm mostly sending simple keystrokes: typing
hostnames, passwords, login name, etc. means I'm sending basically:
 - letters,
 - shift+letters,
 - space,
 - Tab,
 - Return,
 - Up,
 - Down.

Tested on a jessie system (libxdo3:amd64 = 1:3.20140805.1-2).

Thanks for considering.

Cheers,
-- 
Cyril Brulebois -- Debian Consultant @ DEBAMAX -- https://debamax.com/
>From 4c0d78cc2f7f0c5e33ed9373025a6c3007299eae Mon Sep 17 00:00:00 2001
From: Cyril Brulebois <[email protected]>
Date: Mon, 13 Feb 2017 01:12:54 +0100
Subject: [PATCH 3/4] Add support for send_keysequence_window().

Mimick the enter_text_window() behaviour, including the clearmodifiers
part but excluding the encoding part.

This was tested successfully by driving a full Debian installation
using Debian Installer within kvm/qemu.

Signed-off-by: Cyril Brulebois <[email protected]>
---
 xdo/__init__.py | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 xdo/_xdo.py     | 28 ++++++++++++++++++++++++++++
 2 files changed, 80 insertions(+)

diff --git a/xdo/__init__.py b/xdo/__init__.py
index d3c99c3..751cd9e 100644
--- a/xdo/__init__.py
+++ b/xdo/__init__.py
@@ -91,6 +91,58 @@ class xdo(object):
             
         return ret
 
+    def send_keysequence_window(self, keysequence, clearmodifiers=True,
+                                delay=timedelta(microseconds=12000),
+                                window=CURRENTWINDOW):
+        """
+        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.
+
+        :param window:
+            The window you want to send the keysequence to or CURRENTWINDOW
+        :param keysequence:
+            The string keysequence to send.
+        :param delay:
+            The delay between keystrokes in microseconds.
+        :param clearmodifiers:
+            Whether to clear any current modifier keys before sending
+            the keysequence (defaults to True).
+        """
+        if type(delay) == timedelta:
+            delay_int = int(delay.total_seconds() * 1000000)
+        elif type(delay) == int:
+            delay_int = delay
+        else:
+            raise TypeError("delay parameter should be either a timedelta or an int")
+
+        if clearmodifiers:
+            active_mods_n = ctypes.c_int(0)
+            active_mods = _charcodemap_ptr()
+            _libxdo.xdo_get_active_modifiers(self._xdo, ctypes.byref(active_mods),
+                                             ctypes.byref(active_mods_n))
+            _libxdo.xdo_clear_active_modifiers(self._xdo, window, active_mods,
+                                               active_mods_n)
+        ret = _libxdo.xdo_send_keysequence_window(self._xdo, window, keysequence,
+                                                  delay_int)
+        if clearmodifiers:
+            _libxdo.xdo_set_active_modifiers(self._xdo, window, active_mods,
+                                             active_mods_n)
+            _libc.free(active_mods)
+
+        return ret
+
     @deprecated
     def type(self, string, clearmodifiers=True, delay=12000, window=CURRENTWINDOW):
         """
diff --git a/xdo/_xdo.py b/xdo/_xdo.py
index ef4fd74..eaa9c72 100644
--- a/xdo/_xdo.py
+++ b/xdo/_xdo.py
@@ -110,6 +110,34 @@ want instead xdo_send_keysequence_window(...).
 """
 
 # ============================================================================
+# int xdo_send_keysequence_window(const xdo_t *xdo, Window window,
+#     const char *keysequence, useconds_t delay);
+libxdo.xdo_send_keysequence_window.argtypes = (
+    xdo_ptr, window_t, c_char_p, useconds_t)
+libxdo.xdo_send_keysequence_window.restype = c_int
+libxdo.xdo_send_keysequence_window.errcheck = _errcheck
+libxdo.xdo_send_keysequence_window.__doc__ = """
+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.
+
+:param window: The window you want to send the keysequence to or CURRENTWINDOW
+:param keysequence: The string keysequence to send.
+:param delay: The delay between keystrokes in microseconds.
+"""
+
+# ============================================================================
 # int xdo_focus_window(const xdo_t *xdo, Window wid);
 libxdo.xdo_focus_window.argtypes = (xdo_ptr, window_t)
 libxdo.xdo_focus_window.restype = c_int
-- 
2.1.4

>From a94bcbf1a3950dc149f44f5b7628942089805529 Mon Sep 17 00:00:00 2001
From: Cyril Brulebois <[email protected]>
Date: Mon, 13 Feb 2017 00:50:19 +0100
Subject: [PATCH 4/4] Unmark send_keysequence_window() as unimplemented.

Signed-off-by: Cyril Brulebois <[email protected]>
---
 xdo/__init__.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xdo/__init__.py b/xdo/__init__.py
index 751cd9e..4edef5a 100644
--- a/xdo/__init__.py
+++ b/xdo/__init__.py
@@ -47,8 +47,8 @@ class xdo(object):
         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 the (currently unimplemented)
-        function ``send_keysequence_window(...)``.
+        "alt+l", you want instead the ``send_keysequence_window(...)``
+        function.
 
         :param string:
             The string to type, like "Hello world!"
-- 
2.1.4


--- End Message ---
--- Begin Message ---
Source: python-xdo
Source-Version: 0.4-1

We believe that the bug you reported is fixed in the latest version of
python-xdo, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Daniel Kahn Gillmor <[email protected]> (supplier of updated python-xdo 
package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Mon, 13 Feb 2017 19:54:34 -0500
Source: python-xdo
Binary: python-xdo python3-xdo
Architecture: source
Version: 0.4-1
Distribution: unstable
Urgency: medium
Maintainer: Debian Python Modules Team 
<[email protected]>
Changed-By: Daniel Kahn Gillmor <[email protected]>
Description:
 python-xdo - Python 2 library for simulating X11 keyboard/mouse input (libxdo
 python3-xdo - Python 3 library for simulating X11 keyboard/mouse input (libxdo
Closes: 854992 854994
Changes:
 python-xdo (0.4-1) unstable; urgency=medium
 .
   * New upstream release (Closes: #854992, #854994)
Checksums-Sha1:
 fcc7e06ea39a12ccbf4817dd049f00ec1c0a7e63 2122 python-xdo_0.4-1.dsc
 e3c5354295b894b9bfe45b36df8600945f8be1fb 5593 python-xdo_0.4.orig.tar.gz
 a42e6b2edbee22ef4cc56abd5cb05b75c171756a 2264 python-xdo_0.4-1.debian.tar.xz
 b2b9cc6fee1c37c51769891a537b3822f2e4514b 5986 python-xdo_0.4-1_source.buildinfo
Checksums-Sha256:
 3393d4bde88540323554bd44f693cf0806a5594bb4707ecc65c2f42619e59245 2122 
python-xdo_0.4-1.dsc
 cb6ed9ca64a494f0b37393bbab2d4062d37df9aa2bf8c973a5cb60d9f08a2a67 5593 
python-xdo_0.4.orig.tar.gz
 de7d3fdd483830f8ffc2eff28b1d71b6abc6a64e350a86fafc0dbbf9dc305683 2264 
python-xdo_0.4-1.debian.tar.xz
 1a1dc460d1f64b7c04ed962fba46c83f5cea18b4a46468367d3d7b86f6e6e943 5986 
python-xdo_0.4-1_source.buildinfo
Files:
 320875af292f532e715ea7a8793b6bde 2122 python extra python-xdo_0.4-1.dsc
 74c3ccd5c6848769ecd1aa15df47a52f 5593 python extra python-xdo_0.4.orig.tar.gz
 0977b8607984c49e1618e60caafbfea0 2264 python extra 
python-xdo_0.4-1.debian.tar.xz
 1620e18c7fe8ebd55756c36cd1a8ae65 5986 python extra 
python-xdo_0.4-1_source.buildinfo

-----BEGIN PGP SIGNATURE-----

iQJKBAEBCgA0FiEEOCdgUepHf6PklTkyFJitxsGSMjcFAliiXbcWHGRrZ0BmaWZ0
aGhvcnNlbWFuLm5ldAAKCRAUmK3GwZIyN6m7D/9m06ulVNOy3NaDrQ0b8e6bPT4L
n6q5sjFDrPh7PTf1eYLdyLcWzDFvG6QfN9MosK93aUUKKhUmDvKAPj8RQQ53a5wi
C7rbjEb2DFXG/Ls49uYEWNnOqGTcY3HESumkaF42nV2YqX1S3Df9KrqTDhpEH9oS
TKnGUIMSehupSUdbjwT+UthuM7uWBDndLeHPW1tISo+MbdcmaiJ5aQWgYJTlwaOM
mDXiF6Kzof+rStiqIceNYDi+XY86LzlzQgpmZBK3wPcX3e9a8eDRcgpjHplYsu8G
9Pt/4bc4CvJNZ2gOIuLqFBpFegU+x1BbjpiuQ3e87f5Nux/VxI4wB81X5Od0RDaz
iyrf7mwyOvjpvaP216QURCYLF1p0CZ7ztsRQqPo0tCwUsHM9Vi95hF0lEwrlXlLo
ihf/A8DT01sv0ZsE5KJOtLOaNns+GCzeHaGLBX0jr9wq2ctJMJuUVR3KLXT6VF5U
0WksjU4bBKK7wuMZGNponizoxoCg2MR482xEp7H1MT3DBjRtDEMBT0XhOSM5f/5q
xQI3LN/4aGndLptDmCjCqzvGHE5E6aMS1ZcIclNU88Aohz2L2yBsc9X82rk9sVD7
dLhZxJpslTT0uFDGoRKs8Z8Lgk4T4P/JwwRw+L+EJJ8c+NwPXN6YpOCymMICn2oz
hc3zQw5bsbbU3svRcA==
=dJb7
-----END PGP SIGNATURE-----

--- End Message ---
_______________________________________________
Python-modules-team mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/python-modules-team

Reply via email to