diff --git a/QuickInput/Form1.Designer.cs b/QuickInput/Form1.Designer.cs index fe00506..c866028 100644 --- a/QuickInput/Form1.Designer.cs +++ b/QuickInput/Form1.Designer.cs @@ -50,6 +50,7 @@ private void InitializeComponent() this.启动不显示窗体ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.设置开机启动ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.设置右键发送到快捷键ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.按键码实时显示ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.高级设置ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.打开设置文件ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.打开设置文件目录ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -67,9 +68,9 @@ private void InitializeComponent() this.textBox4 = new System.Windows.Forms.TextBox(); this.placeHolderTextBox2 = new RevitDevelopment.CustomControls.PlaceHolderTextBox(); this.placeHolderTextBox1 = new RevitDevelopment.CustomControls.PlaceHolderTextBox(); - this.按键码实时显示ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.label1 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); + this.切换字典ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.contextMenuStrip1.SuspendLayout(); this.menuStrip1.SuspendLayout(); this.SuspendLayout(); @@ -214,12 +215,21 @@ private void InitializeComponent() resources.ApplyResources(this.设置右键发送到快捷键ToolStripMenuItem, "设置右键发送到快捷键ToolStripMenuItem"); this.设置右键发送到快捷键ToolStripMenuItem.Click += new System.EventHandler(this.设置右键发送到快捷键ToolStripMenuItem_Click); // + // 按键码实时显示ToolStripMenuItem + // + this.按键码实时显示ToolStripMenuItem.Checked = true; + this.按键码实时显示ToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; + this.按键码实时显示ToolStripMenuItem.Name = "按键码实时显示ToolStripMenuItem"; + resources.ApplyResources(this.按键码实时显示ToolStripMenuItem, "按键码实时显示ToolStripMenuItem"); + this.按键码实时显示ToolStripMenuItem.Click += new System.EventHandler(this.按键码实时显示ToolStripMenuItem_Click); + // // 高级设置ToolStripMenuItem // this.高级设置ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.打开设置文件ToolStripMenuItem, this.打开设置文件目录ToolStripMenuItem, this.读取设置文件ToolStripMenuItem, + this.切换字典ToolStripMenuItem, this.测试模式ToolStripMenuItem}); this.高级设置ToolStripMenuItem.Name = "高级设置ToolStripMenuItem"; resources.ApplyResources(this.高级设置ToolStripMenuItem, "高级设置ToolStripMenuItem"); @@ -329,14 +339,6 @@ private void InitializeComponent() this.placeHolderTextBox1.PlaceHolderText = "检测时间间隔(ms)"; this.placeHolderTextBox1.TextChanged += new System.EventHandler(this.placeHolderTextBox1_TextChanged); // - // 按键码实时显示ToolStripMenuItem - // - this.按键码实时显示ToolStripMenuItem.Checked = true; - this.按键码实时显示ToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; - this.按键码实时显示ToolStripMenuItem.Name = "按键码实时显示ToolStripMenuItem"; - resources.ApplyResources(this.按键码实时显示ToolStripMenuItem, "按键码实时显示ToolStripMenuItem"); - this.按键码实时显示ToolStripMenuItem.Click += new System.EventHandler(this.按键码实时显示ToolStripMenuItem_Click); - // // label1 // resources.ApplyResources(this.label1, "label1"); @@ -347,6 +349,12 @@ private void InitializeComponent() resources.ApplyResources(this.label3, "label3"); this.label3.Name = "label3"; // + // 切换字典ToolStripMenuItem + // + this.切换字典ToolStripMenuItem.Name = "切换字典ToolStripMenuItem"; + resources.ApplyResources(this.切换字典ToolStripMenuItem, "切换字典ToolStripMenuItem"); + this.切换字典ToolStripMenuItem.Click += new System.EventHandler(this.切换字典ToolStripMenuItem_Click); + // // Form1 // resources.ApplyResources(this, "$this"); @@ -420,6 +428,7 @@ private void InitializeComponent() private System.Windows.Forms.ToolStripMenuItem 按键码实时显示ToolStripMenuItem; private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label3; + private System.Windows.Forms.ToolStripMenuItem 切换字典ToolStripMenuItem; } } diff --git a/QuickInput/Form1.cs b/QuickInput/Form1.cs index bd61e98..cd18420 100644 --- a/QuickInput/Form1.cs +++ b/QuickInput/Form1.cs @@ -7,6 +7,7 @@ using File = System.IO.File; using System.Text.RegularExpressions; using System.Collections.Generic; +using Input; namespace QuickInput { @@ -26,6 +27,8 @@ public partial class Form1 : Form public string[] args = null; //string[] values = IniManager.values; Dictionary valuesDic = IniManager.valuesDic; + Dictionary specialDic = IniManager.specialDic; + private Setting settingWindow = null; public Form1(string[] args = null) @@ -54,11 +57,10 @@ public Form1(string[] args = null) int hotKeyOut = 32;//空格 int[] press_test = new int[255]; - + Setting setting; void timer_Tick() { - //readWithoutNumber(); GetPressedKey(); @@ -66,10 +68,10 @@ void timer_Tick() if (按键码实时显示ToolStripMenuItem.Checked) { bool haveSetting = settingWindow != null; - Text = initial_title + " 实时按键码:"; + Text = initial_title + " 实时按键码:"; if (haveSetting) { - settingWindow.Text = "Setting 实时按键码:"; + settingWindow.Text = "Setting 实时按键码:"; } for (int i = 0; i < 255; i++) { @@ -82,6 +84,70 @@ void timer_Tick() } } } + this.Text += "字典:" + IniManager.wordName; + if (haveSetting) + { + settingWindow.Text += "字典:" + IniManager.wordName; + } + } + + + //窗体事件 与 自定义按键 + //自定义按键格式: + //按键码,按键码,按键码...=指令 + foreach (var keys_command in specialDic) + { + + string[] key_list = keys_command.Key.Split(','); + List keyInt = new List(); + + + for (int i = 0; i < key_list.Length; i++) + { + try + { + string tmp = key_list[i]; + keyInt.Add(int.Parse(tmp)); + } + catch (Exception) + { + continue; + } + } + + if (keyInt.Count<=0) + { + continue; + } + bool flag = true; + //必须每个键都被按下 + foreach (var item in keyInt) + { + if (!keys[item]) + { + flag = false; + break; + } + } + if (!flag) + { + continue; + } + //上一时刻,至少一个按键不被按下 + flag = false; + foreach (var item in keyInt) + { + if (!keys_before[item]) + { + flag = true; + } + } + if (flag) + { + SendOutByI(0,0,keys_command.Value); + return; + } + ; } @@ -138,10 +204,50 @@ void timer_Tick() } - private void SendOutByI(int i) + private void SendOutByI(int i,int backsapce = 2, string command = "") { - - string tmp = valuesDic[i]; + string tmp; + if (command.Equals("")) + { + tmp = valuesDic[i]; + } + else + { + tmp = command; + } + + if (tmp.IndexOf("QuickInput:") == 0) + { + string com = tmp.Substring("QuickInput:".Length); + //最大化 + if (com.Equals("show")) + { + this.Show(); + } + //最小化 + if (com.Equals("hide")) + { + this.Hide(); + } + //设置 + if (com.Equals("set")) + { + this.openSetting(); + } + //切换words + if (com.Equals("changeWords")) + { + this.changeWords(); + } + //重新读取配置文件 + if (com.Equals("read")) + { + IniManager.readIni(); + MessageBox.Show("读取成功!"); + } + + return; + } if (tmp.IndexOf("QuickInputRun:")==0) { @@ -166,8 +272,12 @@ private void SendOutByI(int i) } else { - SendKeys.SendWait("{BKSP}"); - SendKeys.SendWait("{BKSP}"); + + for (int j = 0; j < backsapce; j++) + { + SendKeys.SendWait("{BKSP}"); + } + SendKeys.SendWait(tmp); } @@ -290,6 +400,7 @@ private void read() { //读取key value 信息 valuesDic = IniManager.readIni(); + specialDic = IniManager.readSpecialIni(); // 读取默认快捷键 string hotKeyStr = IniManager.Read("initialization", "hotKey", ""); @@ -327,10 +438,11 @@ private void setValue(int index, String val, Boolean needsave = true) { Console.WriteLine("Set " + index + ": " + val); //做一些反转义的处理 - valuesDic[index] = val.Replace("\r\n", "{ENTER}"); - valuesDic[index] = val.Replace("\n\r", "{ENTER}"); - valuesDic[index] = val.Replace("\n", "{ENTER}"); - valuesDic[index] = val.Replace("\r", "{ENTER}"); + val = val.Replace("\r\n", "{ENTER}"); + val = val.Replace("\n\r", "{ENTER}"); + val = val.Replace("\n", "{ENTER}"); + val = val.Replace("\r", "{ENTER}"); + valuesDic[index] = val; if (needsave) { save(); @@ -338,11 +450,6 @@ private void setValue(int index, String val, Boolean needsave = true) } - private void button1_Click(object sender, EventArgs e) - { - //IniManager.WriteHelp(iniPath); - read(); - } private void openSetIni() { @@ -504,25 +611,6 @@ private void 退出ToolStripMenuItem_Click(object sender, EventArgs e) } - - private void setOpenShow(int code = 0) - { - switch (code) - { - case 0: - //设置托盘启动 - IniManager.Write("initialization", "openshow", "no", iniPath); - break; - case 1: - //设置正常启动 - IniManager.Write("initialization", "openshow", "", iniPath); - break; - default: - break; - } - } - - private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) @@ -752,6 +840,7 @@ private void placeHolderTextBox2_TextChanged(object sender, EventArgs e) private void englishToolStripMenuItem_Click(object sender, EventArgs e) { + MessageBox.Show("developing!","sorry"); } @@ -760,6 +849,12 @@ private void button1_Click_1(object sender, EventArgs e) WshShell shell = new WshShell(); shell.Run("cmd"); } + private void button1_Click(object sender, EventArgs e) + { + //IniManager.WriteHelp(iniPath); + read(); + } + /// /// 判断一个字符串是否为url @@ -822,7 +917,11 @@ private void 设置ToolStripMenuItem2_Click(object sender, EventArgs e) void openSetting(bool needReshow = true) { - Setting setting = new Setting(needReshow); + if (setting == null) + { + setting = new Setting(needReshow); + } + this.settingWindow = setting; this.Hide(); setting.Show(); @@ -837,6 +936,60 @@ private void 按键码实时显示ToolStripMenuItem_Click(object sender, EventAr Text = initial_title; } } + + private void 切换字典ToolStripMenuItem_Click(object sender, EventArgs e) + { + this.Hide(); + + MessageBox.Show("切换字典后,原字典内容不会删除但会无效,你可以切换回默认字典words" , "你当前的字典" + IniManager.wordName); + string newWords = InputBox.ShowInputBox("请输入新字典名:","建议简单一些"); + + IniManager.wordName = newWords; + string copy = InputBox.ShowInputBox("是否把旧字典复制到新字典?y/n", "注意:y可能或摧毁字典" + newWords); + + this.Show(); + if (copy.Equals("y")) + { + IniManager.writeIni(); + } + else + { + IniManager.readIni(); + } + } + + + // 上面是窗体事件 + // 下面是服务函数 + + void changeWords() + { + string newWords = ""; + newWords = InputBox.ShowInputBox("切换words" , "当前字典:" + IniManager.wordName); + IniManager.wordName = newWords; + IniManager.readIni(); + } + + + private void setOpenShow(int code = 0) + { + switch (code) + { + case 0: + //设置托盘启动 + IniManager.Write("initialization", "openshow", "no", iniPath); + break; + case 1: + //设置正常启动 + IniManager.Write("initialization", "openshow", "", iniPath); + break; + default: + break; + } + } + + + } } diff --git a/QuickInput/Form1.resx b/QuickInput/Form1.resx index 60e5994..a4befa2 100644 --- a/QuickInput/Form1.resx +++ b/QuickInput/Form1.resx @@ -183,6 +183,30 @@ 273, 18 + + 138, 24 + + + 还原窗口 + + + 138, 24 + + + 设置 + + + 138, 24 + + + 官网 + + + 138, 24 + + + 退出 + 139, 100 @@ -1330,92 +1354,38 @@ True - - 138, 24 - - - 还原窗口 - - - 138, 24 - - - 设置 - - - 138, 24 - - - 官网 - - - 138, 24 - - - 退出 - 460, 17 - - 0, 0 - - - 632, 28 - - - 12 - - - menuStrip1 - - - menuStrip1 - - - System.Windows.Forms.MenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 7 - - - 51, 24 - - - 开始 - - 189, 26 + 216, 26 托盘模式 - 189, 26 + 216, 26 导入新设置文件 - 189, 26 + 216, 26 另存为设置文件 - 189, 26 + 216, 26 退出程序 - + 51, 24 - - 设置 + + 开始 234, 26 @@ -1441,78 +1411,120 @@ 设置右键发送到快捷键 - - 81, 24 + + 234, 26 - - 高级设置 + + 按键码实时显示 + + + 51, 24 + + + 设置 - 204, 26 + 216, 26 打开设置文件 - 204, 26 + 216, 26 打开设置文件夹 - 204, 26 + 216, 26 重新读取设置文件 + + 216, 26 + + + 切换字典 + - 204, 26 + 216, 26 测试模式 - - 51, 24 + + 81, 24 - - 关于 + + 高级设置 - 174, 26 + 189, 26 帮助 - 174, 26 + 189, 26 高级功能使用 - 174, 26 + 189, 26 官方网站 - 216, 26 + 189, 26 按键码查询网页 - 216, 26 + 189, 26 转义查询网页 - 174, 26 + 189, 26 English/中文 + + 51, 24 + + + 关于 + + + 0, 0 + + + 632, 28 + + + 12 + + + menuStrip1 + + + menuStrip1 + + + System.Windows.Forms.MenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 7 + 12, 105 @@ -1652,12 +1664,6 @@ msgbox "234" 8 - - 234, 26 - - - 按键码实时显示 - True @@ -1683,7 +1689,7 @@ msgbox "234" $this - 1 + 2 True @@ -1710,7 +1716,7 @@ msgbox "234" $this - 0 + 1 True @@ -2955,6 +2961,12 @@ msgbox "234" System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 按键码实时显示ToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + 高级设置ToolStripMenuItem @@ -3027,10 +3039,10 @@ msgbox "234" System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 按键码实时显示ToolStripMenuItem + + 切换字典ToolStripMenuItem - + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 diff --git a/QuickInput/IniManager.cs b/QuickInput/IniManager.cs index e410528..9b8c734 100644 --- a/QuickInput/IniManager.cs +++ b/QuickInput/IniManager.cs @@ -1,11 +1,12 @@ using System.Runtime.InteropServices; using System.Text; using System.Collections.Generic; +using System; namespace QuickInput { - class IniManager + static class IniManager { /// /// 为INI文件中指定的节点取得字符串 @@ -19,6 +20,9 @@ class IniManager /// 复制到lpReturnedString缓冲区的字节数量,其中不包括那些NULL中止字符 [DllImport("kernel32")] private static extern int GetPrivateProfileString(string lpAppName, string lpKeyName, string lpDefault, StringBuilder lpReturnedString, int nSize, string lpFileName); + [DllImport("kernel32", EntryPoint = "GetPrivateProfileString")] + private static extern uint GetPrivateProfileStringA(string section, string key, string def, Byte[] retVal, int size, string filePath); + /// /// 修改INI文件中内容 @@ -30,11 +34,24 @@ class IniManager /// 非零表示成功,零表示失败 [DllImport("kernel32")] private static extern int WritePrivateProfileString(string lpApplicationName, string lpKeyName, string lpString, string lpFileName); + + /// + /// 获取所有节点名称 + /// + /// 存放节点名称的内存地址,每个节点之间用\0分隔 + /// 内存大小(characters) + /// + /// + [DllImport("kernel32", CharSet = CharSet.Auto)] + private static extern uint GetPrivateProfileSectionNames(IntPtr lpszReturnBuffer, uint nSize, string filePath); + public static int valuesNum = 255; public static Form1 form1 = null; public static string iniPath = ""; + public static string wordName = "words"; //public static string[] values = new string[valuesNum]; public static Dictionary valuesDic = new Dictionary(); + public static Dictionary specialDic = new Dictionary(); /// /// 初始化,绑定 @@ -95,12 +112,19 @@ public static void CheckPath(string filePath = "") { filePath = iniPath; } - + //List keys = IniManager.ReadKeys(wordName); if (!System.IO.File.Exists(filePath)) { System.IO.File.Create(filePath).Dispose();//创建INI文件,并释放 - writeWordsHelp(filePath); + } + + writeWordsHelp(filePath); + writeSpecialWordsHelp(filePath); + //if (!keys.Contains("使用说明")) + //{ + // WriteHelp(filePath); + //} WriteHelp(filePath); } @@ -110,32 +134,99 @@ private static void writeWordsHelp(string filePath = "") { filePath = iniPath; } - if (Read("words", "65", "", filePath).Equals("")) + + List keys = ReadKeys(wordName); + + if (!keys.Contains("65")) { - WritePrivateProfileString("words", "65", "空格 加 a以输入这行数据,需要关闭中文输入法。65-81对应a-z", filePath); + WritePrivateProfileString(wordName, "65", "空格 加 a以输入这行数据,需要关闭中文输入法。65-81对应a-z", filePath); } - if (Read("words", "66", "", filePath).Equals("")) + if (!keys.Contains("66")) { - WritePrivateProfileString("words", "66", "空格 加 b以输入这行数据,需要关闭中文输入法。{ENTER}表示换行,{+}、{^}、{%}等符号有特殊含义,可以看底部链接说明。", filePath); + WritePrivateProfileString(wordName, "66", "空格 加 b以输入这行数据,需要关闭中文输入法。{ENTER}表示换行,{+}、{^}、{%}等符号有特殊含义,可以看底部链接说明。", filePath); } - } - - public static void WriteHelp(string filePath = "") + } + private static void writeSpecialWordsHelp(string filePath = "") { if (filePath.Equals("")) { filePath = iniPath; } - if (Read("words", "65", "", filePath).Equals("")) + List keys = ReadSections(filePath); + + if (!keys.Contains("DIY")) { - WritePrivateProfileString("words", "65", "", filePath); + //49,50,51 = QuickInput:show + //49,50,52 = QuickInput:hide + //49,50,53 = QuickInput:set + //49,50,54 = QuickInput:changeWords + WritePrivateProfileString("DIY", "49,50,51", "QuickInput:show", filePath); + WritePrivateProfileString("DIY", "49,50,52", "QuickInput:hide", filePath); + WritePrivateProfileString("DIY", "49,50,53", "QuickInput:set", filePath); + WritePrivateProfileString("DIY", "49,50,54", "QuickInput:changeWords", filePath); + //WritePrivateProfileString("DIY", "49,50,51", "QuickInput:show", filePath); } - if (Read("words", "66", "", filePath).Equals("")) + + + } + + + /// + /// 获取指定ini文件中所有节点名称 + /// + /// + /// + public static List ReadSections(string iniFilename) + { + List result = new List(); + Byte[] buf = new Byte[65536]; + uint len = GetPrivateProfileStringA(null, null, null, buf, buf.Length, iniFilename); + int j = 0; + for (int i = 0; i < len; i++) + if (buf[i] == 0) + { + result.Add(Encoding.Default.GetString(buf, j, i - j)); + j = i + 1; + } + return result; + } + + public static List ReadKeys(String SectionName) + { + return ReadKeys(SectionName, iniPath); + } + + public static List ReadKeys(string SectionName, string iniFilename) + { + List result = new List(); + Byte[] buf = new Byte[65536]; + uint len = GetPrivateProfileStringA(SectionName, null, null, buf, buf.Length, iniFilename); + int j = 0; + for (int i = 0; i < len; i++) + if (buf[i] == 0) + { + result.Add(Encoding.Default.GetString(buf, j, i - j)); + j = i + 1; + } + return result; + } + public static void SetFilePath(String filepath) + { + iniPath = filepath; + } + + public static void WriteHelp(string filePath = "") + { + + + if (filePath.Equals("")) { - WritePrivateProfileString("words", "66", "", filePath); + filePath = iniPath; } + //string[] sections = IniManager.ReadIniAllSectionName(filePath); + WritePrivateProfileString("使用说明", "设置编队", "你可以在这个文件里设置编队,请设置在[words]章节里,格式:按键码=编队内容。", filePath); WritePrivateProfileString("使用说明", "特殊字符", "功能键和一些特殊字符需要输入转义版本,例如{ENTER}表示换行。更多转义你可以查看下面的链接。", filePath); @@ -187,22 +278,63 @@ public static Dictionary readIni(bool withoutNumber = false) { CheckPath(iniPath); - for (int i = 0; i < valuesNum; i++) + valuesDic.Clear(); + + List keys = IniManager.ReadKeys(wordName); + + foreach (var key in keys) { + int i; + try + { + i = int.Parse(key); + } + catch (Exception) + { + continue;//不是数字就跳过 + } if (withoutNumber) { if (i >= 48 && i <= 57) continue; } - //values[i] = IniManager.Read("words", "" + i, "", iniPath); - valuesDic[i] = IniManager.Read("words", "" + i, "", iniPath); + //values[i] = IniManager.Read(wordName, "" + i, "", iniPath); + string tmp = IniManager.Read(wordName, "" + i, "", iniPath); + if (!tmp.Equals("")) + { + valuesDic[i] = tmp; + } + } - - - return valuesDic; } + + /// + /// 读取Ini文件 自定义按键部分 + /// + /// 是否不读取数字 + /// 返回valuesdic字典 + public static Dictionary readSpecialIni() + { + CheckPath(iniPath); + + specialDic.Clear(); + List keys = IniManager.ReadKeys("DIY"); + + foreach (var key in keys) + { + //values[i] = IniManager.Read(wordName, "" + i, "", iniPath); + string tmp = IniManager.Read("DIY", key, "", iniPath); + if (!tmp.Equals("")) + { + specialDic[key] = tmp; + } + } + + + return specialDic; + } /// /// 本地化设置文件 /// @@ -210,7 +342,7 @@ public static Dictionary readIni(bool withoutNumber = false) /// //public static void writeIni(string[] values, bool onlyNumber = false) //{ - + // if (onlyNumber) // { // //只保存0-9 @@ -218,7 +350,7 @@ public static Dictionary readIni(bool withoutNumber = false) // { // if (!values[i].Equals("")) // { - // IniManager.Write("words", i.ToString(), values[i], iniPath); + // IniManager.Write(wordName, i.ToString(), values[i], iniPath); // } // } // } @@ -231,7 +363,7 @@ public static Dictionary readIni(bool withoutNumber = false) // int i = iv.Key; // if (!values[i].Equals("")) // { - // IniManager.Write("words", i.ToString(), values[i], iniPath); + // IniManager.Write(wordName, i.ToString(), values[i], iniPath); // } // } @@ -242,9 +374,12 @@ public static Dictionary readIni(bool withoutNumber = false) // } //} - public static void writeIni(Dictionary valuesDic, bool onlyNumber = false) + public static void writeIni(Dictionary valuesDic = null , bool onlyNumber = false) { - + if (valuesDic==null) + { + valuesDic = IniManager.valuesDic; + } if (onlyNumber) { //只保存0-9 @@ -252,7 +387,7 @@ public static void writeIni(Dictionary valuesDic, bool onlyNumber = { if (valuesDic.ContainsKey(i)) { - IniManager.Write("words", i.ToString(), valuesDic[i], iniPath); + IniManager.Write(wordName, i.ToString(), valuesDic[i], iniPath); } } } @@ -265,7 +400,7 @@ public static void writeIni(Dictionary valuesDic, bool onlyNumber = int i = iv.Key; if (valuesDic.ContainsKey(i)) { - IniManager.Write("words", i.ToString(), valuesDic[i], iniPath); + IniManager.Write(wordName, i.ToString(), valuesDic[i], iniPath); } } } diff --git a/QuickInput/InputBox.cs b/QuickInput/InputBox.cs index 383ae0f..86a818b 100644 --- a/QuickInput/InputBox.cs +++ b/QuickInput/InputBox.cs @@ -140,7 +140,7 @@ private void InitializeComponent() this.ResumeLayout(false); - + this.TopMost = true; } diff --git a/QuickInput/InputBox.resx b/QuickInput/InputBox.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/QuickInput/InputBox.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/QuickInput/QuickInput.csproj b/QuickInput/QuickInput.csproj index f7d2dbc..2a8b7cb 100644 --- a/QuickInput/QuickInput.csproj +++ b/QuickInput/QuickInput.csproj @@ -77,6 +77,9 @@ Form1.cs + + InputBox.cs + ResXFileCodeGenerator Resources.Designer.cs @@ -103,9 +106,6 @@ - - - diff --git a/README.md b/README.md index 4d16e24..ebe6773 100644 --- a/README.md +++ b/README.md @@ -6,18 +6,17 @@ An app to accelerate keyboard input in Windows. 磬úԺ԰ո+qͿڵǰԶQQ䣻tabл룻ո+pͿڵǰԶ롣뷽Դûʱ䡣 ĿWindowsûʱ䣬ͼĴ˼·ǼԵĿݼ****˼롣 -## صַ -https://github.com/alittelboy/QuickInput/releases/download/1.6/QuickInput.exe - - -# 1.6 汾 - - ܣ-ñݡһô壬Կӻñݡ - - ޸ͼ꣺ʦ޸ͼ꣬ںиǿԡ - - ޸ĹܣĿ¼ˡʵʱʾťĬϴڴ״̬ôϣ鿴ʵʱİ롣 - - ܣļĿ¼ػ޸ļλã򿪡Ϊ´δĬϻǸλá - - ܣݼػڿݼĬϿո񣩵޸ģģʽѾػ´δҲڡ - - ܣʱñػڼʱʱ޸ģģʽѾػ´δҲڡ - +## 1.7汾 صַ +https://github.com/alittelboy/QuickInput/releases/download/1.7/QuickInput.exe + +## 1.7 汾 2021.7.5 + - ĬϿݼ + - ּ123һ𰴣ʾ + - ּ124һ𰴣ش + - ּ125һ𰴣 + - ּ126һ𰴣ֵ + - ¹ܣֵл + - ¹ܣԶϼ # ʹ÷ @@ -39,9 +38,11 @@ Ctrl + Shift + ԭCtrl CȻӵ**** # ÷ +## 0 +-ñݡҼ- ## 1 --ñݡҼ- +ס123ɴ ## 2 ʹÿݼ޸****Զ浽Ӧļ @@ -75,14 +76,49 @@ Ctrl + Shift + ```ini 65=https://www.baidu.com/ ``` --ָΪͷQuickInputRun:ñӼִָ磺 +- ָΪͷQuickInputRun:ñӼִָ磺 ```ini 65=QuickInputRun:cmd +``` + - ¼ + - ΪQuickInput:showñӼôʾ + - ΪQuickInput:hideñӼô岻ʾ + - ΪQuickInput:setñӼá + - ΪQuickInput:changeWordsñӼ򿪿лֵ䡣 + - Զϼ.ļDIYԶϼԶŸע⣬ Զϼ˸backspaceģĬϵ4ݼ +```ini +[DIY] +49,50,51=QuickInput:show +49,50,52=QuickInput:hide +49,50,53=QuickInput:set +49,50,54=QuickInput:changeWords ``` # ¹ -## 1.6 汾 +## 1.7 汾 2021.7.5 + - ĬϿݼ + - ּ123һ𰴣ʾ + - ּ124һ𰴣ش + - ּ125һ𰴣 + - ּ126һ𰴣ֵ + - ¹ܣֵ䡣ĬϵֵǡwordsļӦ[words]ڸ߼лֵ䣬лĿݼҲлļ䣬ϵֵ䱣 + - ܣָ + - ΪQuickInput:showñӼôʾ + - ΪQuickInput:hideñӼô岻ʾ + - ΪQuickInput:setñӼá + - ΪQuickInput:changeWordsñӼ򿪿лֵ䡣 + - ¹ܣԶϼļDIYԶϼԶŸע⣬Զϼ˸backspace磺 +```ini + [DIY] + 49,50,51=QuickInput:show + 49,50,52=QuickInput:hide + 49,50,55=C:\ +``` + ñʾּ123һ𰴽ʾ壬ּ124һ𰴽ش塣ּ127һ𰴻C̡ + - ڲ򿪶ôˡ + +## 1.6 汾 2021.6.15 - ܣ-ñݡһô壬Կӻñݡ - ޸ͼ꣺ʦ޸ͼ꣬ںиǿԡ - ޸ĹܣĿ¼ˡʵʱʾťĬϴڴ״̬ôϣ鿴ʵʱİ롣