示例#1
0
文件: weekCal.py 项目: ilius/starcal
	def keyPress(self, arg, gevent):
		if CalBase.keyPress(self, arg, gevent):
			return True
		kname = gdk.keyval_name(gevent.keyval).lower()
		if kname == "up":
			self.jdPlus(-1)
		elif kname == "down":
			self.jdPlus(1)
		elif kname == "left":
			self.jdPlus(rtlSgn() * 7)
		elif kname == "right":
			self.jdPlus(rtlSgn() * -7)
		elif kname == "end":
			self.gotoJd(self.status[-1].jd)
		elif kname in ("page_up", "k", "p"):
			self.jdPlus(-7)
		elif kname in ("page_down", "j", "n"):
			self.jdPlus(7)
		elif kname in ("f10", "m"):
			if gevent.state & gdk.ModifierType.SHIFT_MASK:
				# Simulate right click (key beside Right-Ctrl)
				self.emit("popup-cell-menu", gevent.time, *self.getCellPos())
			else:
				self.emit("popup-main-menu", gevent.time, *self.getMainMenuPos())
		else:
			return False
		return True
示例#2
0
文件: dayCal.py 项目: ilius/starcal
 def keyPress(self, arg, gevent):
     if CalBase.keyPress(self, arg, gevent):
         return True
     kname = gdk.keyval_name(gevent.keyval).lower()
     #if kname.startswith("alt"):
     #	return True
     ## How to disable Alt+Space of metacity ?????????????????????
     if kname == "up":
         self.jdPlus(-1)
     elif kname == "down":
         self.jdPlus(1)
     elif kname == "right":
         if rtl:
             self.jdPlus(-1)
         else:
             self.jdPlus(1)
     elif kname == "left":
         if rtl:
             self.jdPlus(1)
         else:
             self.jdPlus(-1)
     elif kname in ("page_up", "k", "p"):
         self.jdPlus(-1)  # FIXME
     elif kname in ("page_down", "j", "n"):
         self.jdPlus(1)  # FIXME
     #elif kname in ("f10", "m"):  # FIXME
     #	if gevent.get_state() & gdk.ModifierType.SHIFT_MASK:
     #		# Simulate right click (key beside Right-Ctrl)
     #		self.emit("popup-cell-menu", gevent.time, *self.getCellPos())
     #	else:
     #		self.emit("popup-main-menu", gevent.time, *self.getMainMenuPos())
     else:
         return False
     return True
示例#3
0
文件: dayCal.py 项目: ilius/starcal
	def keyPress(self, arg, gevent):
		if CalBase.keyPress(self, arg, gevent):
			return True
		kname = gdk.keyval_name(gevent.keyval).lower()
		#if kname.startswith("alt"):
		#	return True
		## How to disable Alt+Space of metacity ?????????????????????
		if kname == "up":
			self.jdPlus(-1)
		elif kname == "down":
			self.jdPlus(1)
		elif kname == "right":
			if rtl:
				self.jdPlus(-1)
			else:
				self.jdPlus(1)
		elif kname == "left":
			if rtl:
				self.jdPlus(1)
			else:
				self.jdPlus(-1)
		elif kname in ("page_up", "k", "p"):
			self.jdPlus(-1)  # FIXME
		elif kname in ("page_down", "j", "n"):
			self.jdPlus(1)  # FIXME
		#elif kname in ("f10", "m"):  # FIXME
		#	if gevent.get_state() & gdk.ModifierType.SHIFT_MASK:
		#		# Simulate right click (key beside Right-Ctrl)
		#		self.emit("popup-cell-menu", gevent.time, *self.getCellPos())
		#	else:
		#		self.emit("popup-main-menu", gevent.time, *self.getMainMenuPos())
		else:
			return False
		return True
示例#4
0
 def keyPress(self, arg, gevent):
     if CalBase.keyPress(self, arg, gevent):
         return True
     kname = gdk.keyval_name(gevent.keyval).lower()
     #if kname.startswith('alt'):
     #	return True
     ## How to disable Alt+Space of metacity ?????????????????????
     if kname == 'up':
         self.jdPlus(-1)
     elif kname == 'down':
         self.jdPlus(1)
     elif kname == 'right':
         if rtl:
             self.jdPlus(-1)
         else:
             self.jdPlus(1)
     elif kname == 'left':
         if rtl:
             self.jdPlus(1)
         else:
             self.jdPlus(-1)
     elif kname in ('page_up', 'k', 'p'):
         self.jdPlus(-1)  ## FIXME
     elif kname in ('page_down', 'j', 'n'):
         self.jdPlus(1)  ## FIXME
     #elif kname in ('f10', 'm'):## FIXME
     #	if gevent.get_state() & gdk.ModifierType.SHIFT_MASK:
     #		# Simulate right click (key beside Right-Ctrl)
     #		self.emit('popup-cell-menu', gevent.time, *self.getCellPos())
     #	else:
     #		self.emit('popup-main-menu', gevent.time, *self.getMainMenuPos())
     else:
         return False
     return True
示例#5
0
	def keyPress(self, arg, gevent):
		if CalBase.keyPress(self, arg, gevent):
			return True
		kname = gdk.keyval_name(gevent.keyval).lower()
		#if kname.startswith('alt'):
		#	return True
		## How to disable Alt+Space of metacity ?????????????????????
		if kname=='up':
			self.jdPlus(-1)
		elif kname=='down':
			self.jdPlus(1)
		elif kname=='right':
			if rtl:
				self.jdPlus(-1)
			else:
				self.jdPlus(1)
		elif kname=='left':
			if rtl:
				self.jdPlus(1)
			else:
				self.jdPlus(-1)
		elif kname in ('page_up', 'k', 'p'):
			self.jdPlus(-1)## FIXME
		elif kname in ('page_down', 'j', 'n'):
			self.jdPlus(1)## FIXME
		#elif kname in ('f10', 'm'):## FIXME
		#	if gevent.get_state() & gdk.ModifierType.SHIFT_MASK:
		#		# Simulate right click (key beside Right-Ctrl)
		#		self.emit('popup-cell-menu', gevent.time, *self.getCellPos())
		#	else:
		#		self.emit('popup-main-menu', gevent.time, *self.getMainMenuPos())
		else:
			return False
		return True
示例#6
0
 def keyPress(self, arg, gevent):
     print('keyPress')
     if CalBase.keyPress(self, arg, gevent):
         return True
     kname = gdk.keyval_name(gevent.keyval).lower()
     print('keyPress', kname)
     if kname=='up':
         self.jdPlus(-1)
     elif kname=='down':
         self.jdPlus(1)
     elif kname=='end':
         self.gotoJd(self.status[-1].jd)
     elif kname in ('page_up', 'k', 'p'):
         self.jdPlus(-7)
     elif kname in ('page_down', 'j', 'n'):
         self.jdPlus(7)
     elif kname in ('f10', 'm'):
         if gevent.state & gdk.ModifierType.SHIFT_MASK:
             # Simulate right click (key beside Right-Ctrl)
             self.emit('popup-cell-menu', gevent.time, *self.getCellPos())
         else:
             self.emit('popup-main-menu', gevent.time, *self.getMainMenuPos())
     else:
         return False
     return True
示例#7
0
 def keyPress(self, arg, gevent):
     print('keyPress')
     if CalBase.keyPress(self, arg, gevent):
         return True
     kname = gdk.keyval_name(gevent.keyval).lower()
     print('keyPress', kname)
     if kname == 'up':
         self.jdPlus(-1)
     elif kname == 'down':
         self.jdPlus(1)
     elif kname == 'end':
         self.gotoJd(self.status[-1].jd)
     elif kname in ('page_up', 'k', 'p'):
         self.jdPlus(-7)
     elif kname in ('page_down', 'j', 'n'):
         self.jdPlus(7)
     elif kname in ('f10', 'm'):
         if gevent.state & gdk.ModifierType.SHIFT_MASK:
             # Simulate right click (key beside Right-Ctrl)
             self.emit('popup-cell-menu', gevent.time, *self.getCellPos())
         else:
             self.emit('popup-main-menu', gevent.time,
                       *self.getMainMenuPos())
     else:
         return False
     return True
示例#8
0
 def keyPress(self, arg, gevent):
     if CalBase.keyPress(self, arg, gevent):
         return True
     kname = gdk.keyval_name(gevent.keyval).lower()
     if kname == "up":
         self.jdPlus(-1)
     elif kname == "down":
         self.jdPlus(1)
     elif kname == "left":
         self.jdPlus(rtlSgn() * 7)
     elif kname == "right":
         self.jdPlus(rtlSgn() * -7)
     elif kname == "end":
         self.gotoJd(self.status[-1].jd)
     elif kname in ("page_up", "k", "p"):
         self.jdPlus(-7)
     elif kname in ("page_down", "j", "n"):
         self.jdPlus(7)
     elif kname in ("f10", "m"):
         if gevent.state & gdk.ModifierType.SHIFT_MASK:
             # Simulate right click (key beside Right-Ctrl)
             self.emit("popup-cell-menu", gevent.time, *self.getCellPos())
         else:
             self.emit("popup-main-menu", gevent.time,
                       *self.getMainMenuPos())
     else:
         return False
     return True
示例#9
0
 def keyPress(self, arg, gevent):
     print('keyPress')
     if CalBase.keyPress(self, arg, gevent):
         return True
     kname = gdk.keyval_name(gevent.keyval).lower()
     print('keyPress', kname)
     #if kname.startswith('alt'):
     #    return True
     ## How to disable Alt+Space of metacity ?????????????????????
     if kname == 'up':
         self.jdPlus(-7)
     elif kname == 'down':
         self.jdPlus(7)
     elif kname == 'right':
         if rtl:
             self.jdPlus(-1)
         else:
             self.jdPlus(1)
     elif kname == 'left':
         if rtl:
             self.jdPlus(1)
         else:
             self.jdPlus(-1)
     elif kname == 'end':
         self.changeDate(
             ui.cell.year,
             ui.cell.month,
             core.getMonthLen(ui.cell.year, ui.cell.month,
                              calTypes.primary),
         )
     elif kname in ('page_up', 'k', 'p'):
         self.monthPlus(-1)
     elif kname in ('page_down', 'j', 'n'):
         self.monthPlus(1)
     elif kname in ('f10', 'm'):
         if gevent.get_state() & gdk.ModifierType.SHIFT_MASK:
             # Simulate right click (key beside Right-Ctrl)
             self.emit('popup-cell-menu', gevent.time, *self.getCellPos())
         else:
             self.emit('popup-main-menu', gevent.time,
                       *self.getMainMenuPos())
     else:
         return False
     return True
示例#10
0
 def keyPress(self, arg, gevent):
     if CalBase.keyPress(self, arg, gevent):
         return True
     kname = gdk.keyval_name(gevent.keyval).lower()
     #if kname.startswith("alt"):
     #	return True
     ## How to disable Alt+Space of metacity ?????????????????????
     if kname == "up":
         self.jdPlus(-7)
     elif kname == "down":
         self.jdPlus(7)
     elif kname == "right":
         if rtl:
             self.jdPlus(-1)
         else:
             self.jdPlus(1)
     elif kname == "left":
         if rtl:
             self.jdPlus(1)
         else:
             self.jdPlus(-1)
     elif kname == "end":
         self.changeDate(
             ui.cell.year,
             ui.cell.month,
             core.getMonthLen(ui.cell.year, ui.cell.month,
                              calTypes.primary),
         )
     elif kname in ("page_up", "k", "p"):
         self.monthPlus(-1)
     elif kname in ("page_down", "j", "n"):
         self.monthPlus(1)
     elif kname in ("f10", "m"):
         if gevent.get_state() & gdk.ModifierType.SHIFT_MASK:
             # Simulate right click (key beside Right-Ctrl)
             self.emit("popup-cell-menu", gevent.time, *self.getCellPos())
         else:
             self.emit("popup-main-menu", gevent.time,
                       *self.getMainMenuPos())
     else:
         return False
     return True
示例#11
0
 def keyPress(self, arg, gevent):
     print('keyPress')
     if CalBase.keyPress(self, arg, gevent):
         return True
     kname = gdk.keyval_name(gevent.keyval).lower()
     print('keyPress', kname)
     #if kname.startswith('alt'):
     #    return True
     ## How to disable Alt+Space of metacity ?????????????????????
     if kname=='up':
         self.jdPlus(-7)
     elif kname=='down':
         self.jdPlus(7)
     elif kname=='right':
         if rtl:
             self.jdPlus(-1)
         else:
             self.jdPlus(1)
     elif kname=='left':
         if rtl:
             self.jdPlus(1)
         else:
             self.jdPlus(-1)
     elif kname=='end':
         self.changeDate(
             ui.cell.year,
             ui.cell.month,
             core.getMonthLen(ui.cell.year, ui.cell.month, calTypes.primary),
         )
     elif kname in ('page_up', 'k', 'p'):
         self.monthPlus(-1)
     elif kname in ('page_down', 'j', 'n'):
         self.monthPlus(1)
     elif kname in ('f10', 'm'):
         if gevent.get_state() & gdk.ModifierType.SHIFT_MASK:
             # Simulate right click (key beside Right-Ctrl)
             self.emit('popup-cell-menu', gevent.time, *self.getCellPos())
         else:
             self.emit('popup-main-menu', gevent.time, *self.getMainMenuPos())
     else:
         return False
     return True