From: <an...@us...> - 2007-07-16 06:32:25
|
Revision: 693 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=693&view=rev Author: and-81 Date: 2007-07-15 23:32:23 -0700 (Sun, 15 Jul 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.Designer.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.resx trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/DeviceSelect.cs trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/NativeMethods.cs trunk/plugins/IR Server Suite/IR Server Suite.sln Added Paths: ----------- trunk/plugins/IR Server Suite/IR Server Plugins/MCE Replacement Transceiver v2/ trunk/plugins/IR Server Suite/IR Server Plugins/MCE Replacement Transceiver v2/Configure.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/MCE Replacement Transceiver v2/Configure.cs trunk/plugins/IR Server Suite/IR Server Plugins/MCE Replacement Transceiver v2/Configure.resx trunk/plugins/IR Server Suite/IR Server Plugins/MCE Replacement Transceiver v2/MCE Replacement Transceiver v2.csproj trunk/plugins/IR Server Suite/IR Server Plugins/MCE Replacement Transceiver v2/MceIrApi.cs trunk/plugins/IR Server Suite/IR Server Plugins/MCE Replacement Transceiver v2/MceReplacementTransceiverV2.cs trunk/plugins/IR Server Suite/IR Server Plugins/MCE Replacement Transceiver v2/Properties/ trunk/plugins/IR Server Suite/IR Server Plugins/MCE Replacement Transceiver v2/Properties/AssemblyInfo.cs Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.Designer.cs 2007-07-15 16:20:48 UTC (rev 692) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.Designer.cs 2007-07-16 06:32:23 UTC (rev 693) @@ -98,6 +98,58 @@ this.buttonKeyHelp = new System.Windows.Forms.Button(); this.labelKeystrokes = new System.Windows.Forms.Label(); this.textBoxKeys = new System.Windows.Forms.TextBox(); + this.contextMenuStripKeystrokes = new System.Windows.Forms.ContextMenuStrip(this.components); + this.cutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.copyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.pasteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); + this.selectAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.selectNoneToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); + this.specialKeyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.arrowsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.upToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.downToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.leftToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.rightToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.functionKeysToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.f1ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.f2ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.f3ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.f4ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.f5ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.f6ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.f7ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.f8ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.f9ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.f10ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.f11ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.f12ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.f13ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.f14ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.f15ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.f16ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.keypadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.addToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.subtractToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.multiplyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.divideToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); + this.backspaceToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.breakToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.capsLockToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.delToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.endToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.enterToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.escapeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.homeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.insToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.numLockToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.pageDownToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.pageUpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.scrollLockToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.tabToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.tabPageMouse = new System.Windows.Forms.TabPage(); this.groupBoxMouseScroll = new System.Windows.Forms.GroupBox(); this.checkBoxMouseScrollDown = new System.Windows.Forms.CheckBox(); @@ -117,6 +169,10 @@ this.buttonCancel = new System.Windows.Forms.Button(); this.buttonOK = new System.Windows.Forms.Button(); this.toolTips = new System.Windows.Forms.ToolTip(this.components); + this.modifiersToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.altToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.controlToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.shiftToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.groupBoxButton.SuspendLayout(); this.groupBoxSet.SuspendLayout(); this.tabControl.SuspendLayout(); @@ -134,6 +190,7 @@ ((System.ComponentModel.ISupportInitialize)(this.numericUpDownWParam)).BeginInit(); this.groupBoxMessageTarget.SuspendLayout(); this.tabPageKeystrokes.SuspendLayout(); + this.contextMenuStripKeystrokes.SuspendLayout(); this.tabPageMouse.SuspendLayout(); this.groupBoxMouseScroll.SuspendLayout(); this.groupBoxMouseClick.SuspendLayout(); @@ -186,6 +243,7 @@ this.textBoxKeyCode.TabIndex = 1; this.textBoxKeyCode.TabStop = false; this.textBoxKeyCode.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.toolTips.SetToolTip(this.textBoxKeyCode, "This button\'s unique IR code"); // // textBoxButtonDesc // @@ -195,6 +253,7 @@ this.textBoxButtonDesc.Name = "textBoxButtonDesc"; this.textBoxButtonDesc.Size = new System.Drawing.Size(360, 20); this.textBoxButtonDesc.TabIndex = 3; + this.toolTips.SetToolTip(this.textBoxButtonDesc, "Provide a description of this button here"); this.textBoxButtonDesc.TextChanged += new System.EventHandler(this.textBoxButtonDesc_TextChanged); // // groupBoxSet @@ -297,6 +356,7 @@ this.buttonLearnIR.Size = new System.Drawing.Size(64, 24); this.buttonLearnIR.TabIndex = 6; this.buttonLearnIR.Text = "Learn"; + this.toolTips.SetToolTip(this.buttonLearnIR, "Click here to add a new IR Command to the list"); this.buttonLearnIR.UseVisualStyleBackColor = true; this.buttonLearnIR.Click += new System.EventHandler(this.buttonLearnIR_Click); // @@ -359,6 +419,7 @@ this.buttonNewMacro.Size = new System.Drawing.Size(64, 24); this.buttonNewMacro.TabIndex = 2; this.buttonNewMacro.Text = "New"; + this.toolTips.SetToolTip(this.buttonNewMacro, "Click here to create a new Macro"); this.buttonNewMacro.UseVisualStyleBackColor = true; this.buttonNewMacro.Click += new System.EventHandler(this.buttonNewMacro_Click); // @@ -479,6 +540,7 @@ this.buttonStartupFolder.Size = new System.Drawing.Size(24, 20); this.buttonStartupFolder.TabIndex = 5; this.buttonStartupFolder.Text = "..."; + this.toolTips.SetToolTip(this.buttonStartupFolder, "Click here to locate the working folder for the application"); this.buttonStartupFolder.UseVisualStyleBackColor = true; this.buttonStartupFolder.Click += new System.EventHandler(this.buttonStartupFolder_Click); // @@ -508,6 +570,7 @@ this.buttonLocate.Size = new System.Drawing.Size(24, 20); this.buttonLocate.TabIndex = 2; this.buttonLocate.Text = "..."; + this.toolTips.SetToolTip(this.buttonLocate, "Click here to locate the application to run"); this.buttonLocate.UseVisualStyleBackColor = true; this.buttonLocate.Click += new System.EventHandler(this.buttonLocate_Click); // @@ -682,6 +745,7 @@ this.buttonParamQuestion.Size = new System.Drawing.Size(24, 20); this.buttonParamQuestion.TabIndex = 2; this.buttonParamQuestion.Text = "?"; + this.toolTips.SetToolTip(this.buttonParamQuestion, "Click here for command parameters"); this.buttonParamQuestion.UseVisualStyleBackColor = true; this.buttonParamQuestion.Click += new System.EventHandler(this.buttonParamQuestion_Click); // @@ -844,6 +908,7 @@ this.buttonFindMsgTarget.Size = new System.Drawing.Size(24, 20); this.buttonFindMsgTarget.TabIndex = 5; this.buttonFindMsgTarget.Text = "..."; + this.toolTips.SetToolTip(this.buttonFindMsgTarget, "Click here to locate the target for this Window Message"); this.buttonFindMsgTarget.UseVisualStyleBackColor = true; this.buttonFindMsgTarget.Click += new System.EventHandler(this.buttonFindMsgTarget_Click); // @@ -901,6 +966,7 @@ this.buttonKeyHelp.Size = new System.Drawing.Size(64, 24); this.buttonKeyHelp.TabIndex = 2; this.buttonKeyHelp.Text = "Help"; + this.toolTips.SetToolTip(this.buttonKeyHelp, "Click here for help on keystroke commands"); this.buttonKeyHelp.UseVisualStyleBackColor = true; this.buttonKeyHelp.Click += new System.EventHandler(this.buttonKeyHelp_Click); // @@ -920,13 +986,424 @@ this.textBoxKeys.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); + this.textBoxKeys.ContextMenuStrip = this.contextMenuStripKeystrokes; this.textBoxKeys.Location = new System.Drawing.Point(8, 24); this.textBoxKeys.Multiline = true; this.textBoxKeys.Name = "textBoxKeys"; this.textBoxKeys.ScrollBars = System.Windows.Forms.ScrollBars.Both; + this.textBoxKeys.ShortcutsEnabled = false; this.textBoxKeys.Size = new System.Drawing.Size(416, 144); this.textBoxKeys.TabIndex = 1; // + // contextMenuStripKeystrokes + // + this.contextMenuStripKeystrokes.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.cutToolStripMenuItem, + this.copyToolStripMenuItem, + this.pasteToolStripMenuItem, + this.toolStripSeparator1, + this.selectAllToolStripMenuItem, + this.selectNoneToolStripMenuItem, + this.toolStripSeparator2, + this.specialKeyToolStripMenuItem}); + this.contextMenuStripKeystrokes.Name = "contextMenuStripKeystrokes"; + this.contextMenuStripKeystrokes.Size = new System.Drawing.Size(155, 170); + // + // cutToolStripMenuItem + // + this.cutToolStripMenuItem.Name = "cutToolStripMenuItem"; + this.cutToolStripMenuItem.Size = new System.Drawing.Size(154, 22); + this.cutToolStripMenuItem.Text = "Cut"; + this.cutToolStripMenuItem.Click += new System.EventHandler(this.cutToolStripMenuItem_Click); + // + // copyToolStripMenuItem + // + this.copyToolStripMenuItem.Name = "copyToolStripMenuItem"; + this.copyToolStripMenuItem.Size = new System.Drawing.Size(154, 22); + this.copyToolStripMenuItem.Text = "Copy"; + this.copyToolStripMenuItem.Click += new System.EventHandler(this.copyToolStripMenuItem_Click); + // + // pasteToolStripMenuItem + // + this.pasteToolStripMenuItem.Name = "pasteToolStripMenuItem"; + this.pasteToolStripMenuItem.Size = new System.Drawing.Size(154, 22); + this.pasteToolStripMenuItem.Text = "Paste"; + this.pasteToolStripMenuItem.Click += new System.EventHandler(this.pasteToolStripMenuItem_Click); + // + // toolStripSeparator1 + // + this.toolStripSeparator1.Name = "toolStripSeparator1"; + this.toolStripSeparator1.Size = new System.Drawing.Size(151, 6); + // + // selectAllToolStripMenuItem + // + this.selectAllToolStripMenuItem.Name = "selectAllToolStripMenuItem"; + this.selectAllToolStripMenuItem.Size = new System.Drawing.Size(154, 22); + this.selectAllToolStripMenuItem.Text = "Select All"; + this.selectAllToolStripMenuItem.Click += new System.EventHandler(this.selectAllToolStripMenuItem_Click); + // + // selectNoneToolStripMenuItem + // + this.selectNoneToolStripMenuItem.Name = "selectNoneToolStripMenuItem"; + this.selectNoneToolStripMenuItem.Size = new System.Drawing.Size(154, 22); + this.selectNoneToolStripMenuItem.Text = "Select None"; + this.selectNoneToolStripMenuItem.Click += new System.EventHandler(this.selectNoneToolStripMenuItem_Click); + // + // toolStripSeparator2 + // + this.toolStripSeparator2.Name = "toolStripSeparator2"; + this.toolStripSeparator2.Size = new System.Drawing.Size(151, 6); + // + // specialKeyToolStripMenuItem + // + this.specialKeyToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.arrowsToolStripMenuItem, + this.functionKeysToolStripMenuItem, + this.keypadToolStripMenuItem, + this.modifiersToolStripMenuItem, + this.toolStripSeparator3, + this.backspaceToolStripMenuItem, + this.breakToolStripMenuItem, + this.capsLockToolStripMenuItem, + this.delToolStripMenuItem, + this.endToolStripMenuItem, + this.enterToolStripMenuItem, + this.escapeToolStripMenuItem, + this.helpToolStripMenuItem, + this.homeToolStripMenuItem, + this.insToolStripMenuItem, + this.numLockToolStripMenuItem, + this.pageDownToolStripMenuItem, + this.pageUpToolStripMenuItem, + this.scrollLockToolStripMenuItem, + this.tabToolStripMenuItem}); + this.specialKeyToolStripMenuItem.Name = "specialKeyToolStripMenuItem"; + this.specialKeyToolStripMenuItem.Size = new System.Drawing.Size(154, 22); + this.specialKeyToolStripMenuItem.Text = "Special Key ..."; + // + // arrowsToolStripMenuItem + // + this.arrowsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.upToolStripMenuItem, + this.downToolStripMenuItem, + this.leftToolStripMenuItem, + this.rightToolStripMenuItem}); + this.arrowsToolStripMenuItem.Name = "arrowsToolStripMenuItem"; + this.arrowsToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.arrowsToolStripMenuItem.Text = "Arrows"; + // + // upToolStripMenuItem + // + this.upToolStripMenuItem.Name = "upToolStripMenuItem"; + this.upToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.upToolStripMenuItem.Text = "Up"; + this.upToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); + // + // downToolStripMenuItem + // + this.downToolStripMenuItem.Name = "downToolStripMenuItem"; + this.downToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.downToolStripMenuItem.Text = "Down"; + this.downToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); + // + // leftToolStripMenuItem + // + this.leftToolStripMenuItem.Name = "leftToolStripMenuItem"; + this.leftToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.leftToolStripMenuItem.Text = "Left"; + this.leftToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); + // + // rightToolStripMenuItem + // + this.rightToolStripMenuItem.Name = "rightToolStripMenuItem"; + this.rightToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.rightToolStripMenuItem.Text = "Right"; + this.rightToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); + // + // functionKeysToolStripMenuItem + // + this.functionKeysToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.f1ToolStripMenuItem, + this.f2ToolStripMenuItem, + this.f3ToolStripMenuItem, + this.f4ToolStripMenuItem, + this.f5ToolStripMenuItem, + this.f6ToolStripMenuItem, + this.f7ToolStripMenuItem, + this.f8ToolStripMenuItem, + this.f9ToolStripMenuItem, + this.f10ToolStripMenuItem, + this.f11ToolStripMenuItem, + this.f12ToolStripMenuItem, + this.f13ToolStripMenuItem, + this.f14ToolStripMenuItem, + this.f15ToolStripMenuItem, + this.f16ToolStripMenuItem}); + this.functionKeysToolStripMenuItem.Name = "functionKeysToolStripMenuItem"; + this.functionKeysToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.functionKeysToolStripMenuItem.Text = "Function Keys"; + // + // f1ToolStripMenuItem + // + this.f1ToolStripMenuItem.Name = "f1ToolStripMenuItem"; + this.f1ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.f1ToolStripMenuItem.Text = "F1"; + this.f1ToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); + // + // f2ToolStripMenuItem + // + this.f2ToolStripMenuItem.Name = "f2ToolStripMenuItem"; + this.f2ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.f2ToolStripMenuItem.Text = "F2"; + this.f2ToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); + // + // f3ToolStripMenuItem + // + this.f3ToolStripMenuItem.Name = "f3ToolStripMenuItem"; + this.f3ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.f3ToolStripMenuItem.Text = "F3"; + this.f3ToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); + // + // f4ToolStripMenuItem + // + this.f4ToolStripMenuItem.Name = "f4ToolStripMenuItem"; + this.f4ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.f4ToolStripMenuItem.Text = "F4"; + this.f4ToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); + // + // f5ToolStripMenuItem + // + this.f5ToolStripMenuItem.Name = "f5ToolStripMenuItem"; + this.f5ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.f5ToolStripMenuItem.Text = "F5"; + this.f5ToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); + // + // f6ToolStripMenuItem + // + this.f6ToolStripMenuItem.Name = "f6ToolStripMenuItem"; + this.f6ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.f6ToolStripMenuItem.Text = "F6"; + this.f6ToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); + // + // f7ToolStripMenuItem + // + this.f7ToolStripMenuItem.Name = "f7ToolStripMenuItem"; + this.f7ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.f7ToolStripMenuItem.Text = "F7"; + this.f7ToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); + // + // f8ToolStripMenuItem + // + this.f8ToolStripMenuItem.Name = "f8ToolStripMenuItem"; + this.f8ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.f8ToolStripMenuItem.Text = "F8"; + this.f8ToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); + // + // f9ToolStripMenuItem + // + this.f9ToolStripMenuItem.Name = "f9ToolStripMenuItem"; + this.f9ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.f9ToolStripMenuItem.Text = "F9"; + this.f9ToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); + // + // f10ToolStripMenuItem + // + this.f10ToolStripMenuItem.Name = "f10ToolStripMenuItem"; + this.f10ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.f10ToolStripMenuItem.Text = "F10"; + this.f10ToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); + // + // f11ToolStripMenuItem + // + this.f11ToolStripMenuItem.Name = "f11ToolStripMenuItem"; + this.f11ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.f11ToolStripMenuItem.Text = "F11"; + this.f11ToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); + // + // f12ToolStripMenuItem + // + this.f12ToolStripMenuItem.Name = "f12ToolStripMenuItem"; + this.f12ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.f12ToolStripMenuItem.Text = "F12"; + this.f12ToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); + // + // f13ToolStripMenuItem + // + this.f13ToolStripMenuItem.Name = "f13ToolStripMenuItem"; + this.f13ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.f13ToolStripMenuItem.Text = "F13"; + this.f13ToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); + // + // f14ToolStripMenuItem + // + this.f14ToolStripMenuItem.Name = "f14ToolStripMenuItem"; + this.f14ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.f14ToolStripMenuItem.Text = "F14"; + this.f14ToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); + // + // f15ToolStripMenuItem + // + this.f15ToolStripMenuItem.Name = "f15ToolStripMenuItem"; + this.f15ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.f15ToolStripMenuItem.Text = "F15"; + this.f15ToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); + // + // f16ToolStripMenuItem + // + this.f16ToolStripMenuItem.Name = "f16ToolStripMenuItem"; + this.f16ToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.f16ToolStripMenuItem.Text = "F16"; + this.f16ToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); + // + // keypadToolStripMenuItem + // + this.keypadToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.addToolStripMenuItem, + this.subtractToolStripMenuItem, + this.multiplyToolStripMenuItem, + this.divideToolStripMenuItem}); + this.keypadToolStripMenuItem.Name = "keypadToolStripMenuItem"; + this.keypadToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.keypadToolStripMenuItem.Text = "Keypad"; + // + // addToolStripMenuItem + // + this.addToolStripMenuItem.Name = "addToolStripMenuItem"; + this.addToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.addToolStripMenuItem.Text = "Add"; + this.addToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); + // + // subtractToolStripMenuItem + // + this.subtractToolStripMenuItem.Name = "subtractToolStripMenuItem"; + this.subtractToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.subtractToolStripMenuItem.Text = "Subtract"; + this.subtractToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); + // + // multiplyToolStripMenuItem + // + this.multiplyToolStripMenuItem.Name = "multiplyToolStripMenuItem"; + this.multiplyToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.multiplyToolStripMenuItem.Text = "Multiply"; + this.multiplyToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); + // + // divideToolStripMenuItem + // + this.divideToolStripMenuItem.Name = "divideToolStripMenuItem"; + this.divideToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.divideToolStripMenuItem.Text = "Divide"; + this.divideToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); + // + // toolStripSeparator3 + // + this.toolStripSeparator3.Name = "toolStripSeparator3"; + this.toolStripSeparator3.Size = new System.Drawing.Size(149, 6); + // + // backspaceToolStripMenuItem + // + this.backspaceToolStripMenuItem.Name = "backspaceToolStripMenuItem"; + this.backspaceToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.backspaceToolStripMenuItem.Text = "Backspace"; + this.backspaceToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); + // + // breakToolStripMenuItem + // + this.breakToolStripMenuItem.Name = "breakToolStripMenuItem"; + this.breakToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.breakToolStripMenuItem.Text = "Break"; + this.breakToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); + // + // capsLockToolStripMenuItem + // + this.capsLockToolStripMenuItem.Name = "capsLockToolStripMenuItem"; + this.capsLockToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.capsLockToolStripMenuItem.Text = "Caps Lock"; + this.capsLockToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); + // + // delToolStripMenuItem + // + this.delToolStripMenuItem.Name = "delToolStripMenuItem"; + this.delToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.delToolStripMenuItem.Text = "Delete"; + this.delToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); + // + // endToolStripMenuItem + // + this.endToolStripMenuItem.Name = "endToolStripMenuItem"; + this.endToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.endToolStripMenuItem.Text = "End"; + this.endToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); + // + // enterToolStripMenuItem + // + this.enterToolStripMenuItem.Name = "enterToolStripMenuItem"; + this.enterToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.enterToolStripMenuItem.Text = "Enter"; + this.enterToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); + // + // escapeToolStripMenuItem + // + this.escapeToolStripMenuItem.Name = "escapeToolStripMenuItem"; + this.escapeToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.escapeToolStripMenuItem.Text = "Escape"; + this.escapeToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); + // + // helpToolStripMenuItem + // + this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; + this.helpToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.helpToolStripMenuItem.Text = "Help"; + this.helpToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); + // + // homeToolStripMenuItem + // + this.homeToolStripMenuItem.Name = "homeToolStripMenuItem"; + this.homeToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.homeToolStripMenuItem.Text = "Home"; + this.homeToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); + // + // insToolStripMenuItem + // + this.insToolStripMenuItem.Name = "insToolStripMenuItem"; + this.insToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.insToolStripMenuItem.Text = "Insert"; + this.insToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); + // + // numLockToolStripMenuItem + // + this.numLockToolStripMenuItem.Name = "numLockToolStripMenuItem"; + this.numLockToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.numLockToolStripMenuItem.Text = "Num Lock"; + this.numLockToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); + // + // pageDownToolStripMenuItem + // + this.pageDownToolStripMenuItem.Name = "pageDownToolStripMenuItem"; + this.pageDownToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.pageDownToolStripMenuItem.Text = "Page Down"; + this.pageDownToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); + // + // pageUpToolStripMenuItem + // + this.pageUpToolStripMenuItem.Name = "pageUpToolStripMenuItem"; + this.pageUpToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.pageUpToolStripMenuItem.Text = "Page Up"; + this.pageUpToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); + // + // scrollLockToolStripMenuItem + // + this.scrollLockToolStripMenuItem.Name = "scrollLockToolStripMenuItem"; + this.scrollLockToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.scrollLockToolStripMenuItem.Text = "Scroll Lock"; + this.scrollLockToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); + // + // tabToolStripMenuItem + // + this.tabToolStripMenuItem.Name = "tabToolStripMenuItem"; + this.tabToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.tabToolStripMenuItem.Text = "Tab"; + this.tabToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); + // // tabPageMouse // this.tabPageMouse.Controls.Add(this.groupBoxMouseScroll); @@ -1162,6 +1639,37 @@ this.buttonOK.UseVisualStyleBackColor = true; this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); // + // modifiersToolStripMenuItem + // + this.modifiersToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.altToolStripMenuItem, + this.controlToolStripMenuItem, + this.shiftToolStripMenuItem}); + this.modifiersToolStripMenuItem.Name = "modifiersToolStripMenuItem"; + this.modifiersToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.modifiersToolStripMenuItem.Text = "Modifiers"; + // + // altToolStripMenuItem + // + this.altToolStripMenuItem.Name = "altToolStripMenuItem"; + this.altToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.altToolStripMenuItem.Text = "Alt"; + this.altToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); + // + // controlToolStripMenuItem + // + this.controlToolStripMenuItem.Name = "controlToolStripMenuItem"; + this.controlToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.controlToolStripMenuItem.Text = "Control"; + this.controlToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); + // + // shiftToolStripMenuItem + // + this.shiftToolStripMenuItem.Name = "shiftToolStripMenuItem"; + this.shiftToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.shiftToolStripMenuItem.Text = "Shift"; + this.shiftToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); + // // ButtonMappingForm // this.AcceptButton = this.buttonOK; @@ -1204,6 +1712,7 @@ this.groupBoxMessageTarget.PerformLayout(); this.tabPageKeystrokes.ResumeLayout(false); this.tabPageKeystrokes.PerformLayout(); + this.contextMenuStripKeystrokes.ResumeLayout(false); this.tabPageMouse.ResumeLayout(false); this.groupBoxMouseScroll.ResumeLayout(false); this.groupBoxMouseClick.ResumeLayout(false); @@ -1302,6 +1811,62 @@ private System.Windows.Forms.CheckBox checkBoxMouseMoveDown; private System.Windows.Forms.CheckBox checkBoxMouseMoveRight; private System.Windows.Forms.ToolTip toolTips; + private System.Windows.Forms.ContextMenuStrip contextMenuStripKeystrokes; + private System.Windows.Forms.ToolStripMenuItem cutToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem copyToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem pasteToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; + private System.Windows.Forms.ToolStripMenuItem selectAllToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem selectNoneToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; + private System.Windows.Forms.ToolStripMenuItem specialKeyToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem arrowsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem upToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem downToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem leftToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem rightToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem functionKeysToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem f1ToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem f2ToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem f3ToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem f4ToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator3; + private System.Windows.Forms.ToolStripMenuItem backspaceToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem breakToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem capsLockToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem delToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem endToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem enterToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem escapeToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem f5ToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem f6ToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem f7ToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem f8ToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem f9ToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem f10ToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem f11ToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem f12ToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem f13ToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem f14ToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem f15ToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem f16ToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem keypadToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem addToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem subtractToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem multiplyToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem homeToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem insToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem numLockToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem pageDownToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem pageUpToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem scrollLockToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem tabToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem divideToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem modifiersToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem altToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem controlToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem shiftToolStripMenuItem; } } \ No newline at end of file Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs 2007-07-15 16:20:48 UTC (rev 692) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs 2007-07-16 06:32:23 UTC (rev 693) @@ -79,6 +79,16 @@ } } + void InsertKeystroke(string keystroke) + { + string clipboardWas = Clipboard.GetText(); + + Clipboard.SetText(keystroke); + textBoxKeys.Paste(); + + Clipboard.SetText(clipboardWas); + } + private void ButtonMappingForm_Load(object sender, EventArgs e) { textBoxKeyCode.Text = _keyCode; @@ -505,8 +515,6 @@ _description = textBoxButtonDesc.Text; } - #endregion Controls - private void checkBoxMouse_CheckedChanged(object sender, EventArgs e) { CheckBox origin = (CheckBox)sender; @@ -525,6 +533,88 @@ if (origin != checkBoxMouseScrollDown) checkBoxMouseScrollDown.Checked = false; } + private void KeystrokeToolStripMenuItem_Click(object sender, EventArgs e) + { + ToolStripMenuItem origin = sender as ToolStripMenuItem; + + if (origin == null) + return; + + switch (origin.Name) + { + case "upToolStripMenuItem": InsertKeystroke("{UP}"); break; + case "downToolStripMenuItem": InsertKeystroke("{DOWN}"); break; + case "leftToolStripMenuItem": InsertKeystroke("{LEFT}"); break; + case "rightToolStripMenuItem": InsertKeystroke("{RIGHT}"); break; + + case "f1ToolStripMenuItem": InsertKeystroke("{F1}"); break; + case "f2ToolStripMenuItem": InsertKeystroke("{F2}"); break; + case "f3ToolStripMenuItem": InsertKeystroke("{F3}"); break; + case "f4ToolStripMenuItem": InsertKeystroke("{F4}"); break; + case "f5ToolStripMenuItem": InsertKeystroke("{F5}"); break; + case "f6ToolStripMenuItem": InsertKeystroke("{F6}"); break; + case "f7ToolStripMenuItem": InsertKeystroke("{F7}"); break; + case "f8ToolStripMenuItem": InsertKeystroke("{F8}"); break; + case "f9ToolStripMenuItem": InsertKeystroke("{F9}"); break; + case "f10ToolStripMenuItem": InsertKeystroke("{F10}"); break; + case "f11ToolStripMenuItem": InsertKeystroke("{F11}"); break; + case "f12ToolStripMenuItem": InsertKeystroke("{F12}"); break; + case "f13ToolStripMenuItem": InsertKeystroke("{F13}"); break; + case "f14ToolStripMenuItem": InsertKeystroke("{F14}"); break; + case "f15ToolStripMenuItem": InsertKeystroke("{F15}"); break; + case "f16ToolStripMenuItem": InsertKeystroke("{F16}"); break; + + case "addToolStripMenuItem": InsertKeystroke("{ADD}"); break; + case "subtractToolStripMenuItem": InsertKeystroke("{SUBTRACT}"); break; + case "multiplyToolStripMenuItem": InsertKeystroke("{MULTIPLY}"); break; + case "divideToolStripMenuItem": InsertKeystroke("{DIVIDE}"); break; + + case "altToolStripMenuItem": InsertKeystroke("%"); break; + case "controlToolStripMenuItem": InsertKeystroke("^"); break; + case "shiftToolStripMenuItem": InsertKeystroke("+"); break; + + case "backspaceToolStripMenuItem": InsertKeystroke("{BACKSPACE}"); break; + case "breakToolStripMenuItem": InsertKeystroke("{BREAK}"); break; + case "capsLockToolStripMenuItem": InsertKeystroke("{CAPSLOCK}"); break; + case "delToolStripMenuItem": InsertKeystroke("{DEL}"); break; + + case "endToolStripMenuItem": InsertKeystroke("{END}"); break; + case "enterToolStripMenuItem": InsertKeystroke("{ENTER}"); break; + case "escapeToolStripMenuItem": InsertKeystroke("{ESC}"); break; + case "helpToolStripMenuItem": InsertKeystroke("{HELP}"); break; + case "homeToolStripMenuItem": InsertKeystroke("{HOME}"); break; + case "insToolStripMenuItem": InsertKeystroke("{INS}"); break; + case "numLockToolStripMenuItem": InsertKeystroke("{NUMLOCK}"); break; + case "pageDownToolStripMenuItem": InsertKeystroke("{PGDN}"); break; + case "pageUpToolStripMenuItem": InsertKeystroke("{PGUP}"); break; + case "scrollLockToolStripMenuItem": InsertKeystroke("{SCROLLLOCK}"); break; + case "tabToolStripMenuItem": InsertKeystroke("{TAB}"); break; + } + } + + private void cutToolStripMenuItem_Click(object sender, EventArgs e) + { + textBoxKeys.Cut(); + } + private void copyToolStripMenuItem_Click(object sender, EventArgs e) + { + textBoxKeys.Copy(); + } + private void pasteToolStripMenuItem_Click(object sender, EventArgs e) + { + textBoxKeys.Paste(); + } + private void selectAllToolStripMenuItem_Click(object sender, EventArgs e) + { + textBoxKeys.SelectAll(); + } + private void selectNoneToolStripMenuItem_Click(object sender, EventArgs e) + { + textBoxKeys.SelectionLength = 0; + } + + #endregion Controls + } } Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.resx =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.resx 2007-07-15 16:20:48 UTC (rev 692) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.resx 2007-07-16 06:32:23 UTC (rev 693) @@ -120,6 +120,9 @@ <metadata name="toolTips.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>17, 17</value> </metadata> + <metadata name="contextMenuStripKeystrokes.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>107, 17</value> + </metadata> <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/DeviceSelect.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/DeviceSelect.cs 2007-07-15 16:20:48 UTC (rev 692) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/DeviceSelect.cs 2007-07-16 06:32:23 UTC (rev 693) @@ -86,87 +86,83 @@ void FindHIDDevices() { - int lastError; + uint deviceCount = 0; + int dwSize = (Marshal.SizeOf(typeof(NativeMethods.RAWINPUTDEVICELIST))); - // Get the HID Guid - Guid classGuid = new Guid(); - NativeMethods.HidD_GetHidGuid(ref classGuid); - - // 0x12 = DIGCF_PRESENT | DIGCF_DEVICEINTERFACE - IntPtr handle = NativeMethods.SetupDiGetClassDevs(ref classGuid, "", IntPtr.Zero, 0x12); - lastError = Marshal.GetLastWin32Error(); - - if (handle.ToInt32() == -1) - throw new Win32Exception(lastError); - - for (int deviceIndex = 0; ; deviceIndex++) + // Get the number of raw input devices in the list, + // then allocate sufficient memory and get the entire list + if (NativeMethods.GetRawInputDeviceList(IntPtr.Zero, ref deviceCount, (uint)dwSize) == 0) { - NativeMethods.DeviceInfoData deviceInfoData = new NativeMethods.DeviceInfoData(); - deviceInfoData.Size = Marshal.SizeOf(deviceInfoData); + IntPtr pRawInputDeviceList = Marshal.AllocHGlobal((int)(dwSize * deviceCount)); + NativeMethods.GetRawInputDeviceList(pRawInputDeviceList, ref deviceCount, (uint)dwSize); - if (NativeMethods.SetupDiEnumDeviceInfo(handle, deviceIndex, ref deviceInfoData) == false) + // Iterate through the list, discarding undesired items + // and retrieving further information on keyboard devices + for (int i = 0; i < deviceCount; i++) { + string deviceName; + uint pcbSize = 0; - // out of devices or do we have an error? - /* - lastError = Marshal.GetLastWin32Error(); - if (lastError != 0x0103 && lastError != 0x007E) - { - NativeMethods.SetupDiDestroyDeviceInfoList(handle); - throw new Win32Exception(Marshal.GetLastWin32Error()); - } - */ + NativeMethods.RAWINPUTDEVICELIST rid = (NativeMethods.RAWINPUTDEVICELIST)Marshal.PtrToStructure( + new IntPtr((pRawInputDeviceList.ToInt32() + (dwSize * i))), + typeof(NativeMethods.RAWINPUTDEVICELIST)); - NativeMethods.SetupDiDestroyDeviceInfoList(handle); - break; - } + NativeMethods.GetRawInputDeviceInfo(rid.hDevice, NativeMethods.RIDI_DEVICENAME, IntPtr.Zero, ref pcbSize); - NativeMethods.DeviceInterfaceData deviceInterfaceData = new NativeMethods.DeviceInterfaceData(); - deviceInterfaceData.Size = Marshal.SizeOf(deviceInterfaceData); + if (pcbSize > 0) + { + IntPtr pData = Marshal.AllocHGlobal((int)pcbSize); + NativeMethods.GetRawInputDeviceInfo(rid.hDevice, NativeMethods.RIDI_DEVICENAME, pData, ref pcbSize); + deviceName = (string)Marshal.PtrToStringAnsi(pData); - if (NativeMethods.SetupDiEnumDeviceInterfaces(handle, ref deviceInfoData, ref classGuid, 0, ref deviceInterfaceData) == false) - { - NativeMethods.SetupDiDestroyDeviceInfoList(handle); - //throw new Win32Exception(Marshal.GetLastWin32Error()); - continue; - } + // Drop the "root" keyboard and mouse devices used for Terminal + // Services and the Remote Desktop + if (deviceName.ToUpperInvariant().Contains("ROOT")) + continue; - uint cbData = 0; + // Get Detailed Info ... + uint size = (uint)Marshal.SizeOf(typeof(NativeMethods.DeviceInfo)); + NativeMethods.DeviceInfo di = new NativeMethods.DeviceInfo(); + di.Size = Marshal.SizeOf(typeof(NativeMethods.DeviceInfo)); + NativeMethods.GetRawInputDeviceInfo(rid.hDevice, NativeMethods.RIDI_DEVICEINFO, ref di, ref size); - if (NativeMethods.SetupDiGetDeviceInterfaceDetail(handle, ref deviceInterfaceData, IntPtr.Zero, 0, ref cbData, IntPtr.Zero) == false && cbData == 0) - { - NativeMethods.SetupDiDestroyDeviceInfoList(handle); - //throw new Win32Exception(Marshal.GetLastWin32Error()); - continue; - } + di = new NativeMethods.DeviceInfo(); + di.Size = Marshal.SizeOf(typeof(NativeMethods.DeviceInfo)); + NativeMethods.GetRawInputDeviceInfo(rid.hDevice, NativeMethods.RIDI_DEVICEINFO, ref di, ref size); - NativeMethods.DeviceInterfaceDetailData deviceInterfaceDetailData = new NativeMethods.DeviceInterfaceDetailData(); - deviceInterfaceDetailData.Size = 5; + DeviceDetails deviceDetails = new DeviceDetails(); + switch (di.Type) + { + case NativeMethods.RawInputType.HID: + { + string vidAndPid = String.Format("Vid_{0:x4}&Pid_{1:x4}", di.HIDInfo.VendorID, di.HIDInfo.ProductID); + deviceDetails.Name = String.Format("HID: {0}", GetFriendlyName(vidAndPid)); + deviceDetails.ID = deviceName; + break; + } - if (NativeMethods.SetupDiGetDeviceInterfaceDetail(handle, ref deviceInterfaceData, ref deviceInterfaceDetailData, cbData, IntPtr.Zero, IntPtr.Zero) == false) - { - NativeMethods.SetupDiDestroyDeviceInfoList(handle); - //throw new Win32Exception(Marshal.GetLastWin32Error()); - continue; - } + case NativeMethods.RawInputType.Keyboard: + { + deviceDetails.Name = "Keyboard"; + deviceDetails.ID = deviceName; + break; + } - string devicePath = deviceInterfaceDetailData.DevicePath; + case NativeMethods.RawInputType.Mouse: + { + deviceDetails.Name = "Mouse"; + deviceDetails.ID = deviceName; + break; + } + } + _devices.Add(deviceDetails); - if (!String.IsNullOrEmpty(devicePath)) - { - string friendlyName = GetFriendlyName(devicePath); - if (String.IsNullOrEmpty(friendlyName)) - friendlyName = "Unknown"; - - DeviceDetails deviceDetails = new DeviceDetails(); - deviceDetails.Name = friendlyName; - deviceDetails.ID = devicePath; - _devices.Add(deviceDetails); + Marshal.FreeHGlobal(pData); + } } - NativeMethods.SetupDiDestroyDeviceInfoList(handle); + Marshal.FreeHGlobal(pRawInputDeviceList); } - } private void buttonOK_Click(object sender, EventArgs e) @@ -181,14 +177,12 @@ this.Close(); } - string GetFriendlyName(string deviceID) + string GetFriendlyName(string vidAndPid) { try { RegistryKey USBEnum = Registry.LocalMachine.OpenSubKey("SYSTEM\\CurrentControlSet\\Enum\\USB"); - string vidAndPid = GetVidAndPid(deviceID); - foreach (string usbSubKey in USBEnum.GetSubKeyNames()) { if (usbSubKey.IndexOf(vidAndPid, StringComparison.InvariantCultureIgnoreCase) == -1) @@ -201,13 +195,8 @@ foreach (string vidAndPidSubKey in vidAndPidSubKeys) { RegistryKey subKey = currentKey.OpenSubKey(vidAndPidSubKey); - string parentIdPrefix = subKey.GetValue("ParentIdPrefix", null) as string; - if (String.IsNullOrEmpty(parentIdPrefix)) - continue; - - if (deviceID.Contains(parentIdPrefix)) - return subKey.GetValue("DeviceDesc", null) as string + " (" + subKey.GetValue("LocationInformation", null) as string + ")"; + return subKey.GetValue("LocationInformation", null) as string; } } } @@ -218,18 +207,6 @@ return null; } - string GetVidAndPid(string deviceID) - { - // \\?\hid#vid_0fe9&pid_9010#6&162bd6c4&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} - - int vidStart = deviceID.IndexOf("vid_", StringComparison.InvariantCultureIgnoreCase); - - if (vidStart != -1) - return deviceID.Substring(vidStart, 17); - else - return null; - } - private void buttonAdvanced_Click(object sender, EventArgs e) { Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/NativeMethods.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/NativeMethods.cs 2007-07-15 16:20:48 UTC (rev 692) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/NativeMethods.cs 2007-07-16 06:32:23 UTC (rev 693) @@ -11,19 +11,97 @@ internal static class NativeMethods { - #region Interop + #region Constants - [DllImport("kernel32", SetLastError = true, CharSet = CharSet.Auto)] - internal static extern SafeFileHandle CreateFile( - String fileName, - [MarshalAs(UnmanagedType.U4)] FileAccess fileAccess, - [MarshalAs(UnmanagedType.U4)] FileShare fileShare, - IntPtr securityAttributes, - [MarshalAs(UnmanagedType.U4)] FileMode creationDisposition, - [MarshalAs(UnmanagedType.U4)] EFileAttributes flags, - IntPtr template); + public const int WM_KEYDOWN = 0x0100; + public const int WM_APPCOMMAND = 0x0319; + public const int WM_INPUT = 0x00FF; + public const int WM_SYSKEYDOWN = 0x0104; + public const int RIDI_PREPARSEDDATA = 0x20000005; + public const int RIDI_DEVICENAME = 0x20000007; + public const int RIDI_DEVICEINFO = 0x2000000B; + + public const int KEYBOARD_OVERRUN_MAKE_CODE = 0x00FF; + + #endregion Constants + + #region Enumerations + + internal enum RawInputType + { + Mouse = 0, + Keyboard = 1, + HID = 2 + } + [Flags] + internal enum RawMouseFlags : ushort + { + MoveRelative = 0, + MoveAbsolute = 1, + VirtualDesktop = 2, + AttributesChanged = 4 + } + + [Flags] + internal enum RawMouseButtons : ushort + { + None = 0, + LeftDown = 0x0001, + LeftUp = 0x0002, + RightDown = 0x0004, + RightUp = 0x0008, + MiddleDown = 0x0010, + MiddleUp = 0x0020, + Button4Down = 0x0040, + Button4Up = 0x0080, + Button5Down = 0x0100, + Button5Up = 0x0200, + MouseWheel = 0x0400 + } + + [Flags] + internal enum RawKeyboardFlags : ushort + { + KeyMake = 0x00, + KeyBreak = 0x01, + KeyE0 = 0x02, + KeyE1 = 0x04, + TerminalServerSetLED = 0x08, + TerminalServerShadow = 0x10 + } + + internal enum RawInputCommand + { + Input = 0x10000003, + Header = 0x10000005 + } + + [Flags] + internal enum RawInputDeviceFlags + { + /// <summary>No flags.</summary> + None = 0, + /// <summary>If set, this removes the top level collection from the inclusion list. This tells the operating system to stop reading from a device which matches the top level collection.</summary> + Remove = 0x00000001, + /// <summary>If set, this specifies the top level collections to exclude when reading a complete usage page. This flag only affects a TLC whose usage page is already specified with PageOnly.</summary> + Exclude = 0x00000010, + /// <summary>If set, this specifies all devices whose top level collection is from the specified usUsagePage. Note that Usage must be zero. To exclude a particular top level collection, use Exclude.</summary> + PageOnly = 0x00000020, + /// <summary>If set, this prevents any devices specified by UsagePage or Usage from generating legacy messages. This is only for the mouse and keyboard.</summary> + NoLegacy = 0x00000030, + /// <summary>If set, this enables the caller to receive the input even when the caller is not in the foreground. Note that WindowHandle must be specified.</summary> + InputSink = 0x00000100, + /// <summary>If set, the mouse button click does not activate the other window.</summary> + CaptureMouse = 0x00000200, + /// <summary>If set, the application-defined keyboard device hotkeys are not handled. However, the system hotkeys; for example, ALT+TAB and CTRL+ALT+DEL, are still handled. By default, all keyboard hotkeys are handled. NoHotKeys can be specified even if NoLegacy is not specified and WindowHandle is NULL.</summary> + NoHotKeys = 0x00000200, + /// <summary>If set, application keys are handled. NoLegacy must be specified. Keyboard only.</summary> + AppKeys = 0x00000400 + } + + [Flags] internal enum EFileAttributes : uint { Readonly = 0x00000001, @@ -53,6 +131,10 @@ FirstPipeInstance = 0x00080000 } + #endregion Enumerations + + #region Structures + [StructLayout(LayoutKind.Sequential)] internal struct DeviceInfoData { @@ -79,6 +161,167 @@ public string DevicePath; } + + [StructLayout(LayoutKind.Explicit)] + internal struct DeviceInfo + { + [FieldOffset(0)] + public int Size; + [FieldOffset(4)] + public RawInputType Type; + + [FieldOffset(8)] + public DeviceInfoMouse MouseInfo; + [FieldOffset(8)] + public DeviceInfoKeyboard KeyboardInfo; + [FieldOffset(8)] + public DeviceInfoHID HIDInfo; + } + + internal struct DeviceInfoMouse + { + public uint ID; + public uint NumberOfButtons; + public uint SampleRate; + } + + internal struct DeviceInfoKeyboard + { + public uint Type; + public uint SubType; + public uint KeyboardMode; + public uint NumberOfFunctionKeys; + public uint NumberOfIndicators; + public uint NumberOfKeysTotal; + } + + internal struct DeviceInfoHID + { + public uint VendorID; + public uint ProductID; + public uint VersionNumber; + public ushort UsagePage; + public ushort Usage; + } + + + [StructLayout(LayoutKind.Sequential)] + internal struct RAWINPUTDEVICELIST + { + public IntPtr hDevice; + [MarshalAs(UnmanagedType.U4)] + public RawInputType dwType; + } + + [StructLayout(LayoutKind.Explicit)] + internal struct RAWINPUT + { + [FieldOffset(0)] + public RAWINPUTHEADER header; + [FieldOff... [truncated message content] |