Inheritance: System.Windows.Forms.Form
Ejemplo n.º 1
0
        public BackgroundTouch(TouchForm tForm) : base()
        {
	        touchForm = tForm;

            Win32TouchFunctions.INTERACTION_CONTEXT_CONFIGURATION[] cfg = new Win32TouchFunctions.INTERACTION_CONTEXT_CONFIGURATION[]
            {
                new Win32TouchFunctions.INTERACTION_CONTEXT_CONFIGURATION(Win32TouchFunctions.INTERACTION.TAP,
                    Win32TouchFunctions.INTERACTION_CONFIGURATION_FLAGS.TAP |
                    Win32TouchFunctions.INTERACTION_CONFIGURATION_FLAGS.TAP_DOUBLE),

                new Win32TouchFunctions.INTERACTION_CONTEXT_CONFIGURATION(Win32TouchFunctions.INTERACTION.SECONDARY_TAP,
                    Win32TouchFunctions.INTERACTION_CONFIGURATION_FLAGS.SECONDARY_TAP),

                new Win32TouchFunctions.INTERACTION_CONTEXT_CONFIGURATION(Win32TouchFunctions.INTERACTION.HOLD,
                    Win32TouchFunctions.INTERACTION_CONFIGURATION_FLAGS.HOLD),

					new Win32TouchFunctions.INTERACTION_CONTEXT_CONFIGURATION(Win32TouchFunctions.INTERACTION.MANIPULATION,
                    Win32TouchFunctions.INTERACTION_CONFIGURATION_FLAGS.MANIPULATION |
                    Win32TouchFunctions.INTERACTION_CONFIGURATION_FLAGS.MANIPULATION_SCALING |
					Win32TouchFunctions.INTERACTION_CONFIGURATION_FLAGS.MANIPULATION_TRANSLATION_X |
                    Win32TouchFunctions.INTERACTION_CONFIGURATION_FLAGS.MANIPULATION_TRANSLATION_Y)
            };

            Win32TouchFunctions.SetInteractionConfigurationInteractionContext(Context, cfg.Length, cfg);
        }
Ejemplo n.º 2
0
        public BackgroundTouch(TouchForm tForm) : base()
        {
            touchForm = tForm;

            Win32TouchFunctions.INTERACTION_CONTEXT_CONFIGURATION[] cfg = new Win32TouchFunctions.INTERACTION_CONTEXT_CONFIGURATION[]
            {
                new Win32TouchFunctions.INTERACTION_CONTEXT_CONFIGURATION(Win32TouchFunctions.INTERACTION.TAP,
                                                                          Win32TouchFunctions.INTERACTION_CONFIGURATION_FLAGS.TAP |
                                                                          Win32TouchFunctions.INTERACTION_CONFIGURATION_FLAGS.TAP_DOUBLE),

                new Win32TouchFunctions.INTERACTION_CONTEXT_CONFIGURATION(Win32TouchFunctions.INTERACTION.SECONDARY_TAP,
                                                                          Win32TouchFunctions.INTERACTION_CONFIGURATION_FLAGS.SECONDARY_TAP),

                new Win32TouchFunctions.INTERACTION_CONTEXT_CONFIGURATION(Win32TouchFunctions.INTERACTION.HOLD,
                                                                          Win32TouchFunctions.INTERACTION_CONFIGURATION_FLAGS.HOLD),

                new Win32TouchFunctions.INTERACTION_CONTEXT_CONFIGURATION(Win32TouchFunctions.INTERACTION.MANIPULATION,
                                                                          Win32TouchFunctions.INTERACTION_CONFIGURATION_FLAGS.MANIPULATION |
                                                                          Win32TouchFunctions.INTERACTION_CONFIGURATION_FLAGS.MANIPULATION_SCALING |
                                                                          Win32TouchFunctions.INTERACTION_CONFIGURATION_FLAGS.MANIPULATION_TRANSLATION_X |
                                                                          Win32TouchFunctions.INTERACTION_CONFIGURATION_FLAGS.MANIPULATION_TRANSLATION_Y)
            };

            Win32TouchFunctions.SetInteractionConfigurationInteractionContext(Context, cfg.Length, cfg);
        }
Ejemplo n.º 3
0
		/// <summary>
		/// 
		/// </summary>
		/// <param name="parameters"></param>
		/// <param name="output"></param>
		/// <returns></returns>
		public Form CreateTouchForm(GraphicsParameters parameters, Output output)
		{
			var form = new TouchForm() {
				Text			=	Game.GameTitle,
				BackColor		=	System.Drawing.Color.Black,
				ClientSize		=	new System.Drawing.Size(parameters.Width, parameters.Height),
				Icon			=	Game.Icon ?? Fusion.Properties.Resources.fusionIcon,
				ControlBox		=	false,
				StartPosition	=	output == null ? FormStartPosition.CenterScreen : FormStartPosition.Manual,
			};


			if (output != null) {
				var bounds	= output.Description.DesktopBounds;
				var scrW	= bounds.Right - bounds.Left;
				var scrH	= bounds.Bottom - bounds.Top;

				form.Location = new System.Drawing.Point(bounds.Left + (scrW - form.Width) / 2, bounds.Top + (scrH - form.Height) / 2);
				form.Text += " - [" + output.Description.DeviceName + "]";
			}

			form.KeyDown	+= form_KeyDown;
			form.KeyUp		+= form_KeyUp;
			form.KeyPress	+= form_KeyPress;
			form.Resize		+= (s, e) => Game.InputDevice.RemoveAllPressedKeys();
			form.Move		+= (s, e) => Game.InputDevice.RemoveAllPressedKeys();

			form.TouchTap			+= (pos) => Game.InputDevice.NotifyTouchTap(pos);
			form.TouchDoubleTap		+= (pos) => Game.InputDevice.NotifyTouchDoubleTap(pos);
			form.TouchSecondaryTap	+= (pos) => Game.InputDevice.NotifyTouchSecondaryTap(pos);
			form.TouchManipulation	+= (center, delta, scale) => Game.InputDevice.NotifyTouchManipulation(center, delta, scale);

			return form;
		}