]> Zhao Yanbai Git Server - minix.git/commitdiff
Message type for TTY_INPUT_EVENT
authorLionel Sambuc <lionel@minix3.org>
Mon, 26 May 2014 14:34:34 +0000 (16:34 +0200)
committerLionel Sambuc <lionel@minix3.org>
Mon, 28 Jul 2014 15:05:49 +0000 (17:05 +0200)
Change-Id: I2bae0a2c8326b36c438f9b340c394ec66189c1c8

drivers/tty/arch/i386/keyboard.c
include/minix/com.h
include/minix/ipc.h
servers/input/input.c

index 736043edea29fe99638dff68ae80cc5b322a9ad8..0e8a9fc59ec6852ecc176a51ef3580c0b8b79092 100644 (file)
@@ -152,16 +152,16 @@ void do_input(message *msg)
        }
 
        /* Only handle keyboard keys. */
-       if (msg->INPUT_PAGE != INPUT_PAGE_KEY)
+       if (msg->m_input_tty_event.page != INPUT_PAGE_KEY)
                return;
 
        /* Only handle known USB HID keyboard codes (the 00h-E7h range). */
-       scode = msg->INPUT_CODE;
+       scode = msg->m_input_tty_event.code;
        if (scode >= NR_SCAN_CODES)
                return;
 
        /* Is it a KEY RELEASE? */
-       if (msg->INPUT_VALUE == INPUT_RELEASE)
+       if (msg->m_input_tty_event.value == INPUT_RELEASE)
                scode |= RELEASE_BIT;
 
        if (incount < KB_IN_BYTES) {
index 3bde3d3ad2a97e393a046d81e5777761a1a50e20..09d99c0c456a13be6eb2e91bc26be309fcdc46f6 100644 (file)
 /* This message uses no message fields. */
 
 #define TTY_INPUT_EVENT                (TTY_RQ_BASE + 3) /* relayed input event */
-#  define INPUT_PAGE           m7_i2   /* usage page */
-#  define INPUT_CODE           m7_i3   /* usage code */
-#  define INPUT_VALUE          m7_i4   /* event value */
 
 /*===========================================================================*
  *                     Messages for input server and drivers                *
index ee423e56a862f1d4f1e9833a56bf453c44fd81c8..55ddbd7db290dd289000fc39a49c1a47294ab474 100644 (file)
@@ -145,6 +145,17 @@ typedef struct {
 } mess_sigcalls;
 _ASSERT_MSG_SIZE(mess_sigcalls);
 
+typedef struct {
+       int id;
+       int page;
+       int code;
+       int value;
+       int flags;
+
+       uint8_t padding[36];
+} mess_input_tty_event;
+_ASSERT_MSG_SIZE(mess_input_tty_event);
+
 typedef struct {
        time_t acnt_queue;
 
@@ -1616,6 +1627,8 @@ typedef struct {
                mess_notify             m_notify;
                mess_sigcalls           m_sigcalls;
 
+               mess_input_tty_event    m_input_tty_event;
+
                mess_krn_lsys_schedule  m_krn_lsys_schedule;
                mess_krn_lsys_sys_fork m_krn_lsys_sys_fork;
                mess_krn_lsys_sys_getwhoami m_krn_lsys_sys_getwhoami;
index 6390255fec500dd4f3792ea4b0e2a06c6dbf4bc5..089e779b959fce9e681b0294d350b9106f0f49a5 100644 (file)
@@ -406,9 +406,17 @@ input_event(message *m)
        else if (mux_dev->opened)
                input_process(mux_dev, m);
        else {
-               m->m_type = TTY_INPUT_EVENT;
+               message fwd;
+               mess_input_tty_event *tty_event = &(fwd.m_input_tty_event);
 
-               if ((r = ipc_send(TTY_PROC_NR, m)) != OK)
+               fwd.m_type = TTY_INPUT_EVENT;
+               tty_event->id = m->m_linputdriver_input_event.id;
+               tty_event->page = m->m_linputdriver_input_event.page;
+               tty_event->code = m->m_linputdriver_input_event.code;
+               tty_event->value = m->m_linputdriver_input_event.value;
+               tty_event->flags = m->m_linputdriver_input_event.flags;
+
+               if ((r = ipc_send(TTY_PROC_NR, &fwd)) != OK)
                        printf("INPUT: send to TTY failed (%d)\n", r);
        }
 }