static BOOL
e_rdp_input_keyboard_event(rdpInput *input, UINT16 flags, UINT16 code)
{
- //To do
+ uint32_t full_code;
+ int notify = 0;
+ int key_state = 0;
+ char name[16] = {0,};
+
+ E_Rdp_Peer_Context *peerContext = (E_Rdp_Peer_Context *)input->context;
+
+ if (!(peerContext->item.flags & RDP_PEER_ACTIVATED))
+ return TRUE;
+
+ if (flags & KBD_FLAGS_DOWN)
+ {
+ key_state = E_INFO_EVENT_STATE_PRESS;
+ notify = 1;
+ }
+ else if (flags & KBD_FLAGS_RELEASE)
+ {
+ key_state = E_INFO_EVENT_STATE_RELEASE;
+ notify = 1;
+ }
+
+ if (notify)
+ {
+ full_code = code;
+ DBG("rdp key kernel fullcode = %d\n", full_code);
+
+ // Todo. check extended role
+
+ e_info_server_input_keygen(name, full_code + 8, key_state);
+ }
+
return TRUE;
}