xbmc/xbmc — pull request #1763 by jonfabe (2012-11-11 00:33:14+00:00)
Title: Extend Event Server to better emulate keyboard presses

1) Implemented a new extended button packet in the event server to allow modifier keys to be sent.
-> Old button packet (PT_BUTTON) left unmodified for backward compatibility
-> New button backet (PT_BUTTON_EXTENDED) changes button code to 4 bytes instead of 2 bytes

2) Added additional logic to Key.cpp class to populate the m_vkey, m_ascii, and m_modifiers fields of the CKey class when an ASCII or VKEY is sent over the event server.

Taken together, these changes allow emulated keyboard presses to be sent over the event server to XBMC (and to be correctly handled).

These changes should have little to no impact on existing event server clients as it preserves the old functionality of the event server.
-> Exception: If an event client is sending an ASCII encoded value (has the flag 0xf100) between 0x61 and 0x7a and expecting it to be handled as a VKEY (flag 0xf000) instead (corresponding to numberpad operations) it will fail as this patch will change the lowercase ascii value to the correct VKey value (which corresponds to the uppercase equivalent ascii value). This shouldn't be a problem, however, as all the event server client would need to do is correct their implementation is to send the correct flag (0xf000) instead of the incorrect flag (0xf100).