Example #1
0
        private void Load_Hotkey_Editor(DataGridView dgv, GameHotkeys ghks, IniFile inifile)
        {
            int HotkeysLoadedNum = ghks.Load_Hotkeys(inifile);

            if (HotkeysLoadedNum != 0)
            {
                dgv.Rows.Clear();
                dgv.Rows.Add(HotkeysLoadedNum);
                for (int i = 0; i < HotkeysLoadedNum; i++)
                {
                    dgv.Rows[i].Cells[0].Value = ghks.Get_Hotkey(i).HotkeyName;
                    dgv.Rows[i].Cells[1].Value = ghks.Hotkey_Display_Value(i);
                }
            }
        }
Example #2
0
        private void Hotkey_Editor_Key_Down(KeyEventArgs e, DataGridView dgv, GameHotkeys ghks)
        {
            e.SuppressKeyPress = true;

            if (e.Modifiers != Keys.None && (e.KeyCode == Keys.Menu || e.KeyCode == Keys.ControlKey ||
                                             e.KeyCode == Keys.ShiftKey || e.KeyCode == Keys.RControlKey ||
                                             e.KeyCode == Keys.RMenu || e.KeyCode == Keys.RShiftKey))
            {
                dgv.CurrentCell.Value = "";

                if ((int)(e.Modifiers & Keys.Control) == (int)Keys.Control)
                {
                    dgv.CurrentCell.Value += "Crl+";
                }

                if ((int)(e.Modifiers & Keys.Alt) == (int)Keys.Alt)
                {
                    dgv.CurrentCell.Value += "Alt+";
                }

                if ((int)(e.Modifiers & Keys.Shift) == (int)Keys.Shift)
                {
                    dgv.CurrentCell.Value += "Shift";
                }

                return;
            }

            if (!dgv.Visible || dgv.CurrentCell == null)
            {
                return;
            }

            if (dgv.CurrentCell.ColumnIndex == 0)
            {
                dgv.CurrentCell = dgv.Rows[dgv.CurrentCell.RowIndex].Cells[1];
            }

            ghks.Set_Hotkey_Value(e, dgv.CurrentCell.RowIndex);
            dgv.CurrentCell.Value = ghks.Hotkey_Display_Value(dgv.CurrentCell.RowIndex);
        }
Example #3
0
 private void Set_Datagrid_Current_Cell_Value_To_Internal_GameHotkey_Data(DataGridView dgv, GameHotkeys ghks)
 {
     dgv.CurrentCell.Value = ghks.Hotkey_Display_Value(dgv.CurrentCell.RowIndex);
 }