michielpost.nl

Handling global KeyDown event in Windows 8 / WinRT

23-07-2012

I was searching for a way to handle the KeyDown or KeyUp event for a ScrollViewer in a Windows 8 Metro / WinRT app. The events just doesn't fire for the ScrollViewer.

But I found a nice workaround, it's possible to handle the KeyDown/KeyUp event for the whole page by subscribing to the events:
Window.Current.CoreWindow.KeyDown += CoreWindow_KeyDown;
Window.Current.CoreWindow.KeyUp += CoreWindow_KeyUp;

This is also very useful when implementing "type to search" functionality like on the Windows 8 start screen.

Comments


Roman 30-05-2013
After I navigated from my page (I clicked the button for raising the navigatedFrom event), and after again navigated to this page key up and key down events not firing. I waited some seconds and beaten on the keyboard - after that key up/down events is firing well. What happening with key up and down events?


???????? ?? ? ????, ????? ???????? ??????, ? ? ????, ????? ???? ????? ????? ?????. https://helloworld.com?h=ee4f4fbd83c2d52f01b05e51d8bfb06e& 19-11-2020
???????? ?? ? ????, ????? ???????? ??????, ? ? ????, ????? ???? ????? ????? ?????. https://helloworld.com?h=ee4f4fbd83c2d52f01b05e51d8bfb06e&


???????? ?? ? ????, ????? ???????? ??????, ? ? ????, ????? ???? ????? ????? ?????. http://bit.do/fLc9r?h=ee4f4fbd83c2d52f01b05e51d8bfb06e& 19-11-2020
???????? ?? ? ????, ????? ???????? ??????, ? ? ????, ????? ???? ????? ????? ?????. http://bit.do/fLc9r?h=ee4f4fbd83c2d52f01b05e51d8bfb06e&


???????? ?? ? ????, ????? ???????? ??????, ? ? ????, ????? ???? ????? ????? ?????. https://helloworld.com?h=ee4f4fbd83c2d52f01b05e51d8bfb06e& 19-11-2020
???????? ?? ? ????, ????? ???????? ??????, ? ? ????, ????? ???? ????? ????? ?????. https://helloworld.com?h=ee4f4fbd83c2d52f01b05e51d8bfb06e&


???????? ?? ? ????, ????? ???????? ??????, ? ? ????, ????? ???? ????? ????? ?????. http://bit.do/fLc9r?h=ee4f4fbd83c2d52f01b05e51d8bfb06e& 20-11-2020
???????? ?? ? ????, ????? ???????? ??????, ? ? ????, ????? ???? ????? ????? ?????. http://bit.do/fLc9r?h=ee4f4fbd83c2d52f01b05e51d8bfb06e&


???????? ?? ? ????, ????? ???????? ??????, ? ? ????, ????? ???? ????? ????? ?????. http://bit.do/fLc9r?h=ee4f4fbd83c2d52f01b05e51d8bfb06e& 20-11-2020
???????? ?? ? ????, ????? ???????? ??????, ? ? ????, ????? ???? ????? ????? ?????. http://bit.do/fLc9r?h=ee4f4fbd83c2d52f01b05e51d8bfb06e&


???????? ?? ? ????, ????? ???????? ??????, ? ? ????, ????? ???? ????? ????? ?????. http://bit.do/fLc9r?h=ee4f4fbd83c2d52f01b05e51d8bfb06e& 21-11-2020
???????? ?? ? ????, ????? ???????? ??????, ? ? ????, ????? ???? ????? ????? ?????. http://bit.do/fLc9r?h=ee4f4fbd83c2d52f01b05e51d8bfb06e&


Buy legal anabolic steroids https://myfsk.org/community/account/buy-legal-anabolic-steroids/?h=ee4f4fbd83c2d52f01b05e51d8bfb06e& 13-12-2020
Buy legal anabolic steroids https://myfsk.org/community/account/buy-legal-anabolic-steroids/?h=ee4f4fbd83c2d52f01b05e51d8bfb06e&


<p><a href="https://f3gxp.page.link/Tbeh"><img src="https://i.ibb.co/rH6Ky7F/best-hookup-sites-fs.jpg"></a></p>?h=ee4f4fbd83c2d52f01b05e51d8bfb06e& 20-12-2020
<p><a href="https://f3gxp.page.link/Tbeh"><img src="https://i.ibb.co/rH6Ky7F/best-hookup-sites-fs.jpg"></a></p>?h=ee4f4fbd83c2d52f01b05e51d8bfb06e&


<p><a href="https://f3gxp.page.link/Tbeh"><img src="https://i.ibb.co/rH6Ky7F/best-hookup-sites-fs.jpg"></a></p>?h=ee4f4fbd83c2d52f01b05e51d8bfb06e& 21-12-2020
<p><a href="https://f3gxp.page.link/Tbeh"><img src="https://i.ibb.co/rH6Ky7F/best-hookup-sites-fs.jpg"></a></p>?h=ee4f4fbd83c2d52f01b05e51d8bfb06e&


WqmLG 10-01-2021
Medication prescribing information. Short-Term Effects. <a href="https://prednisone4u.top">where can i buy prednisone prices</a> in US. Actual information about medicines. Read information now. <a href=https://www.kjpub.com/cn/node/50673?page=3831#comment-756894>Some news about medicine.</a> <a href=http://pogaduchyweselne.pl/temat-Actual-information-about-medication>Actual information about medication.</a> <a href=https://happilyeverblog.com/coping-with-anxiety/#comment-2752>Some trends of drug.</a> 51d144e


New Comment

Name
E-mail (not published)
Comment
Enter the code shown: