gpt4 book ai didi

c# - KeyEventArgs.Handled 与 KeyEventArgs.SupressKeyPress

转载 作者:太空狗 更新时间:2023-10-29 18:20:42 29 4
gpt4 key购买 nike

使用有什么区别

e.Handled = true

e.SuppressKeyPress = true

我读到过 SuppressKeyPress 调用 e.Handled,但除此之外它还有作用吗?

最佳答案

根据此博客:New keyboard APIs: KeyEventArgs.SuppressKeyPress :

The problem is that "Handled" doesn't take care of pending WM_CHARmessages already built up in the message queue - so setting Handled =true does not prevent a KeyPress from occurring.

In order not to break anyone who has currently got e.Handled =true, we needed to add a new property called SuppressKeyChar. If wewent the other way, if "handling" a keydown suddenly started toactually work, we might break folks who accidentally had this set totrue.

关于c# - KeyEventArgs.Handled 与 KeyEventArgs.SupressKeyPress,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7557442/

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