int CompereKeys(Keys key1, Keys key2) { var res = ((int)key1 & 0xff).CompareTo((int)key2 & 0xff); if (res == 0) res = key1.CompareTo(key2); return res; }
public int CompareTo(HotKeyCombo other) { if (key != other.key) { return(key.CompareTo(other.key)); } return(modifier.CompareTo(other.modifier)); }
/* Methods */ private static int CompareKeys(Keys key1, Keys key2) { var res = ((int)key1 & 0xff).CompareTo((int)key2 & 0xff); if (res == 0) { res = key1.CompareTo(key2); } return(res); }
private int CompereKeys(Keys key1, Keys key2) { int res = ((int)key1 & 0xff).CompareTo((int)key2 & 0xff); if (res == 0) { res = key1.CompareTo(key2); } return(res); }
//----------------------- protected override bool IsInputKey(Keys keyData) { // if the key is A-Z, it's an input key. if (keyData.CompareTo(Keys.A) >= 0 && keyData.CompareTo(Keys.Z) <= 0) { return(true); } // if the key is 0-9, it's an input key. if (keyData.CompareTo(Keys.D0) >= 0 && keyData.CompareTo(Keys.D9) <= 0) { return(true); } // neither 'enter' nor 'backspace' are input keys. if (keyData == Keys.Enter || keyData == Keys.Back) { return(false); } return(base.IsInputKey(keyData)); }
//Method for Detect shorcut protected override bool ProcessDialogKey(Keys keyData) { #region Detecting shortcuts if (keyData == Keys.Escape) { System.Windows.Forms.Application.Exit(); return(true); } if (keyData == Keys.F1) { HandleOnChangeCheckBoxes(checkBoxSealPresent); return(true); } if (keyData == Keys.F2) { HandleOnChangeCheckBoxes(checkBoxHazards); return(true); } if (keyData == Keys.F3) { HandleOnChangeCheckBoxes(checkBoxDamagesFound); return(true); } if (keyData == Keys.F6) { DecreseadSpeed(); return(true); } if (keyData == Keys.F7) { if (timer.Enabled) { PauseImage(); return(true); } PlayImage(); } if (keyData == Keys.F9) { IncreseadSpeed(); return(true); } if (keyData == Keys.F10) { SubmitReview(); return(true); } if (keyData.CompareTo(Keys.Control) == 1) { FocusTextBoxNote(); } return(base.ProcessDialogKey(keyData)); #endregion Detecting shortcuts }