gpt4 book ai didi

silverlight - 为什么在全屏模式下我没有收到键盘输入事件?

转载 作者:行者123 更新时间:2023-12-05 00:43:44 25 4
gpt4 key购买 nike

我在 Silverlight 全屏模式下遇到了一些问题。

如果我将应用程序切换到全屏,则不会处理来自键盘的所有输入。没有文本框输入,没有按键按下/按键按下事件,可能还有更多。这是一个示例应用程序,演示了这一点:

Xaml:

<Canvas>

<TextBlock Text="Try some input:" Canvas.Top="10" Width="100"></TextBlock>

<TextBox x:Name="tboxInput" Width="100" Canvas.Top="30"></TextBox>

<Button x:Name="btnFullScreen" Content="Go Full Screen" Canvas.Top="60"></Button>

</Canvas>

隐藏代码:
public Page() 
{

InitializeComponent();

btnFullScreen.Click += new RoutedEventHandler(btnFullScreen_Click);
}

void btnFullScreen_Click(object sender, RoutedEventArgs e)
{

Application.Current.Host.Content.IsFullScreen = !Application.Current.Host.Content.IsFullScreen;
if (!Application.Current.Host.Content.IsFullScreen)

btnFullScreen.Content = "Go Full Screen";
else

btnFullScreen.Content = "Go Normal Screen";
}

很容易看出,在全屏模式下,您无法在文本框中写入文本。我在这里做错了吗?有没有另一种方法可以切换全屏,这样就不会发生这种情况?

最佳答案

此链接应该可以帮助您:http://silverlight.net/forums/p/11519/36798.aspx
编辑
还有这个 MSDN article给你一个更详细的原因:

When a Silverlight plug-in is in full-screen mode, it disables most keyboard events. This limitation of keyboard input during full-screen mode is a security feature, and is intended to minimize the possibility of unintended information being entered by a user. In full-screen mode, the only input allowed is through the following keys.

UP ARROW, DOWN ARROW, LEFT ARROW, RIGHT ARROW, SPACEBAR, TAB, PAGE UP, PAGE DOWN, HOME, END, ENTER

关于silverlight - 为什么在全屏模式下我没有收到键盘输入事件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/709019/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com