private void HookManager_MouseDoubleClick(object sender, MouseEventArgs e) { try { APPNAME = DBase.ActiveApplicationName(); this.Text = "DBC - " + APPNAME; DataTable dtf = DBase.FilterTable(DBase.DTAPP, "APPNAME = '" + APPNAME + "'"); if (dtf.Rows.Count > 0) { ENABLE = DBase.BoolReturn(dtf, 0, "ENABLE"); if (ENABLE) { DOUBLECLICK = DBase.BoolReturn(dtf, 0, "DOUBLECLICK"); HOLDCLICK = DBase.BoolReturn(dtf, 0, "HOLDCLICK"); SHORTKEY = DBase.StringReturn(dtf, 0, "SHORTKEY"); SKIP_OLD_CLIPBOARD = DBase.BoolReturn(dtf, 0, "SKIP_OLD_CLIPBOARD"); if (DOUBLECLICK) { if (APPNAME.ToLower() == "firefox" || APPNAME.ToLower() == "chrome" || APPNAME.ToLower() == "steam" || APPNAME.ToLower() == "opera") { if ((Cursor.Position.Y - DBase.HandleLocation_Top) > 150) { TRANSLATE(true); } } else { TRANSLATE(true); } } else { this.Text = "DBC - " + APPNAME + " - DISABLED - " + SHORTKEY; } } else { } } } catch (Exception ex) { if (DBase.ShowException == 1) { MessageBox.Show(ex.ToString()); } } }
private void HookManager_KeyDown(object sender, KeyEventArgs e) { if (DBase.ActiveTranslation == 0) { return; } try { APPNAME = DBase.ActiveApplicationName(); dtf = DBase.FilterTable(DBase.DTAPP, "APPNAME = '" + APPNAME + "'"); if (dtf.Rows.Count > 0) { ENABLE = DBase.BoolReturn(dtf, 0, "ENABLE"); SKIP_OLD_CLIPBOARD = DBase.BoolReturn(dtf, 0, "SKIP_OLD_CLIPBOARD"); if (ENABLE) { SHORTKEY = DBase.StringReturn(dtf, 0, "SHORTKEY"); Enum.TryParse(SHORTKEY, out key); if (e.KeyCode == key) { TRANSLATE(false); } else { this.Text = "KD - " + APPNAME + " - " + SHORTKEY; } } } } catch (Exception ex) { if (DBase.ShowException == 1) { MessageBox.Show(ex.ToString()); } } //Enable/Disable if (DWindow.IsControlKeyDown() && DWindow.IsAltKeyDown() && DWindow.IsShiftKeyDown()) { if ((DateTime.Now - LastKeyPress).TotalMilliseconds > 1000) { LastKeyPress = DateTime.Now; DBase.ActiveTranslation = DBase.ActiveTranslation == 1 ? 0 : 1; RefreshButton(); } } }
void HookManager_MouseUp(object sender, MouseEventArgs e) { if (DBase.ActiveTranslation == 0) { return; } try { if ((DateTime.Now - MDown).TotalMilliseconds >= 2000) { APPNAME = DBase.ActiveApplicationName(); SHORTKEY = DBase.StringReturn(dtf, 0, "SHORTKEY"); P2 = new Point(Cursor.Position.X, Cursor.Position.Y); this.Text = APPNAME + " - " + DBase.HandleLocation_Top + " - " + (Cursor.Position.Y - DBase.HandleLocation_Top); dtf = DBase.FilterTable(DBase.DTAPP, "APPNAME = '" + APPNAME + "'"); if (dtf.Rows.Count > 0) { ENABLE = DBase.BoolReturn(dtf, 0, "ENABLE"); if (ENABLE) { DOUBLECLICK = DBase.BoolReturn(dtf, 0, "DOUBLECLICK"); HOLDCLICK = DBase.BoolReturn(dtf, 0, "HOLDCLICK"); SHORTKEY = DBase.StringReturn(dtf, 0, "SHORTKEY"); SKIP_OLD_CLIPBOARD = DBase.BoolReturn(dtf, 0, "SKIP_OLD_CLIPBOARD"); if (HOLDCLICK) { if (Cursor.Position.X < X) { X = Cursor.Position.X; } if (Cursor.Position.Y < Y) { Y = Cursor.Position.Y; } if (APPNAME.ToLower() == "firefox" || APPNAME.ToLower() == "chrome" || APPNAME.ToLower() == "steam" || APPNAME.ToLower() == "opera") { if (Cursor.Position.Y > 150) { TRANSLATE(true); } else { //this.Text = DateTime.Now.ToString("hh:ss"); } } else { TRANSLATE(true); } } else { this.Text = "HC - " + APPNAME + " - DISABLED - " + SHORTKEY + " "; } } } } else { //this.Text = "JustClickSee"; } } catch (Exception ex) { if (DBase.ShowException == 1) { MessageBox.Show(ex.ToString()); } } }