예제 #1
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.state & gdk.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
파일: monthcal.py 프로젝트: Noori/starcal
 def keyPress(self, arg, event):
     if CalBase.keyPress(self, arg, event):
         return True
     kname = gdk.keyval_name(event.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,
             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 event.state & gdk.SHIFT_MASK:
             # Simulate right click (key beside Right-Ctrl)
             self.emit('popup-menu-cell', event.time, *self.getCellPos())
         else:
             self.emit('popup-menu-main', event.time, *self.getMainMenuPos())
     else:
         return False
     return True
예제 #3
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=='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.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=='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.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