Make ctrl-F16 register windows actually
This commit is contained in:
@@ -81,42 +81,34 @@ namespace EveOPreview.Services
|
||||
|
||||
this._hideThumbnailsDelay = this._configuration.HideThumbnailsDelay;
|
||||
|
||||
RegisterCycleClientHotkey(this._configuration.CycleGroup1ForwardHotkeys?.Select(x => this._configuration.StringToKey(x)), true, this._configuration.CycleGroup1ClientsOrder);
|
||||
RegisterCycleClientHotkey(this._configuration.CycleGroup1BackwardHotkeys?.Select(x => this._configuration.StringToKey(x)), false, this._configuration.CycleGroup1ClientsOrder);
|
||||
|
||||
RegisterCycleClientHotkey(this._configuration.CycleGroup2ForwardHotkeys?.Select(x => this._configuration.StringToKey(x)), true, this._configuration.CycleGroup2ClientsOrder);
|
||||
RegisterCycleClientHotkey(this._configuration.CycleGroup2BackwardHotkeys?.Select(x => this._configuration.StringToKey(x)), false, this._configuration.CycleGroup2ClientsOrder);
|
||||
|
||||
RegisterCycleClientHotkey(this._configuration.CycleGroup3ForwardHotkeys?.Select(x => this._configuration.StringToKey(x)), true, this._configuration.CycleGroup3ClientsOrder);
|
||||
RegisterCycleClientHotkey(this._configuration.CycleGroup3BackwardHotkeys?.Select(x => this._configuration.StringToKey(x)), false, this._configuration.CycleGroup3ClientsOrder);
|
||||
|
||||
RegisterCycleClientHotkey(this._configuration.CycleGroup4ForwardHotkeys?.Select(x => this._configuration.StringToKey(x)), true, this._configuration.CycleGroup4ClientsOrder);
|
||||
RegisterCycleClientHotkey(this._configuration.CycleGroup4BackwardHotkeys?.Select(x => this._configuration.StringToKey(x)), false, this._configuration.CycleGroup4ClientsOrder);
|
||||
|
||||
RegisterCycleClientHotkey(this._configuration.CycleGroup5ForwardHotkeys?.Select(x => this._configuration.StringToKey(x)), true, this._configuration.CycleGroup5ClientsOrder);
|
||||
RegisterCycleClientHotkey(this._configuration.CycleGroup5BackwardHotkeys?.Select(x => this._configuration.StringToKey(x)), false, this._configuration.CycleGroup5ClientsOrder);
|
||||
|
||||
// RegisterCycleClientHotkey(this._configuration.CycleGroup1ForwardHotkeys?.Select(x => this._configuration.StringToKey(x)), true, this._configuration.CycleGroup1ClientsOrder);
|
||||
// RegisterCycleClientHotkey(this._configuration.CycleGroup1BackwardHotkeys?.Select(x => this._configuration.StringToKey(x)), false, this._configuration.CycleGroup1ClientsOrder);
|
||||
//
|
||||
// RegisterCycleClientHotkey(this._configuration.CycleGroup2ForwardHotkeys?.Select(x => this._configuration.StringToKey(x)), true, this._configuration.CycleGroup2ClientsOrder);
|
||||
// RegisterCycleClientHotkey(this._configuration.CycleGroup2BackwardHotkeys?.Select(x => this._configuration.StringToKey(x)), false, this._configuration.CycleGroup2ClientsOrder);
|
||||
//
|
||||
// RegisterCycleClientHotkey(this._configuration.CycleGroup3ForwardHotkeys?.Select(x => this._configuration.StringToKey(x)), true, this._configuration.CycleGroup3ClientsOrder);
|
||||
// RegisterCycleClientHotkey(this._configuration.CycleGroup3BackwardHotkeys?.Select(x => this._configuration.StringToKey(x)), false, this._configuration.CycleGroup3ClientsOrder);
|
||||
//
|
||||
// RegisterCycleClientHotkey(this._configuration.CycleGroup4ForwardHotkeys?.Select(x => this._configuration.StringToKey(x)), true, this._configuration.CycleGroup4ClientsOrder);
|
||||
// RegisterCycleClientHotkey(this._configuration.CycleGroup4BackwardHotkeys?.Select(x => this._configuration.StringToKey(x)), false, this._configuration.CycleGroup4ClientsOrder);
|
||||
//
|
||||
// RegisterCycleClientHotkey(this._configuration.CycleGroup5ForwardHotkeys?.Select(x => this._configuration.StringToKey(x)), true, this._configuration.CycleGroup5ClientsOrder);
|
||||
// RegisterCycleClientHotkey(this._configuration.CycleGroup5BackwardHotkeys?.Select(x => this._configuration.StringToKey(x)), false, this._configuration.CycleGroup5ClientsOrder);
|
||||
//
|
||||
// Setup toggle tracking hotkey (Ctrl+T)
|
||||
var mainHandle = this._processMonitor.GetMainProcess().Handle;
|
||||
System.Diagnostics.Debug.WriteLine($"Registering hotkey with main window handle: {mainHandle}");
|
||||
this._toggleTrackingHotkey = new HotkeyHandler(mainHandle, Keys.Control | Keys.T);
|
||||
this._toggleTrackingHotkey = new HotkeyHandler(mainHandle, Keys.Control | Keys.F16);
|
||||
this._toggleTrackingHotkey.Pressed += (object s, HandledEventArgs e) =>
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine("Hotkey handler triggered!");
|
||||
if (!Control.IsKeyLocked(Keys.Scroll))
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine("Scroll lock is off, passing through");
|
||||
e.Handled = false;
|
||||
return;
|
||||
}
|
||||
|
||||
var foregroundHandle = this._windowManager.GetForegroundWindowHandle();
|
||||
if (foregroundHandle != IntPtr.Zero)
|
||||
{
|
||||
uint processId;
|
||||
GetWindowThreadProcessId(foregroundHandle, out processId);
|
||||
var process = Process.GetProcessById((int)processId);
|
||||
|
||||
|
||||
if (process != null)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine($"Found process: {process.ProcessName}");
|
||||
@@ -176,7 +168,7 @@ namespace EveOPreview.Services
|
||||
IOrderedEnumerable<KeyValuePair<string, int>> clientOrder;
|
||||
Dictionary<string, int> _cycleOrder = new Dictionary<string, int>(cycleOrder);
|
||||
|
||||
if ( _cycleOrder.Count == 0 )
|
||||
if ( _cycleOrder.Count == 0 )
|
||||
{
|
||||
int order = 0;
|
||||
foreach( var x in _thumbnailViews)
|
||||
@@ -246,7 +238,7 @@ namespace EveOPreview.Services
|
||||
|
||||
if (_thumbnailViews.Any(x => x.Value.Title == t.Key))
|
||||
{
|
||||
var ptr = t.Key.Equals("EVE") ?
|
||||
var ptr = t.Key.Equals("EVE") ?
|
||||
(isForwards ? _thumbnailViews.OrderBy(x => x.Value.Id.ToInt64()) : _thumbnailViews.OrderByDescending(x => x.Value.Id.ToInt64())).First(x => x.Value.Title == t.Key)
|
||||
: _thumbnailViews.First(x => x.Value.Title == t.Key);
|
||||
SetActive(ptr);
|
||||
@@ -547,7 +539,7 @@ namespace EveOPreview.Services
|
||||
view.IsOverlayEnabled = this._configuration.ShowThumbnailOverlays;
|
||||
|
||||
view.SetHighlight(
|
||||
this._configuration.EnableActiveClientHighlight && (view.Id == this._activeClient.Handle),
|
||||
this._configuration.EnableActiveClientHighlight && (view.Id == this._activeClient.Handle),
|
||||
this._configuration.ActiveClientHighlightThickness);
|
||||
|
||||
if (!view.IsActive)
|
||||
|
Reference in New Issue
Block a user