8000 Hotkeys for Browsers by U-C-S · Pull Request #190 · U-C-S/Hurl · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Hotkeys for Browsers #190

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Source/Hurl.BrowserSelector/Controls/BrowserButton.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
using Hurl.Library.Models;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using Wpf.Ui.Input;

namespace Hurl.BrowserSelector.Controls
{
Expand All @@ -17,12 +19,14 @@ public BrowserButton(Browser browser)
DataContext = browser;
}

private void BrowserButton_Click(object sender, RoutedEventArgs e)
public void BrowserButton_Click(object sender, RoutedEventArgs e)
{
UriLauncher.ResolveAutomatically(OpenedUri.Value, (Browser)DataContext, null);
MinimizeWindow();
}

public ICommand Command => new RelayCommand<string>((x) => BrowserButton_Click(null,null));

private void MenuItem_Click(object sender, RoutedEventArgs e)
{
if (((MenuItem)sender).Tag is AlternateLaunch alt)
Expand Down
5 changes: 5 additions & 0 deletions Source/Hurl.BrowserSelector/Windows/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ public void LoadBrowsers()
{
var browserBtn = new BrowserButton(browser);
BrowsersList.Children.Add(browserBtn);
this.InputBindings.Add(new KeyBinding()
{
Command = browserBtn.Command,
Key = (Key)36
});
}
}
}
Expand Down
0