- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
/// <summary>
/// Проверка нажатия 2 клавиш (напрмер: Ctrl+W)
/// </summary>
/// <param name="firstKey">Первая клавиша</param>
/// <param name="hotKey">Сочетание из БД</param>
/// <param name="e">Аргументы события нажатия клавиши</param>
/// <param name="Scope">Область видимости</param>
/// <returns>Действие</returns>
private static string CheckMultipleKeyPress(string firstKey, DBHotKeys_new hotKey, KeyEventArgs e, HotKeyScope Scope)
{
System.Text.StringBuilder concat = new System.Text.StringBuilder();
if (!string.IsNullOrEmpty(PreviousKey))
{
concat.Append('+');
}
if (!string.IsNullOrEmpty(firstKey))
{
concat.Append(firstKey).Append('+');
}
if (!string.IsNullOrEmpty(PreviousKey))
{
concat.Append(PreviousKey).Append('+');
}
PreviousKey = ReplaceKeyCode(e.KeyCode);
if (e.KeyCode != Keys.ControlKey)
{
concat.Append(ReplaceKeyCode(e.KeyCode));
}
//if (concat[0] == '+')
//{
// concat = new System.Text.StringBuilder(concat.ToString().Substring(1));
//}
if ((hotKey.Scope == Scope) && (concat.ToString().Equals(hotKey.HotKeyString)))
{
PreviousKey = string.Empty;
return hotKey.Action;
}
PreviousKey = string.Empty;
return string.Empty;
}