Skip to content

Commit 212facf

Browse files
committed
Remove unused RawInput infrastructure.
1 parent 9c6474c commit 212facf

35 files changed

+34
-1151
lines changed

RetailCoder.VBE/Common/RubberduckHooks.cs

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ public class RubberduckHooks : IRubberduckHooks
2121
// This can't be local - otherwise RawInput can't call it in the subclassing chain.
2222
// ReSharper disable once PrivateFieldCanBeConvertedToLocalVariable
2323
private readonly User32.WndProc _newWndProc;
24-
private RawInput _rawinput;
25-
private RawKeyboard _kb;
26-
private RawMouse _mouse;
24+
//private RawInput _rawinput;
25+
//private RawKeyboard _kb;
26+
//private RawMouse _mouse;
2727
private readonly IGeneralConfigService _config;
2828
private readonly IEnumerable<CommandBase> _commands;
2929
private readonly IList<IAttachable> _hooks = new List<IAttachable>();
@@ -56,17 +56,17 @@ public void HookHotkeys()
5656
var config = _config.LoadConfiguration();
5757
var settings = config.UserSettings.HotkeySettings;
5858

59-
_rawinput = new RawInput(_mainWindowHandle);
59+
//_rawinput = new RawInput(_mainWindowHandle);
6060

61-
var kb = (RawKeyboard)_rawinput.CreateKeyboard();
62-
_rawinput.AddDevice(kb);
63-
kb.RawKeyInputReceived += Keyboard_RawKeyboardInputReceived;
64-
_kb = kb;
61+
//var kb = (RawKeyboard)_rawinput.CreateKeyboard();
62+
//_rawinput.AddDevice(kb);
63+
//kb.RawKeyInputReceived += Keyboard_RawKeyboardInputReceived;
64+
//_kb = kb;
6565

66-
var mouse = (RawMouse)_rawinput.CreateMouse();
67-
_rawinput.AddDevice(mouse);
68-
mouse.RawMouseInputReceived += Mouse_RawMouseInputReceived;
69-
_mouse = mouse;
66+
//var mouse = (RawMouse)_rawinput.CreateMouse();
67+
//_rawinput.AddDevice(mouse);
68+
//mouse.RawMouseInputReceived += Mouse_RawMouseInputReceived;
69+
//_mouse = mouse;
7070

7171
foreach (var hotkey in settings.Settings.Where(hotkey => hotkey.IsEnabled))
7272
{
@@ -82,28 +82,28 @@ public void HookHotkeys()
8282
Attach();
8383
}
8484

85-
private void Mouse_RawMouseInputReceived(object sender, RawMouseEventArgs e)
86-
{
87-
if (e.UlButtons.HasFlag(UsButtonFlags.RI_MOUSE_LEFT_BUTTON_UP) || e.UlButtons.HasFlag(UsButtonFlags.RI_MOUSE_RIGHT_BUTTON_UP))
88-
{
89-
OnMessageReceived(this, HookEventArgs.Empty);
90-
}
91-
}
85+
//private void Mouse_RawMouseInputReceived(object sender, RawMouseEventArgs e)
86+
//{
87+
// if (e.UlButtons.HasFlag(UsButtonFlags.RI_MOUSE_LEFT_BUTTON_UP) || e.UlButtons.HasFlag(UsButtonFlags.RI_MOUSE_RIGHT_BUTTON_UP))
88+
// {
89+
// OnMessageReceived(this, HookEventArgs.Empty);
90+
// }
91+
//}
9292

93-
// keys that change the current selection.
94-
private static readonly HashSet<Keys> NavKeys = new HashSet<Keys>
95-
{
96-
Keys.Up, Keys.Down, Keys.Left, Keys.Right, Keys.PageDown, Keys.PageUp, Keys.Enter
97-
};
93+
//// keys that change the current selection.
94+
//private static readonly HashSet<Keys> NavKeys = new HashSet<Keys>
95+
//{
96+
// Keys.Up, Keys.Down, Keys.Left, Keys.Right, Keys.PageDown, Keys.PageUp, Keys.Enter
97+
//};
9898

99-
private void Keyboard_RawKeyboardInputReceived(object sender, RawKeyEventArgs e)
100-
{
101-
// note: handling *all* keys causes annoying RTrim of current line, making editing code a PITA.
102-
if (e.Message == WM.KEYUP && NavKeys.Contains((Keys)e.VKey))
103-
{
104-
OnMessageReceived(this, HookEventArgs.Empty);
105-
}
106-
}
99+
//private void Keyboard_RawKeyboardInputReceived(object sender, RawKeyEventArgs e)
100+
//{
101+
// // note: handling *all* keys causes annoying RTrim of current line, making editing code a PITA.
102+
// if (e.Message == WM.KEYUP && NavKeys.Contains((Keys)e.VKey))
103+
// {
104+
// OnMessageReceived(this, HookEventArgs.Empty);
105+
// }
106+
//}
107107

108108
public IEnumerable<IAttachable> Hooks { get { return _hooks; } }
109109

@@ -186,8 +186,8 @@ public void Dispose()
186186
{
187187
Detach();
188188
User32.SetWindowLong(_mainWindowHandle, (int)WindowLongFlags.GWL_WNDPROC, _oldWndProc);
189-
_mouse.RawMouseInputReceived -= Mouse_RawMouseInputReceived;
190-
_kb.RawKeyInputReceived -= Keyboard_RawKeyboardInputReceived;
189+
//_mouse.RawMouseInputReceived -= Mouse_RawMouseInputReceived;
190+
//_kb.RawKeyInputReceived -= Keyboard_RawKeyboardInputReceived;
191191
}
192192

193193
private IntPtr WindowProc(IntPtr hWnd, uint uMsg, IntPtr wParam, IntPtr lParam)

RetailCoder.VBE/Common/WinAPI/DataCommand.cs

Lines changed: 0 additions & 8 deletions
This file was deleted.

RetailCoder.VBE/Common/WinAPI/DeviceInfo.cs

Lines changed: 0 additions & 23 deletions
This file was deleted.

RetailCoder.VBE/Common/WinAPI/DeviceInfoHid.cs

Lines changed: 0 additions & 16 deletions
This file was deleted.

RetailCoder.VBE/Common/WinAPI/DeviceInfoKeyboard.cs

Lines changed: 0 additions & 22 deletions
This file was deleted.

RetailCoder.VBE/Common/WinAPI/DeviceInfoMouse.cs

Lines changed: 0 additions & 14 deletions
This file was deleted.

RetailCoder.VBE/Common/WinAPI/DeviceNotification.cs

Lines changed: 0 additions & 10 deletions
This file was deleted.

RetailCoder.VBE/Common/WinAPI/DeviceType.cs

Lines changed: 0 additions & 9 deletions
This file was deleted.

RetailCoder.VBE/Common/WinAPI/HidUsage.cs

Lines changed: 0 additions & 16 deletions
This file was deleted.

RetailCoder.VBE/Common/WinAPI/HidUsagePage.cs

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)