📄 sshotkeycontrol.cs
字号:
namespace Imps.Client.Pc.Options
{
using Imps.Client;
using Imps.Client.Core;
using Imps.Client.Pc;
using Imps.Client.Pc.Controls;
using Imps.Client.Pc.Utils;
using Imps.Client.Resource;
using Imps.Client.Utils;
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
public class SsHotKeyControl : OptionsControlBase
{
private IFrameworkWindow _iFrameworkWindow;
private IContainer components;
private GroupBox gbHKBossKey;
private GroupBox gbHKCaptureScreen;
private GroupBox gbHKShowMW;
private GroupBox gpHKSendMessage;
private XLabel lbUseHk;
private XLabel lbUseHK3;
private XLabel lbUserHk2;
private XLabel lbUserHkBoss;
private RadioButton rbBossKey;
private RadioButton rbNoBossKey;
private RadioButton rbNoHotKey;
private RadioButton rbNoHotKeyCaptureScreen;
private RadioButton rbSendByCtrlEnter;
private RadioButton rbSendByEnter;
private RadioButton rbUseHotKeyCaptureScreen;
private RadioButton rbUserKey;
private XHotKeyInputBox xHotKeyBoxBossKey;
private XHotKeyInputBox xHotKeyBoxCaptureScreen;
private XHotKeyInputBox xHotKeyBoxMainWnd;
public SsHotKeyControl(IFrameworkWindow iFrameworkWin)
{
this._iFrameworkWindow = iFrameworkWin;
this.InitializeComponent();
this.HandleUiEvent();
}
public override bool CheckUserInput()
{
if (!this.rbNoHotKey.Checked)
{
if ((this.xHotKeyBoxMainWnd == null) || string.IsNullOrEmpty(this.xHotKeyBoxMainWnd.Text))
{
BalloonHelper.ShowInputErrorBallon(this.xHotKeyBoxMainWnd, "热键不能为空!", StringTable.Options.TitleInvalidInput);
return false;
}
if (!this.xHotKeyBoxMainWnd.HotKey.IsValid)
{
BalloonHelper.ShowInputErrorBallon(this.xHotKeyBoxMainWnd, string.Format(StringTable.Hotkey.MsgInvalidHotKey, this.xHotKeyBoxMainWnd.HotKey.ToString()), StringTable.Options.TitleInvalidInput);
this.xHotKeyBoxMainWnd.HotKey = new HotKey(this.CurrentUser.Configuration.UserSetting.MainWindowSetting.HotKeyShowMainwindow);
return false;
}
}
if (!this.rbNoBossKey.Checked)
{
if ((this.xHotKeyBoxBossKey == null) || string.IsNullOrEmpty(this.xHotKeyBoxBossKey.Text))
{
BalloonHelper.ShowInputErrorBallon(this.xHotKeyBoxBossKey, "热键不能为空!", StringTable.Options.TitleInvalidInput);
return false;
}
if (!this.xHotKeyBoxBossKey.HotKey.IsValid)
{
BalloonHelper.ShowInputErrorBallon(this.xHotKeyBoxBossKey, string.Format(StringTable.Hotkey.MsgInvalidHotKey, this.xHotKeyBoxBossKey.HotKey.ToString()), StringTable.Options.TitleInvalidInput);
this.xHotKeyBoxBossKey.HotKey = new HotKey(this.CurrentUser.Configuration.UserSetting.MainWindowSetting.HotKeyHideMainwindow);
return false;
}
}
if ((!this.rbNoHotKey.Checked && !this.rbNoBossKey.Checked) && (this.xHotKeyBoxMainWnd.HotKey.ToString() == this.xHotKeyBoxBossKey.HotKey.ToString()))
{
BalloonHelper.ShowInputErrorBallon(this.xHotKeyBoxMainWnd, "热键重复", StringTable.Options.TitleInvalidInput);
return false;
}
return true;
}
protected override void Dispose(bool disposing)
{
if (disposing && (this.components != null))
{
this.components.Dispose();
}
base.Dispose(disposing);
}
private void HandleUiEvent()
{
this.rbUserKey.CheckedChanged += new EventHandler(this.uiData_Changed);
this.rbSendByCtrlEnter.CheckedChanged += new EventHandler(this.uiData_Changed);
this.rbSendByEnter.CheckedChanged += new EventHandler(this.uiData_Changed);
this.xHotKeyBoxMainWnd.KeyUp += new KeyEventHandler(this.xHotKeyBoxMainWnd_KeyUp);
this.xHotKeyBoxMainWnd.KeyDown += new KeyEventHandler(this.xHotKeyBoxMainWnd_KeyDown);
this.xHotKeyBoxBossKey.KeyUp += new KeyEventHandler(this.xHotKeyBoxBossKey_KeyUp);
this.xHotKeyBoxBossKey.KeyDown += new KeyEventHandler(this.xHotKeyBoxBossKey_KeyDown);
this.rbBossKey.CheckedChanged += new EventHandler(this.uiData_Changed);
}
private void InitializeComponent()
{
this.components = new Container();
HotKey key = new HotKey();
HotKey key2 = new HotKey();
HotKey key3 = new HotKey();
this.gbHKShowMW = new GroupBox();
this.rbNoHotKey = new RadioButton();
this.xHotKeyBoxMainWnd = new XHotKeyInputBox();
this.rbUserKey = new RadioButton();
this.lbUseHk = new XLabel();
this.gpHKSendMessage = new GroupBox();
this.rbSendByCtrlEnter = new RadioButton();
this.rbSendByEnter = new RadioButton();
this.lbUserHk2 = new XLabel();
this.gbHKCaptureScreen = new GroupBox();
this.rbNoHotKeyCaptureScreen = new RadioButton();
this.xHotKeyBoxCaptureScreen = new XHotKeyInputBox();
this.rbUseHotKeyCaptureScreen = new RadioButton();
this.lbUseHK3 = new XLabel();
this.xHotKeyBoxBossKey = new XHotKeyInputBox();
this.rbBossKey = new RadioButton();
this.rbNoBossKey = new RadioButton();
this.gbHKBossKey = new GroupBox();
this.lbUserHkBoss = new XLabel();
this.gbHKShowMW.SuspendLayout();
this.gpHKSendMessage.SuspendLayout();
this.gbHKCaptureScreen.SuspendLayout();
this.gbHKBossKey.SuspendLayout();
base.SuspendLayout();
this.gbHKShowMW.Controls.Add(this.rbNoHotKey);
this.gbHKShowMW.Controls.Add(this.xHotKeyBoxMainWnd);
this.gbHKShowMW.Controls.Add(this.rbUserKey);
this.gbHKShowMW.Controls.Add(this.lbUseHk);
this.gbHKShowMW.Location = new System.Drawing.Point(5, 3);
this.gbHKShowMW.Name = "gbHKShowMW";
this.gbHKShowMW.Size = new Size(0x19c, 110);
this.gbHKShowMW.TabIndex = 0;
this.gbHKShowMW.TabStop = false;
this.rbNoHotKey.set_AutoSize(true);
this.rbNoHotKey.Checked = true;
this.rbNoHotKey.Location = new System.Drawing.Point(40, 0x27);
this.rbNoHotKey.Name = "rbNoHotKey";
this.rbNoHotKey.Size = new Size(14, 13);
this.rbNoHotKey.TabIndex = 0;
this.rbNoHotKey.TabStop = true;
this.rbNoHotKey.set_UseVisualStyleBackColor(true);
this.xHotKeyBoxMainWnd.BackColor = Color.White;
this.xHotKeyBoxMainWnd.BorderStyle = BorderStyle.FixedSingle;
this.xHotKeyBoxMainWnd.EmptyTextTip = "";
this.xHotKeyBoxMainWnd.EmptyTextTipColor = Color.DarkGray;
this.xHotKeyBoxMainWnd.HotKey = key;
this.xHotKeyBoxMainWnd.ImeMode = ImeMode.Disable;
this.xHotKeyBoxMainWnd.Location = new System.Drawing.Point(0x75, 0x3f);
this.xHotKeyBoxMainWnd.Name = "xHotKeyBoxMainWnd";
this.xHotKeyBoxMainWnd.NoneText = "";
this.xHotKeyBoxMainWnd.Size = new Size(0xa4, 0x15);
this.xHotKeyBoxMainWnd.TabIndex = 3;
this.xHotKeyBoxMainWnd.Enter += new EventHandler(this.xHotKeyBoxMainWnd_Enter);
this.xHotKeyBoxMainWnd.Leave += new EventHandler(this.xHotKeyBoxMainWnd_Leave);
this.rbUserKey.set_AutoSize(true);
this.rbUserKey.Location = new System.Drawing.Point(40, 0x41);
this.rbUserKey.Name = "rbUserKey";
this.rbUserKey.Size = new Size(14, 13);
this.rbUserKey.TabIndex = 1;
this.rbUserKey.TabStop = true;
this.rbUserKey.set_UseVisualStyleBackColor(true);
this.rbUserKey.CheckedChanged += new EventHandler(this.rbUserKey_CheckedChanged);
this.lbUseHk.set_AutoSize(true);
this.lbUseHk.BorderColor = Color.Empty;
this.lbUseHk.ButtonBorderStyle = ButtonBorderStyle.None;
this.lbUseHk.Location = new System.Drawing.Point(0x10, 0x10);
this.lbUseHk.Name = "lbUseHk";
this.lbUseHk.Size = new Size(0x2f, 12);
this.lbUseHk.TabIndex = 0;
this.lbUseHk.Text = "lbUseHk";
this.lbUseHk.UseMnemonic = false;
this.gpHKSendMessage.Controls.Add(this.rbSendByCtrlEnter);
this.gpHKSendMessage.Controls.Add(this.rbSendByEnter);
this.gpHKSendMessage.Controls.Add(this.lbUserHk2);
this.gpHKSendMessage.Location = new System.Drawing.Point(5, 0x77);
this.gpHKSendMessage.Name = "gpHKSendMessage";
this.gpHKSendMessage.Size = new Size(0x19c, 0x5b);
this.gpHKSendMessage.TabIndex = 1;
this.gpHKSendMessage.TabStop = false;
this.rbSendByCtrlEnter.set_AutoSize(true);
this.rbSendByCtrlEnter.Location = new System.Drawing.Point(40, 0x42);
this.rbSendByCtrlEnter.Name = "rbSendByCtrlEnter";
this.rbSendByCtrlEnter.Size = new Size(14, 13);
this.rbSendByCtrlEnter.TabIndex = 1;
this.rbSendByCtrlEnter.TabStop = true;
this.rbSendByCtrlEnter.set_UseVisualStyleBackColor(true);
this.rbSendByEnter.set_AutoSize(true);
this.rbSendByEnter.Checked = true;
this.rbSendByEnter.Location = new System.Drawing.Point(40, 0x2b);
this.rbSendByEnter.Name = "rbSendByEnter";
this.rbSendByEnter.Size = new Size(14, 13);
this.rbSendByEnter.TabIndex = 0;
this.rbSendByEnter.TabStop = true;
this.rbSendByEnter.set_UseVisualStyleBackColor(true);
this.lbUserHk2.set_AutoSize(true);
this.lbUserHk2.BorderColor = Color.Empty;
this.lbUserHk2.ButtonBorderStyle = ButtonBorderStyle.None;
this.lbUserHk2.Location = new System.Drawing.Point(0x10, 0x17);
this.lbUserHk2.Name = "lbUserHk2";
this.lbUserHk2.Size = new Size(0x3b, 12);
this.lbUserHk2.TabIndex = 4;
this.lbUserHk2.Text = "lbUserHk2";
this.lbUserHk2.UseMnemonic = false;
this.gbHKCaptureScreen.Controls.Add(this.rbNoHotKeyCaptureScreen);
this.gbHKCaptureScreen.Controls.Add(this.xHotKeyBoxCaptureScreen);
this.gbHKCaptureScreen.Controls.Add(this.rbUseHotKeyCaptureScreen);
this.gbHKCaptureScreen.Controls.Add(this.lbUseHK3);
this.gbHKCaptureScreen.Location = new System.Drawing.Point(3, 0x16f);
this.gbHKCaptureScreen.Name = "gbHKCaptureScreen";
this.gbHKCaptureScreen.Size = new Size(0x19c, 110);
this.gbHKCaptureScreen.TabIndex = 2;
this.gbHKCaptureScreen.TabStop = false;
this.gbHKCaptureScreen.Visible = false;
this.rbNoHotKeyCaptureScreen.set_AutoSize(true);
this.rbNoHotKeyCaptureScreen.Checked = true;
this.rbNoHotKeyCaptureScreen.Location = new System.Drawing.Point(40, 0x27);
this.rbNoHotKeyCaptureScreen.Name = "rbNoHotKeyCaptureScreen";
this.rbNoHotKeyCaptureScreen.Size = new Size(14, 13);
this.rbNoHotKeyCaptureScreen.TabIndex = 0;
this.rbNoHotKeyCaptureScreen.TabStop = true;
this.rbNoHotKeyCaptureScreen.set_UseVisualStyleBackColor(true);
this.xHotKeyBoxCaptureScreen.BackColor = Color.White;
this.xHotKeyBoxCaptureScreen.BorderStyle = BorderStyle.FixedSingle;
this.xHotKeyBoxCaptureScreen.EmptyTextTip = "";
this.xHotKeyBoxCaptureScreen.EmptyTextTipColor = Color.DarkGray;
this.xHotKeyBoxCaptureScreen.HotKey = key2;
this.xHotKeyBoxCaptureScreen.ImeMode = ImeMode.Disable;
this.xHotKeyBoxCaptureScreen.Location = new System.Drawing.Point(0x75, 0x3f);
this.xHotKeyBoxCaptureScreen.Name = "xHotKeyBoxCaptureScreen";
this.xHotKeyBoxCaptureScreen.NoneText = "";
this.xHotKeyBoxCaptureScreen.Size = new Size(0xa4, 0x15);
this.xHotKeyBoxCaptureScreen.TabIndex = 3;
this.rbUseHotKeyCaptureScreen.set_AutoSize(true);
this.rbUseHotKeyCaptureScreen.Location = new System.Drawing.Point(40, 0x41);
this.rbUseHotKeyCaptureScreen.Name = "rbUseHotKeyCaptureScreen";
this.rbUseHotKeyCaptureScreen.Size = new Size(14, 13);
this.rbUseHotKeyCaptureScreen.TabIndex = 1;
this.rbUseHotKeyCaptureScreen.TabStop = true;
this.rbUseHotKeyCaptureScreen.set_UseVisualStyleBackColor(true);
this.lbUseHK3.set_AutoSize(true);
this.lbUseHK3.BorderColor = Color.Empty;
this.lbUseHK3.ButtonBorderStyle = ButtonBorderStyle.None;
this.lbUseHK3.Location = new System.Drawing.Point(0x10, 0x10);
this.lbUseHK3.Name = "lbUseHK3";
this.lbUseHK3.Size = new Size(0x2f, 12);
this.lbUseHK3.TabIndex = 0;
this.lbUseHK3.Text = "xLabel1";
this.lbUseHK3.UseMnemonic = false;
this.xHotKeyBoxBossKey.BackColor = Color.White;
this.xHotKeyBoxBossKey.BorderStyle = BorderStyle.FixedSingle;
this.xHotKeyBoxBossKey.EmptyTextTip = "";
this.xHotKeyBoxBossKey.EmptyTextTipColor = Color.DarkGray;
this.xHotKeyBoxBossKey.HotKey = key3;
this.xHotKeyBoxBossKey.ImeMode = ImeMode.Disable;
this.xHotKeyBoxBossKey.Location = new System.Drawing.Point(0x75, 0x3f);
this.xHotKeyBoxBossKey.Name = "xHotKeyBoxBossKey";
this.xHotKeyBoxBossKey.NoneText = "";
this.xHotKeyBoxBossKey.Size = new Size(0xa4, 0x15);
this.xHotKeyBoxBossKey.TabIndex = 3;
this.xHotKeyBoxBossKey.Enter += new EventHandler(this.xHotKeyBoxBossKey_Enter);
this.xHotKeyBoxBossKey.Leave += new EventHandler(this.xHotKeyBoxBossKey_Leave);
this.rbBossKey.set_AutoSize(true);
this.rbBossKey.Location = new System.Drawing.Point(40, 0x41);
this.rbBossKey.Name = "rbBossKey";
this.rbBossKey.Size = new Size(14, 13);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -