summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorVladimir Gorbunov2020-06-28 21:59:34 +0300
committerVladimir Gorbunov2020-06-28 21:59:34 +0300
commit633c0eae567ac7959d7135733b5139f2c5eba790 (patch)
treeb4baad7ab0eef0db894b16039a4c78b03c16ae1c
parent8e6db88ba47004416f3704a73dbc6c3fa9c16ea2 (diff)
downloadaur-633c0eae567ac7959d7135733b5139f2c5eba790.tar.gz
Applied pull/87
-rw-r--r--.SRCINFO6
-rw-r--r--PKGBUILD6
-rw-r--r--modifiers.patch89
-rw-r--r--revert.patch114
4 files changed, 120 insertions, 95 deletions
diff --git a/.SRCINFO b/.SRCINFO
index d9689d1a9910..d52d9fffe639 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = xkeysnail
pkgdesc = Yet another keyboard remapping tool for X environment.
pkgver = 0.3.0
- pkgrel = 3
+ pkgrel = 4
url = https://github.com/mooz/xkeysnail
arch = any
license = GPL
@@ -12,9 +12,9 @@ pkgbase = xkeysnail
depends = python-inotify-simple
options = !emptydirs
source = https://files.pythonhosted.org/packages/source/x/xkeysnail/xkeysnail-0.3.0.tar.gz
- source = modifiers.patch
+ source = revert.patch
sha256sums = 0eaff456508b06a1daad6408e2fe91828af988d591a165e6d863ef116bc60a3e
- sha256sums = d96773483c139de2d81cb07fd1706a4f2a5ca54f7fa7e008e84a8e6c14555fd3
+ sha256sums = 67fe4f70ffbb229dd1cf9db3f4040220760e0d7cabefde37da4466779069631c
pkgname = xkeysnail
diff --git a/PKGBUILD b/PKGBUILD
index 6165fbd1d693..2b0f21a5eec7 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,7 +1,7 @@
# Maintainer: Vladimir Gorbunov <truedaemon@gmail.com>
pkgname=xkeysnail
pkgver=0.3.0
-pkgrel=3
+pkgrel=4
pkgdesc="Yet another keyboard remapping tool for X environment."
arch=('any')
url="https://github.com/mooz/xkeysnail"
@@ -13,9 +13,9 @@ depends=('python'
makedepends=('python-setuptools')
options=(!emptydirs)
source=("https://files.pythonhosted.org/packages/source/x/${pkgname}/${pkgname}-${pkgver}.tar.gz"
- "modifiers.patch")
+ "revert.patch")
sha256sums=('0eaff456508b06a1daad6408e2fe91828af988d591a165e6d863ef116bc60a3e'
- 'd96773483c139de2d81cb07fd1706a4f2a5ca54f7fa7e008e84a8e6c14555fd3')
+ '67fe4f70ffbb229dd1cf9db3f4040220760e0d7cabefde37da4466779069631c')
prepare() {
cd "$srcdir/$pkgname-$pkgver"
diff --git a/modifiers.patch b/modifiers.patch
deleted file mode 100644
index 4d845b024bf4..000000000000
--- a/modifiers.patch
+++ /dev/null
@@ -1,89 +0,0 @@
-From bc580120f9e8e8cfea0b68d9a3cf2af670a7f2f2 Mon Sep 17 00:00:00 2001
-From: Ben Reaves <rbreaves@gmail.com>
-Date: Fri, 1 May 2020 16:33:53 -0500
-Subject: [PATCH 1/2] - Persistent modifiers on partial release of modifier
- combo. Fixes #74
-
----
- xkeysnail/output.py | 6 +++++-
- xkeysnail/transform.py | 6 ++++--
- 2 files changed, 9 insertions(+), 3 deletions(-)
-
-diff --git a/xkeysnail/output.py b/xkeysnail/output.py
-index 4605ab3..a7f2a95 100644
---- a/xkeysnail/output.py
-+++ b/xkeysnail/output.py
-@@ -76,12 +76,16 @@ def send_combo(combo):
- for modifier in missing_modifiers:
- modifier_key = modifier.get_key()
- send_key_action(modifier_key, Action.PRESS)
-- pressed_modifier_keys.append(modifier_key)
-
- send_key_action(combo.key, Action.PRESS)
-
- send_key_action(combo.key, Action.RELEASE)
-
-+ # Release modifiers that are not physically held - ONLY
-+ for modifier in missing_modifiers:
-+ modifier_key = modifier.get_key()
-+ send_key_action(modifier_key, Action.RELEASE)
-+
- for modifier in reversed(released_modifiers_keys):
- send_key_action(modifier, Action.PRESS)
-
-diff --git a/xkeysnail/transform.py b/xkeysnail/transform.py
-index 76ca6f2..e3ad6fd 100644
---- a/xkeysnail/transform.py
-+++ b/xkeysnail/transform.py
-@@ -427,8 +427,10 @@ def on_key(key, action, wm_class=None, quiet=False):
- # is released
- if str(key) != "Key.LEFT_SHIFT" and str(key) != "Key.RIGHT_SHIFT":
- for output_key in output_mods:
-- update_pressed_modifier_keys(output_key, action)
-- send_key_action(output_key, action)
-+ # Release modifiers that are not physically held - ONLY
-+ if not is_pressed(output_key):
-+ update_pressed_modifier_keys(output_key, action)
-+ send_key_action(output_key, action)
- elif not action.is_pressed():
- if is_pressed(key):
- send_key_action(key, action)
---
-2.26.2
-
-
-From 113cc1a55f1c890aa4c711111b33d855e93034fd Mon Sep 17 00:00:00 2001
-From: Ben Reaves <rbreaves@gmail.com>
-Date: Thu, 7 May 2020 14:04:57 -0500
-Subject: [PATCH 2/2] Updated release modifier fix, earlier version needed to
- ignore shift in some circumstances
-
----
- xkeysnail/transform.py | 11 +++++------
- 1 file changed, 5 insertions(+), 6 deletions(-)
-
-diff --git a/xkeysnail/transform.py b/xkeysnail/transform.py
-index e3ad6fd..e30774a 100644
---- a/xkeysnail/transform.py
-+++ b/xkeysnail/transform.py
-@@ -425,12 +425,11 @@ def on_key(key, action, wm_class=None, quiet=False):
- send_key_action(key, action)
- # Release mapped modifier only when physical mod
- # is released
-- if str(key) != "Key.LEFT_SHIFT" and str(key) != "Key.RIGHT_SHIFT":
-- for output_key in output_mods:
-- # Release modifiers that are not physically held - ONLY
-- if not is_pressed(output_key):
-- update_pressed_modifier_keys(output_key, action)
-- send_key_action(output_key, action)
-+ for output_key in output_mods:
-+ # Release modifiers that are not physically held - ONLY
-+ if not is_pressed(output_key):
-+ update_pressed_modifier_keys(output_key, action)
-+ send_key_action(output_key, action)
- elif not action.is_pressed():
- if is_pressed(key):
- send_key_action(key, action)
---
-2.26.2
-
diff --git a/revert.patch b/revert.patch
new file mode 100644
index 000000000000..0cd8bfbe87ee
--- /dev/null
+++ b/revert.patch
@@ -0,0 +1,114 @@
+From 66ab9e6505df39783fe95142097a8516ed14c2cf Mon Sep 17 00:00:00 2001
+From: Len Trigg <lenbok@gmail.com>
+Date: Fri, 22 May 2020 10:36:33 +1200
+Subject: [PATCH] Revert "Merge pull request #71 from rbreaves/master"
+
+Fixes #74, #80, #81
+
+This reverts commit e3dceddf045a1bb98b8e4016e4fa7b001f14736f, reversing
+changes made to 123432bb038f35a8a26a6967fbf5c559edd48708.
+---
+ xkeysnail/output.py | 19 +++++--------------
+ xkeysnail/transform.py | 20 +-------------------
+ 2 files changed, 6 insertions(+), 33 deletions(-)
+
+diff --git a/xkeysnail/output.py b/xkeysnail/output.py
+index 4605ab3..d8f01f9 100644
+--- a/xkeysnail/output.py
++++ b/xkeysnail/output.py
+@@ -12,9 +12,6 @@ _uinput = UInput()
+ _pressed_modifier_keys = set()
+ _pressed_keys = set()
+
+-def output_modifier_key():
+- return _pressed_modifier_keys
+-
+ def update_modifier_key_pressed(key, action):
+ if key in Modifier.get_all_keys():
+ if action.is_pressed():
+@@ -60,17 +57,8 @@ def send_combo(combo):
+ missing_modifiers.remove(modifier)
+
+ for modifier_key in extra_modifier_keys:
+- # Do not release new modifier
+- # until original modifier is released
+- # unless no modifier is the new mapping
+- if len(combo.modifiers) > 0:
+- for modifier in combo.modifiers:
+- if modifier_key != str(modifier.get_key()):
+- send_key_action(modifier_key, Action.RELEASE)
+- released_modifiers_keys.append(modifier_key)
+- else:
+- send_key_action(modifier_key, Action.RELEASE)
+- released_modifiers_keys.append(modifier_key)
++ send_key_action(modifier_key, Action.RELEASE)
++ released_modifiers_keys.append(modifier_key)
+
+ pressed_modifier_keys = []
+ for modifier in missing_modifiers:
+@@ -82,6 +70,9 @@ def send_combo(combo):
+
+ send_key_action(combo.key, Action.RELEASE)
+
++ for modifier in reversed(pressed_modifier_keys):
++ send_key_action(modifier, Action.RELEASE)
++
+ for modifier in reversed(released_modifiers_keys):
+ send_key_action(modifier, Action.PRESS)
+
+diff --git a/xkeysnail/transform.py b/xkeysnail/transform.py
+index 76ca6f2..e1dfea2 100644
+--- a/xkeysnail/transform.py
++++ b/xkeysnail/transform.py
+@@ -4,7 +4,7 @@ import itertools
+ from time import time
+ from inspect import signature
+ from .key import Action, Combo, Key, Modifier
+-from .output import send_combo, send_key_action, send_key, is_pressed, output_modifier_key
++from .output import send_combo, send_key_action, send_key, is_pressed
+
+ __author__ = 'zh'
+
+@@ -12,7 +12,6 @@ __author__ = 'zh'
+
+ import Xlib.display
+
+-_release_combo = False
+
+ def get_active_window_wm_class(display=Xlib.display.Display()):
+ """Get active window's WM_CLASS"""
+@@ -418,31 +417,14 @@ def on_event(event, device_name, quiet):
+
+
+ def on_key(key, action, wm_class=None, quiet=False):
+- global _release_combo
+- output_mods = output_modifier_key().copy()
+ if key in Modifier.get_all_keys():
+ update_pressed_modifier_keys(key, action)
+ send_key_action(key, action)
+- # Release mapped modifier only when physical mod
+- # is released
+- if str(key) != "Key.LEFT_SHIFT" and str(key) != "Key.RIGHT_SHIFT":
+- for output_key in output_mods:
+- update_pressed_modifier_keys(output_key, action)
+- send_key_action(output_key, action)
+ elif not action.is_pressed():
+ if is_pressed(key):
+ send_key_action(key, action)
+- # Unset modifiers used in nested mode_maps
+- elif _release_combo and len(output_mods) > 0:
+- _release_combo = False
+- for output_key in output_mods:
+- update_pressed_modifier_keys(output_key, action)
+- send_key_action(output_key, action)
+ else:
+ transform_key(key, action, wm_class=wm_class, quiet=quiet)
+- # Will unset mode maps modifiers on next combo
+- if _mode_maps != None:
+- _release_combo = True
+
+
+ def transform_key(key, action, wm_class=None, quiet=False):
+--
+2.27.0
+