Пример #1
0
        public Scenario3()
        {
            this.InitializeComponent();

            // Retrieve information about whether or not a keyboard is present
            Windows.Devices.Input.KeyboardCapabilities kbdCapabilities = new Windows.Devices.Input.KeyboardCapabilities();
            keyboardText.Text = "Keyboard present = " + kbdCapabilities.KeyboardPresent.ToString();

            // Retrieve information about the capabilities of the device's mouse.  This includes:
            // - Whether or not a mouse is present
            // - The number of buttons on the mouse
            // - Whether or not the mouse has a vertical scroll wheel
            // - Whether or not the mouse has a horizontal scroll wheel
            // - Whether or not the user has elected to swap the mouse buttons, causing
            //   the right mouse button to be the primary button
            Windows.Devices.Input.MouseCapabilities mouseCapabilities = new Windows.Devices.Input.MouseCapabilities();
            System.Text.StringBuilder sb = new System.Text.StringBuilder();
            sb.Append("Mouse present = " + mouseCapabilities.MousePresent.ToString() + "\n");
            sb.Append("Number of buttons = " + mouseCapabilities.NumberOfButtons.ToString() + "\n");
            sb.Append("Vertical wheel present = " + mouseCapabilities.VerticalWheelPresent.ToString() + "\n");
            sb.Append("Horizontal wheel present = " + mouseCapabilities.HorizontalWheelPresent.ToString() + "\n");
            sb.Append("Buttons swapped = " + mouseCapabilities.SwapButtons.ToString());
            mouseText.Text = sb.ToString();

            // Retrieve information about the capabilities of the device's mouse.  This includes:
            // - Whether or not the device supports touch
            // - The supported number of simultaneous touch contacts
            Windows.Devices.Input.TouchCapabilities touchCapabilities = new Windows.Devices.Input.TouchCapabilities();
            sb = new System.Text.StringBuilder();
            sb.Append("Touch present = " + touchCapabilities.TouchPresent.ToString() + "\n");
            sb.Append("Touch contacts supported = " + touchCapabilities.Contacts.ToString());
            touchText.Text = sb.ToString();
        }
        public Scenario3()
        {
            this.InitializeComponent();

            // Retrieve information about whether or not a keyboard is present
            Windows.Devices.Input.KeyboardCapabilities kbdCapabilities = new Windows.Devices.Input.KeyboardCapabilities();
            keyboardText.Text = "Keyboard present = " + kbdCapabilities.KeyboardPresent.ToString();

            // Retrieve information about the capabilities of the device's mouse.  This includes:
            // - Whether or not a mouse is present
            // - The number of buttons on the mouse
            // - Whether or not the mouse has a vertical scroll wheel
            // - Whether or not the mouse has a horizontal scroll wheel
            // - Whether or not the user has elected to swap the mouse buttons, causing
            //   the right mouse button to be the primary button
            Windows.Devices.Input.MouseCapabilities mouseCapabilities = new Windows.Devices.Input.MouseCapabilities();
            System.Text.StringBuilder sb = new System.Text.StringBuilder();
            sb.Append("Mouse present = " + mouseCapabilities.MousePresent.ToString() + "\n");
            sb.Append("Number of buttons = " + mouseCapabilities.NumberOfButtons.ToString() + "\n");
            sb.Append("Vertical wheel present = " + mouseCapabilities.VerticalWheelPresent.ToString() + "\n");
            sb.Append("Horizontal wheel present = " + mouseCapabilities.HorizontalWheelPresent.ToString() + "\n");
            sb.Append("Buttons swapped = " + mouseCapabilities.SwapButtons.ToString());
            mouseText.Text = sb.ToString();

            // Retrieve information about the capabilities of the device's mouse.  This includes:
            // - Whether or not the device supports touch
            // - The supported number of simultaneous touch contacts
            Windows.Devices.Input.TouchCapabilities touchCapabilities = new Windows.Devices.Input.TouchCapabilities();
            sb = new System.Text.StringBuilder();
            sb.Append("Touch present = " + touchCapabilities.TouchPresent.ToString() + "\n");
            sb.Append("Touch contacts supported = " + touchCapabilities.Contacts.ToString());
            touchText.Text = sb.ToString();
        }
Пример #3
0
        public InputManager(IServiceRegistry registry) : base(registry)
        {
            HasKeyboard = true;
            HasPointer  = true;

#if SILICONSTUDIO_PLATFORM_WINDOWS_STORE
            GamePadFactories.Add(new XInputGamePadFactory());
#endif
            HasMouse = new Windows.Devices.Input.MouseCapabilities().MousePresent > 0;
        }
Пример #4
0
        /// <summary>
        /// Invoked when this page is about to be displayed in a Frame.
        /// </summary>
        /// <param name="e">Event data that describes how this page was reached.  The Parameter
        /// property is typically used to configure the page.</param>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            string Buffer;
            Windows.Devices.Input.MouseCapabilities MouseCapabilities = new Windows.Devices.Input.MouseCapabilities();

            Buffer = string.Format("There is {0} mouse present\n", MouseCapabilities.MousePresent != 0 ? "a" : "no");
            Buffer += string.Format("There is {0} vertical mouse wheel present\n", MouseCapabilities.VerticalWheelPresent != 0 ? "a" : "no");
            Buffer += string.Format("There is {0} horizontal mouse wheel present\n", MouseCapabilities.HorizontalWheelPresent != 0 ? "a" : "no");
            Buffer += string.Format("The user has {0}opted to swap the mouse buttons\n", MouseCapabilities.SwapButtons != 0 ? "" : "not ");
            Buffer += string.Format("The mouse has {0} button(s)\n", MouseCapabilities.NumberOfButtons);

            MouseOutputTextBlock.Text = Buffer;
        }
        /// <summary>
        /// Invoked when this page is about to be displayed in a Frame.
        /// </summary>
        /// <param name="e">Event data that describes how this page was reached.  The Parameter
        /// property is typically used to configure the page.</param>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            string Buffer;

            Windows.Devices.Input.MouseCapabilities MouseCapabilities = new Windows.Devices.Input.MouseCapabilities();

            Buffer  = string.Format("There is {0} mouse present\n", MouseCapabilities.MousePresent != 0 ? "a" : "no");
            Buffer += string.Format("There is {0} vertical mouse wheel present\n", MouseCapabilities.VerticalWheelPresent != 0 ? "a" : "no");
            Buffer += string.Format("There is {0} horizontal mouse wheel present\n", MouseCapabilities.HorizontalWheelPresent != 0 ? "a" : "no");
            Buffer += string.Format("The user has {0}opted to swap the mouse buttons\n", MouseCapabilities.SwapButtons != 0 ? "" : "not ");
            Buffer += string.Format("The mouse has {0} button(s)\n", MouseCapabilities.NumberOfButtons);

            MouseOutputTextBlock.Text = Buffer;
        }