Input: bind Enter key to SubmitCommand for enter-to-evaluate

This commit is contained in:
Codex CLI 2025-08-27 22:11:31 -05:00
commit 9483bd01eb

View file

@ -153,9 +153,13 @@
<TextBlock FontFamily="{StaticResource MDI}" Text="{x:Static m:IconFont.Function}" /> <TextBlock FontFamily="{StaticResource MDI}" Text="{x:Static m:IconFont.Function}" />
</Button> </Button>
<TextBox Grid.Column="2" Text="{Binding InputText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" MinHeight="44" <TextBox Grid.Column="2" Text="{Binding InputText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" MinHeight="44"
AutomationProperties.Name="Expression input" AutomationProperties.Name="Expression input"
Watermark="Type an expression (e.g., 2 + 2)"/> Watermark="Type an expression (e.g., 2 + 2)">
<InputElement.KeyBindings>
<KeyBinding Gesture="Enter" Command="{Binding SubmitCommand}" />
</InputElement.KeyBindings>
</TextBox>
<!-- Explicit evaluate button for touch --> <!-- Explicit evaluate button for touch -->
<Button Grid.Column="3" Command="{Binding SubmitCommand}" MinHeight="44" Padding="16,8" <Button Grid.Column="3" Command="{Binding SubmitCommand}" MinHeight="44" Padding="16,8"