[kupfer] triggers: Use a defined range for targets
- From: Ulrik Sverdrup <usverdrup src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [kupfer] triggers: Use a defined range for targets
- Date: Mon, 4 Jan 2010 18:34:26 +0000 (UTC)
commit 0e3755b03360606d28fb06c12a93c9d158397fe2
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date: Sun Jan 3 20:42:54 2010 +0100
triggers: Use a defined range for targets
kupfer/keybindings.py | 3 +++
kupfer/plugin/triggers.py | 5 +----
2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/kupfer/keybindings.py b/kupfer/keybindings.py
index 0b3f914..c96b549 100644
--- a/kupfer/keybindings.py
+++ b/kupfer/keybindings.py
@@ -5,6 +5,9 @@ from kupfer import pretty
KEYBINDING_DEFAULT = 1
KEYBINDING_MAGIC = 2
+KEYRANGE_RESERVED = (3, 0x1000)
+KEYRANGE_TRIGGERS = (0x1000, 0x2000)
+
_keybound_object = None
def GetKeyboundObject():
"""Get the shared instance"""
diff --git a/kupfer/plugin/triggers.py b/kupfer/plugin/triggers.py
index b944a6a..e3bd5a3 100644
--- a/kupfer/plugin/triggers.py
+++ b/kupfer/plugin/triggers.py
@@ -21,8 +21,6 @@ __author__ = "Ulrik Sverdrup <ulrik sverdrup gmail com>"
# this plugin needs this module, lest it shall not function.
import keybinder
-_PRIVATE_KEYBINDING_MASK = 0xFF00
-
class Trigger (RunnableLeaf):
def get_actions(self):
for act in RunnableLeaf.get_actions(self):
@@ -76,8 +74,7 @@ class Triggers (Source):
Triggers.instance._remove_trigger(target)
def _add_trigger(self, leaf, keystr):
- X = _PRIVATE_KEYBINDING_MASK
- for target in xrange(X, X + 1000):
+ for target in xrange(*keybindings.KEYRANGE_TRIGGERS):
if target not in self.trigger_table:
break
keybindings.bind_key(keystr, target)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]