コード例 #1
0
	def _mouseButton(self, widget, event):
		es = event.state
		lsState = (
			(gdk.CONTROL_MASK, 'Ctrl'),
			(gdk.MOD1_MASK, 'Alt'),
			(gdk.MOD2_MASK, 'Num'),
			(gdk.MOD3_MASK, 'Mod3'),
			(gdk.MOD4_MASK, 'Mod4'),
			(gdk.MOD5_MASK, 'AltGr'),
			(gdk.LOCK_MASK, 'Lock'),
			(gdk.META_MASK, 'Meta'),
			(gdk.SHIFT_MASK, 'Shift'),
			(gdk.SUPER_MASK, 'Super'),
			(gdk.SCROLL_MASK, 'Scroll'),
			(gdk.BUTTON1_MASK, 'MB1'),
			(gdk.BUTTON2_MASK, 'MB2'),
			(gdk.BUTTON3_MASK, 'MB3'),
			(gdk.BUTTON4_MASK, 'MB4'),
			(gdk.BUTTON5_MASK, 'MB5'),
			#look into ~/Devel/Python/TextViewEdit/keyPressLog
			)
		state = [nmModifier for Modifier, nmModifier in lsState if(Modifier&es)]
		if event.type == gdk.BUTTON_PRESS:
			if not self.drag_click and(event.button in (MB_Left, MB_Midlle)):
				self.drag_click = event.x, event.y, event.button
				self.tickID = addTick(100, self._Drag)
			if event.button == MB_Left:
				self.findClickSelection((event.x, event.y), state)
		elif event.type == gdk.BUTTON_RELEASE:
			if self.drag_click and(event.button == self.drag_click[2]):
				unWatch(self.tickID)
				self.drag_click = None
		elif event.type == gdk._2BUTTON_PRESS:
			print("Duo-Click")
コード例 #2
0
ファイル: TextViewVT.py プロジェクト: LordBlick/videoBasket
	def ptyDisconnect(it):
		#it.run = False
		it.kill()
		from gobject import source_remove as unWatch
		unWatch(it.watchID)
		it.fd.close()
		from os import remove as rm