Added the ability to send commands using the Enter key and not clicking the button
Was about time lol
This commit is contained in:
@@ -18,7 +18,7 @@
|
|||||||
<Terminal @ref="Terminal"/>
|
<Terminal @ref="Terminal"/>
|
||||||
<div class="mt-3">
|
<div class="mt-3">
|
||||||
<div class="input-group">
|
<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"/>
|
<WButton CssClasses="btn btn-secondary rounded-start" Text="Execute" OnClick="SendCommand"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -118,6 +118,14 @@
|
|||||||
|
|
||||||
await InvokeAsync(StateHasChanged);
|
await InvokeAsync(StateHasChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async Task OnEnterPressed(KeyboardEventArgs args)
|
||||||
|
{
|
||||||
|
if(args.Code != "Enter" || args.CtrlKey || args.ShiftKey)
|
||||||
|
return;
|
||||||
|
|
||||||
|
await SendCommand();
|
||||||
|
}
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user