locked
[MS-RDPBCGR] How to send WM_KEYUP for Unicode keyboard event properly? RRS feed

  • Question

  • Hello,

    I want to send Japanese characters to TS using [MS-RDPBCGR] 2.2.8.1.1.3.1.1.2 Unicode Keyboard Event (TS_UNICODE_KEYBOARD_EVENT) from my own on-screen keyboard (so, no actual scancodes are involved). TS treats this PDU as WM_KEYDOWN with scancode 0 and WM_CHAR <Unicode char>. However there is no WM_KEYUP event. Without WM_KEYUP event, the sequence of "aaa" can be treated on TS as "a", "aa", "aaa". What is the correct sequence of input PDUs to get proper WM_KEYUP?

    Thank you,

    Greg

    Wednesday, June 22, 2011 9:48 AM

Answers

  • Hi, Greg,

     

       We have completed the investigation regarding triggering a WM_KEYUP event on the RDP server.   There is a problem with the documentation of the Unicode Keyboard Event in  section 2.2.8.1.1.3.1.1.2 MS-RDPBCGR.  The first two bytes (pad2OctestsA) is documented as ignored.   This is not correct.   The KBDFLAGS_RELEASE bit (0x8000) in this field is used the same way as in normal keyboard event in    2.2.8.1.1.3.1.1.1 MS-RDPBCGR.  With this said, you can use this bit to indicate the a key release event in PDU to get the proper WM_KEYUP in server.    You probably never set  this bit in the first two bytes.   This can also explain why you always got Key Down events.

     

      There is a similar problem with fast path Unicode keyboard event in 2.2.8.1.2.2.2 MS-RDPBCGR.

     

       We will update the documentation for these structures in the next release of MS-RDPBCGR.

     

    Thanks!

     


    Hongwei Sun -MSFT
    Thursday, July 7, 2011 3:16 AM

All replies

  • Hi, Greg,

       Thanks for your question. One of team members will work on it and respond to you soon.

     

     

     


    Hongwei Sun -MSFT
    Wednesday, June 22, 2011 3:06 PM
  • Hi, Greg,

     

       We have completed the investigation regarding triggering a WM_KEYUP event on the RDP server.   There is a problem with the documentation of the Unicode Keyboard Event in  section 2.2.8.1.1.3.1.1.2 MS-RDPBCGR.  The first two bytes (pad2OctestsA) is documented as ignored.   This is not correct.   The KBDFLAGS_RELEASE bit (0x8000) in this field is used the same way as in normal keyboard event in    2.2.8.1.1.3.1.1.1 MS-RDPBCGR.  With this said, you can use this bit to indicate the a key release event in PDU to get the proper WM_KEYUP in server.    You probably never set  this bit in the first two bytes.   This can also explain why you always got Key Down events.

     

      There is a similar problem with fast path Unicode keyboard event in 2.2.8.1.2.2.2 MS-RDPBCGR.

     

       We will update the documentation for these structures in the next release of MS-RDPBCGR.

     

    Thanks!

     


    Hongwei Sun -MSFT
    Thursday, July 7, 2011 3:16 AM
  • Thank you, Hongwei Sun. It works properly now.

    Best regards,

    Greg

     

    Thursday, July 7, 2011 9:05 AM