Sunday, 15 August 2010

windows store apps - KeyDown only works if I hold button clicked in UI c# metro -



windows store apps - KeyDown only works if I hold button clicked in UI c# metro -

i have weird problem. made app has react keyboard keys (1,2,3,4,...), doesn't. well, if click button , hold clicked, if allow go keys, again, stop react.

the method used keydown, placed in page

keydown="page_keydown" in xaml

and in code:

private void page_keydown(object sender, keyroutedeventargs e) { switch (e.key) { case windows.system.virtualkey.number1: { keydownhelper(1); break; } } ... }

it has many cases of them pretty same, , guess problem isn't within method thinking.

i think problem page kind of loses focus maybe? not sure if case , how deal it

it sounds want app hear individual key presses, rather when key held down, right? in case should respond key event. way able react each individual key press, , ignore times when key held down.

here link msdn article on key up: key msdn article

does help?

c# windows-store-apps

No comments:

Post a Comment