e_mod_rdp : implement rdp keyboard event using e_info_server api 58/269658/8
authordyamy-lee <dyamy.lee@samsung.com>
Thu, 20 Jan 2022 01:53:04 +0000 (10:53 +0900)
committerdyamy-lee <dyamy.lee@samsung.com>
Thu, 27 Jan 2022 08:56:52 +0000 (17:56 +0900)
Change-Id: I8fdf0ef6518cb6ada88a2b36f8b371c754955699

src/e_mod_rdp.c

index e7d2892..f58a530 100644 (file)
@@ -1081,7 +1081,37 @@ e_rdp_extended_mouse_event(rdpInput *input, UINT16 flags, UINT16 x, UINT16 y)
 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;
 }