Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrendon Murphy <meta.androcto1@gmail.com>2011-09-07 16:12:49 +0400
committerBrendon Murphy <meta.androcto1@gmail.com>2011-09-07 16:12:49 +0400
commitc18f9bec0bb97dafadbdf169b7230e971017562a (patch)
tree771e0fdd389fd280b729a5d62309f038184a59c5
parentecca247d064cfb5cfda7374ce687d64184211755 (diff)
missing mouse "release" clicks added
* fix for grab, click error thanks to Gaia Clary for his hard work on this script.
-rw-r--r--space_view3d_screencast_keys.py35
1 files changed, 32 insertions, 3 deletions
diff --git a/space_view3d_screencast_keys.py b/space_view3d_screencast_keys.py
index 839dbd01..489b6f53 100644
--- a/space_view3d_screencast_keys.py
+++ b/space_view3d_screencast_keys.py
@@ -16,13 +16,26 @@
#
# ##### END GPL LICENSE BLOCK #####
+# #####
+#
+# Modification history:
+# - Version 1,4
+# - 07-sep-2011 (Gaia Clary):
+# - settings now stored in blend file
+# - grouping mouse&text
+# - mouse_size and font_size separated
+# - boundingBox for improved readability.
+# - missing mouse "release" clicks added
+#
+# ####
+
# <pep8 compliant>
bl_info = {
'name': 'Screencast Keys',
'author': 'Paulo Gomes, Bart Crouch, John E. Herrenyo',
- 'version': (1, 3),
+ 'version': (1, 4),
'blender': (2, 5, 9),
'api': 39933,
'location': 'View3D > Properties panel > Screencast Keys',
@@ -374,7 +387,8 @@ class ScreencastKeysStatus(bpy.types.Operator):
bl_idname = "view3d.screencast_keys"
bl_label = "Screencast Key Status Tool"
bl_description = "Display keys pressed in the 3D-view"
-
+ last_activity = 'NONE'
+
def modal(self, context, event):
if context.area:
context.area.tag_redraw()
@@ -388,9 +402,14 @@ class ScreencastKeysStatus(bpy.types.Operator):
if sc.screencast_keys_mouse != 'text':
ignore_keys.extend(mouse_keys)
- if event.value == 'PRESS':
+
+ #if (event.value != "NOTHING" and event.value != "PRESS"):
+ # print (event.value, event.type, "Previous activity was: ", self.last_activity)
+
+ if event.value == 'PRESS' or (event.value == 'RELEASE' and self.last_activity == 'KEYBOARD' and event.type in mouse_keys ) :
# add key-press to display-list
sc_keys = []
+
if event.ctrl:
sc_keys.append("Ctrl ")
@@ -400,7 +419,9 @@ class ScreencastKeysStatus(bpy.types.Operator):
sc_keys.append("Shift ")
sc_amount = ""
+
if self.key:
+ #print("Is a key")
if event.type not in ignore_keys and event.type in self.key[0]:
mods = "+ ".join(sc_keys)
old_mods = "+ ".join(self.key[0].split("+ ")[:-1])
@@ -414,14 +435,22 @@ class ScreencastKeysStatus(bpy.types.Operator):
del self.time[0]
if event.type not in ignore_keys:
+ #print("Recorded as key")
sc_keys.append(event.type)
self.key.insert(0, "+ ".join(sc_keys) + sc_amount)
self.time.insert(0, time.time())
elif event.type in mouse_keys and sc.screencast_keys_mouse == 'icon':
+ #print("Recorded as mouse press")
self.mouse.insert(0, event.type)
self.mouse_time.insert(0, time.time())
+ if event.type in mouse_keys:
+ self.last_activity = 'MOUSE'
+ else:
+ self.last_activity = 'KEYBOARD'
+ #print("Last activity set to:", self.last_activity)
+
if not context.window_manager.screencast_keys_keys:
# stop script
context.region.callback_remove(self._handle)