0x5bfa / FluentHub

A stylish yet powerful GitHub client for Windows
MIT License
1.08k stars 53 forks source link

Add keyboard shortcut support #100

Closed luandersonn closed 2 years ago

luandersonn commented 2 years ago

Before you start...

Description

Adding support for keyboard and mouse shortcuts would increase productivity with FluentHub.

Common shortcuts:

Shortcut Description
Ctrl + T Opens a new tab
Ctrl + W Closes the current tab
Ctrl + Tab Go to the next tab
Ctrl + Shift + Tab Go to the previous tab
Alt + Left, Back (mouse) Navigate back
Alt + Right, Forward (mouse) Navigate forward
F5 Refresh the page

And more

Alternative solutions

No response

Relevant Assets

No response

0x5bfa commented 2 years ago

maybe we can use like:

<Page
    xmlns:i="using:Microsoft.Xaml.Interactivity"
    xmlns:icore="using:Microsoft.Xaml.Interactions.Core">

    <Page.KeyboardAccelerators>
        <KeyboardAccelerator Key="T" Modifiers="Control">
            <i:Interaction.Behaviors>
                <icore:EventTriggerBehavior EventName="Invoked">
                    <icore:InvokeCommandAction Command="{x:Bind ViewModel.AddNewInstanceAcceleratorCommand}" />
                </icore:EventTriggerBehavior>
            </i:Interaction.Behaviors>
        </KeyboardAccelerator>
    </Page.KeyboardAccelerators>
</Page>

And seems like all click events need to go to the ViewModel.

luandersonn commented 2 years ago

Not implemented yet

0x5bfa commented 2 years ago

oh sorry..