示例#1
0
        public Background(TouchForm form)
            : base()
        {
            _form = form;

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

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

                new Win32.INTERACTION_CONTEXT_CONFIGURATION(Win32.INTERACTION.HOLD,
                                                            Win32.INTERACTION_CONFIGURATION_FLAGS.HOLD)
            };

            Win32.SetInteractionConfigurationInteractionContext(Context, cfg.Length, cfg);
        }
示例#2
0
        public Figure(TouchForm form, Color color, bool pivot, bool rails)
            : base()
        {
            _form  = form;
            _color = color;
            _pivot = pivot;

            Win32.INTERACTION_CONTEXT_CONFIGURATION[] cfg = new Win32.INTERACTION_CONTEXT_CONFIGURATION[]
            {
                new Win32.INTERACTION_CONTEXT_CONFIGURATION(Win32.INTERACTION.MANIPULATION,
                                                            Win32.INTERACTION_CONFIGURATION_FLAGS.MANIPULATION |
                                                            //Win32.INTERACTION_CONFIGURATION_FLAGS.MANIPULATION_TRANSLATION_X |
                                                            //Win32.INTERACTION_CONFIGURATION_FLAGS.MANIPULATION_TRANSLATION_Y |
                                                            Win32.INTERACTION_CONFIGURATION_FLAGS.MANIPULATION_SCALING |
                                                            Win32.INTERACTION_CONFIGURATION_FLAGS.MANIPULATION_ROTATION |
                                                            Win32.INTERACTION_CONFIGURATION_FLAGS.MANIPULATION_TRANSLATION_INERTIA |
                                                            Win32.INTERACTION_CONFIGURATION_FLAGS.MANIPULATION_ROTATION_INERTIA |
                                                            Win32.INTERACTION_CONFIGURATION_FLAGS.MANIPULATION_SCALING_INERTIA),

                new Win32.INTERACTION_CONTEXT_CONFIGURATION(Win32.INTERACTION.TAP,
                                                            Win32.INTERACTION_CONFIGURATION_FLAGS.TAP |
                                                            Win32.INTERACTION_CONFIGURATION_FLAGS.TAP_DOUBLE)
            };

            if (!pivot)
            {
                cfg[0].Enable |=
                    Win32.INTERACTION_CONFIGURATION_FLAGS.MANIPULATION_TRANSLATION_X |
                    Win32.INTERACTION_CONFIGURATION_FLAGS.MANIPULATION_TRANSLATION_Y;
            }

            if (rails)
            {
                cfg[0].Enable |=
                    Win32.INTERACTION_CONFIGURATION_FLAGS.MANIPULATION_RAILS_X |
                    Win32.INTERACTION_CONFIGURATION_FLAGS.MANIPULATION_RAILS_Y;
            }

            Win32.SetInteractionConfigurationInteractionContext(Context, cfg.Length, cfg);
        }