Added the ability to send commands using the Enter key and not clicking the button
Was about time lol
This commit is contained in:
parent
e25b005643
commit
e3f040c978
1 changed files with 9 additions and 1 deletions
|
@ -18,7 +18,7 @@
|
|||
<Terminal @ref="Terminal"/>
|
||||
<div class="mt-3">
|
||||
<div class="input-group">
|
||||
<input @bind="CommandInput" class="form-control form-control-transparent text-white" placeholder="Enter command"/>
|
||||
<input @bind="CommandInput" @bind:event="onchange" @onkeyup="OnEnterPressed" class="form-control form-control-transparent text-white" placeholder="Enter command"/>
|
||||
<WButton CssClasses="btn btn-secondary rounded-start" Text="Execute" OnClick="SendCommand"/>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -118,6 +118,14 @@
|
|||
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
|
||||
private async Task OnEnterPressed(KeyboardEventArgs args)
|
||||
{
|
||||
if(args.Code != "Enter" || args.CtrlKey || args.ShiftKey)
|
||||
return;
|
||||
|
||||
await SendCommand();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue