Skip to content

Commit

Permalink
Adds support for just displaying hints (no hotkey)
Browse files Browse the repository at this point in the history
  • Loading branch information
zsims committed Feb 25, 2015
1 parent efb4cfa commit 0992348
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ To use
2. With any window focused, press Alt + ;
3. An overlay window will be displayed, type any of the hint characters you see.

Alternatively, Hunt and Peck can be launched via the command-line or AutoHotKey by specifying `/hint`:
```
hap.exe /hint
```

Supported Elements
------------------
Expand All @@ -24,5 +28,6 @@ TODO
Some things on the "roadmap":

1. The ability to customize options, including the hotkey and hint characters.
3. More UI Automation patterns, such as scroll or expand/collapse.
4. "Debug" mode that displays all hints regardless of supported patterns.
2. More UI Automation patterns, such as scroll or expand/collapse.
3. "Debug" mode that displays all hints regardless of supported patterns.
4. Improve performance, enumerating hints can be quite slow for "busy" windows.
20 changes: 18 additions & 2 deletions src/hap/AppBootstrapper.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using Autofac;
using System.Linq;
using Autofac;
using Caliburn.Micro;
using hap.Models;
using hap.Services;
using hap.Services.Interfaces;
using hap.ViewModels;
Expand All @@ -23,7 +25,21 @@ public AppBootstrapper()

protected override void OnStartup(object sender, StartupEventArgs e)
{
DisplayRootViewFor<ShellViewModel>();
if (e.Args.Contains("/hint"))
{
// support headless mode
var providerService = _container.Resolve<IHintProviderService>();
var windowManager = _container.Resolve<IWindowManager>();
var overlayFactory = _container.Resolve<Func<HintSession, OverlayViewModel>>();

var session = providerService.EnumHints();
var vm = overlayFactory(session);
windowManager.ShowWindow(vm);
}
else
{
DisplayRootViewFor<ShellViewModel>();
}
}

#endregion
Expand Down

0 comments on commit 0992348

Please sign in to comment.