Esempio n. 1
0
        /// <summary>
        /// Unassign keyboard key or joystick button when double clicked a Datagrid cell.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DataGrid_MouseButtonDoubleClick(object sender, MouseButtonEventArgs e)
        {
            this.KeyMappingTimer.Stop();

            var selectedItem = (KeyAssgn)KeyMappingGrid.SelectedItem;

            if (selectedItem == null)
            {
                return;
            }
            if (KeyMappingGrid.CurrentColumn == null)
            {
                return;
            }
            if (selectedItem.GetVisibility() != "White")
            {
                return;
            }
            if (selectedItem.GetCallback() == "SimDoNothing")
            {
                return;
            }

            KeyMappingWindow.ShowKeyMappingWindow(selectedItem, keyFile, deviceControl, sender);
            KeyMappingGrid.Items.Refresh();
            KeyMappingGrid.UnselectAllCells();

            this.KeyMappingTimer.Start();
        }
Esempio n. 2
0
        public static void ShowKeyMappingWindow(KeyAssgn SelectedCallback, KeyFile keyFile, DeviceControl deviceControl, object sender)
        {
            KeyMappingWindow ownWindow = new KeyMappingWindow(SelectedCallback, keyFile, deviceControl);

            ownWindow.ShowDialog();
        }