コード例 #1
0
		internal bool ProcessKey (Gdk.Key key, Gdk.ModifierType state)
		{
			switch (key) {
			case Gdk.Key.Up:
				if (state.HasFlag (Gdk.ModifierType.Mod2Mask))
					goto case Gdk.Key.Page_Up;
				if (state.HasFlag (Gdk.ModifierType.ControlMask))
					goto case Gdk.Key.Home;
				SelectItemUp ();
				return true;
			case Gdk.Key.Down:
				if (state.HasFlag (Gdk.ModifierType.Mod2Mask))
					goto case Gdk.Key.Page_Down;
				if (state.HasFlag (Gdk.ModifierType.ControlMask))
					goto case Gdk.Key.End;
				SelectItemDown ();
				return true;
			case Gdk.Key.KP_Page_Down:
			case Gdk.Key.Page_Down:
				SelectNextCategory ();
				return true;
			case Gdk.Key.KP_Page_Up:
			case Gdk.Key.Page_Up:
				SelectPrevCategory ();
				return true;
			case Gdk.Key.Home:
				SelectFirstCategory ();
				return true;
			case Gdk.Key.End:
				SelectLastCatgory ();
				return true;
			
			case Gdk.Key.Return:
				OnItemActivated (EventArgs.Empty);
				return true;
			}
			return true;
		}
コード例 #2
0
		protected override void OnMouseMotion (double x, double y, Gdk.ModifierType state)
		{
			if (state.HasFlag (Gdk.ModifierType.Button1Mask)) {
				HighlightTo ((int)x, (int)y);
				QueueDraw ();
			}
		}