Esempio n. 1
0
        //----------------------------------------------------------------------------
        /// <summary>
        /// connect up events from buttons to mouse.
        /// </summary>
        /// <param name="inputSytem">the input that is being accessed</param>
        //----------------------------------------------------------------------------
        protected virtual void ConnectedEvents(Input inputSytem)
        {
            ActionMap actionMap = inputSytem.GetController((int)Controller.Player_1_Mouse);

            if (actionMap != null)
            {
                actionMap.TryCreateandSetHandler("LeftClick", MouseButton.LeftButton, ButtonState.Pressed, false, OnClickEvent);
                actionMap.TryCreateandSetHandler("LeftClickPolling", MouseButton.LeftButton, ButtonState.Pressed, true, OnClickEventPolling);
                actionMap.TryCreateandSetHandler("LeftClickReleased", MouseButton.LeftButton, ButtonState.Released, false, OnUnClickEvent);
            }

            OnOver += OnOverEvent;
            OnOff  += OnOffEvent;
        }