locked
Getting ScanCode for KeyDown events

    Question

  • I found something! I've been searching for the same thing all week and finally discovered that the

    KeyEventArgs^ args

    you get back from CoreWindow's KeyDown event has a KeyStatus.ScanCode. This ScanCode maps onto physical keys.

    ----------------------------

    David Goemans

    Game Developer 

    Codeglue

    Friday, November 09, 2012 11:46 AM

Answers

  • Hi David,

    Please don't bump threads from previous versions. Often they are discussing issues which are not relevant to the released OS and can cause a confusion because of that. We are working to move them to an archive forum, but I don't know when that will actually happen.

    In most cases where you are looking for actual text the KeyDown event won't work. KeyDown will only fire if the user is using a keyboard or equivalent, not if the user enters text via stylus & handwriting recognition, speech, or IMEs.

    KeyDown works well for game-like situations where you are using the key as a controller rather than as text.

    --Rob

    • Proposed as answer by Jesse Jiang Thursday, November 15, 2012 2:48 AM
    • Marked as answer by Jesse Jiang Monday, November 19, 2012 4:45 AM
    Friday, November 09, 2012 9:59 PM
    Owner