private void OnClick(object sender, EventArgs e) { if (keyData.SelectedRows == null || keyData.SelectedRows.Count == 0) { return; } if (!mulSel) { DataGridViewRow selKey = keyData.SelectedRows[0]; lKey.regist.key = (Keys)selKey.Cells[4].Value; lKey.regist.modify = Ectr.GetModified(selKey.Cells[1].Value, selKey.Cells[2].Value, selKey.Cells[3].Value); Ectr.GetRegistTitle((lKey.regist)); } else { foreach (DataGridViewRow selKey in keyData.SelectedRows) { RegistKey key = new RegistKey(); key.key = (Keys)selKey.Cells[4].Value; key.modify = Ectr.GetModified(selKey.Cells[1].Value, selKey.Cells[2].Value, selKey.Cells[3].Value); lKey.keyList.Add(key); } } kopt.ToggleVisible(); this.Dispose(); }
/// <summary> /// 윈도우프로시저 콜백함수 [키보드이벤트만 허용] /// </summary> /// <param name="m"></param> protected override void WndProc(ref Message m) { if (m.Msg == HOTKEY) { RegistKey key = Ectr.ParseRegist(m); Ectr.ExeMacro(key); } base.WndProc(ref m); }
public RegistKey ParseKey(string str) { String[] strArr; RegistKey rk = new RegistKey(); strArr = str.Split(','); rk.key = (Keys)Convert.ToChar(strArr[0]); rk.modify = Convert.ToInt32(strArr[1]); return(rk); }
public RegistKey ParseRegist(Message m) { Keys key = (Keys)(((int)m.LParam >> 16) & 0xFFFF); int modified = (int)m.LParam & 0xFFFF; RegistKey regst = new RegistKey(); regst.key = key; regst.modify = modified; return(regst); }
public void ExeMacro(RegistKey regst) { Console.WriteLine("얻어온 레지스트키 : " + regst.key + " " + regst.modify); foreach (CMacro cm in mList) { if ((cm.regist.key == regst.key) && (cm.regist.modify == regst.modify)) { Console.WriteLine("같은 레지스트키 찾음."); StartMacro(cm); return; } } }
/// <summary> /// 데이터그리드뷰 셀 클릭 이벤트메소드 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnEntry(object sender, DataGridViewCellEventArgs e) { int row = e.RowIndex; int col = e.ColumnIndex; RegistKey regst = Ectr.GetRegist(row); if (MacroViewer.Clicked(row, col) == 0) { WinLib.RegisterHotKey((int)this.Handle, row, regst.modify, (int)regst.key); Ectr.OnActive(row); } else { WinLib.UnregisterHotKey((int)this.Handle, row); Ectr.UnActive(row); } }
public string GetRegistTitle(RegistKey regist) { return(keyUtil.GetRegistTitle(regist)); }
public void SetMemRegist() { regist = new RegistKey(); }
public CMacro(String title) { this.title = title; regist = new RegistKey(); keyList = new List <RegistKey>(); }
public string GetRegistTitle(RegistKey key) { return(key.key.ToString() + ((key.modify & 1) == 1 ? " + Shift" : "") + ((key.modify & 2) == 1 ? " + Cntl" : "") + ((key.modify & 4) == 1 ? " + Alt" : "")); }