开发者

Silverlight Smooth KeyDown Event

This question is basically the same as Silverlight开发者_开发百科 keydown event for games but there was never really a clear answer. How can I get smooth keypresses for a game.

Can I check what keys are currently being held down inside a timer? (My best idea)


The answer given was correct, you can't detect the currently pressed keys. However you can handle key down and key up on the form at the layoutroot element. You can then build you're own class which tracks the currently pressed keys. Simply add keys to a list whenever you get a key down event and remove them from the list when you get a key up event. You can then use PressedKeys.Contains(MyKey) to determine if a key is pressed.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜