Ejemplo n.º 1
0
        public RawInputForm()
        {
            InitializeComponent();

            int size = Marshal.SizeOf(typeof(SRawInputDevice));
            SRawInputDevice[] devices = new SRawInputDevice[1];

            // UsagePage=1,Usage=2 �Ń}�E�X�f�o�C�X��w��
            devices[0].UsagePage = 1;
            devices[0].Usage = 2;

            //WM_INPUT ��󂯎��E�B���h�E
            devices[0].Target = this.Handle;

            //WM_INPUT ��L���ɂ���f�o�C�X�Q�Cdevices �̐��CRawInputDevice �̍\���̃T�C�Y
            RegisterRawInputDevices(devices, 1, size);

            //touchMap =
            //pointingDevices = pdCollection;
            #region touchDevice

            if (Windows7.Multitouch.TouchHandler.DigitizerCapabilities.IsMultiTouchReady)
            {
                _touchHandler = Factory.CreateHandler<TouchHandler>(Browser.Instance.control);
                _touchHandler.TouchDown += new EventHandler<TouchEventArgs>(_touchHandler_TouchDown);
                _touchHandler.TouchUp += new EventHandler<TouchEventArgs>(_touchHandler_TouchUp);
                _touchHandler.TouchMove += new EventHandler<TouchEventArgs>(_touchHandler_TouchMove);
                //touchPoints = new List<PointingDevice>();
            }
            #endregion
        }
Ejemplo n.º 2
0
 private static extern int RegisterRawInputDevices(SRawInputDevice[] devices, int number, int size);