← Back to team overview

openshot.code team mailing list archive

[Branch ~openshot.code/openshot/main] Rev 700: Applied patch from Patrick Boivin to fix the button release on CTRL, SHIFT, and ALT keys.

 

------------------------------------------------------------
revno: 700
fixes bug: https://launchpad.net/bugs/1047900
committer: Jonathan Thomas <Jonathan.Oomph@xxxxxxxxx>
branch nick: openshot
timestamp: Sun 2012-09-09 19:07:13 -0500
message:
  Applied patch from Patrick Boivin to fix the button release on CTRL, SHIFT, and ALT keys.
modified:
  openshot/windows/MainGTK.py


--
lp:openshot
https://code.launchpad.net/~openshot.code/openshot/main

Your team OpenShot Code is subscribed to branch lp:openshot.
To unsubscribe from this branch go to https://code.launchpad.net/~openshot.code/openshot/main/+edit-subscription
=== modified file 'openshot/windows/MainGTK.py'
--- openshot/windows/MainGTK.py	2012-09-09 20:23:59 +0000
+++ openshot/windows/MainGTK.py	2012-09-10 00:07:13 +0000
@@ -2239,10 +2239,17 @@
 	def on_frmMain_key_release_event(self, widget, event):
 		keyname = str.lower(gtk.gdk.keyval_name(event.keyval))
 
-		# Toggle special keys
-		self._SHIFT = False
-		self._ALT = False
-		self._CTRL = False
+		if event.keyval == gtk.keysyms.Shift_L or event.keyval == gtk.keysyms.Shift_R:
+			# Toggle SHIFT mode
+			self._SHIFT = False
+
+		elif keyname == 'alt_l' or keyname == 'alt_r' or keyname == 'iso_level3_shift':
+			# Toggle ALT mode
+			self._ALT = False
+
+		elif (keyname == 'control_l' or keyname == 'control_r') or (event.state == gtk.gdk.CONTROL_MASK) or (event.state == gtk.gdk.CONTROL_MASK | gtk.gdk.MOD2_MASK):
+			# Toggle CTRL mode
+			self._CTRL = False
 		
 					
 	def toggle_mode(self):