locked
??? “LastKey” & “ GetCharacterCode" RRS feed

  • Question

  •   

    Hi,


    I am very confused what about is returning the properties of GraphicsWindow “LastKey” and the method of Text “ GetCharacterCode"!


    LastKey return only Upper case character ( A to Z )


    GetCharacterCode, return the same code for “B” and “Back” = 66 or for “R” and “Return” = 82.


    That look strange to me, if some body have an idea, please help.


    Thanks

    Saturday, January 10, 2009 1:11 PM

Answers

  • LeVentDeLest,

    GetCharacterCode only returns the unicode number for the character you pass in.  It does not return the scan code like you're expecting.

    You can't use GetCharacterCode on the return value of LastKey.  LastKey is a user-friendly notation for what key was typed.  When you pass that to GetCharacterCode, you'll get back the unicode character code for the first character in the text that was passed.

    Hope that answers your question.
    • Marked as answer by Vijaye Raji Wednesday, January 14, 2009 5:11 AM
    Saturday, January 10, 2009 7:31 PM

All replies

  • LeVentDeLest,

    GetCharacterCode only returns the unicode number for the character you pass in.  It does not return the scan code like you're expecting.

    You can't use GetCharacterCode on the return value of LastKey.  LastKey is a user-friendly notation for what key was typed.  When you pass that to GetCharacterCode, you'll get back the unicode character code for the first character in the text that was passed.

    Hope that answers your question.
    • Marked as answer by Vijaye Raji Wednesday, January 14, 2009 5:11 AM
    Saturday, January 10, 2009 7:31 PM
  •   

    Hi Vijaye Raji,


    O.k. Now it looks clear to me. The only way to do what i wish, it is via TextWindow or to create specific code!


    Thank you for help.

    Saturday, January 10, 2009 11:33 PM