Index: uspace/srv/hid/display/input.c
===================================================================
--- uspace/srv/hid/display/input.c	(revision 5fae1237429d6d7f6e5c59d4a0b9c9e56446a466)
+++ uspace/srv/hid/display/input.c	(revision 5fae1237429d6d7f6e5c59d4a0b9c9e56446a466)
@@ -0,0 +1,147 @@
+/*
+ * Copyright (c) 2019 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup display
+ * @{
+ */
+/** @file Input events
+ */
+
+#include <errno.h>
+#include <io/input.h>
+#include <loc.h>
+#include <stdio.h>
+#include <str_error.h>
+#include "display.h"
+#include "input.h"
+#include "main.h"
+
+static errno_t ds_input_ev_active(input_t *);
+static errno_t ds_input_ev_deactive(input_t *);
+static errno_t ds_input_ev_key(input_t *, kbd_event_type_t, keycode_t, keymod_t, wchar_t);
+static errno_t ds_input_ev_move(input_t *, int, int);
+static errno_t ds_input_ev_abs_move(input_t *, unsigned, unsigned, unsigned, unsigned);
+static errno_t ds_input_ev_button(input_t *, int, int);
+
+static input_ev_ops_t ds_input_ev_ops = {
+	.active = ds_input_ev_active,
+	.deactive = ds_input_ev_deactive,
+	.key = ds_input_ev_key,
+	.move = ds_input_ev_move,
+	.abs_move = ds_input_ev_abs_move,
+	.button = ds_input_ev_button
+};
+
+static errno_t ds_input_ev_active(input_t *input)
+{
+	return EOK;
+}
+
+static errno_t ds_input_ev_deactive(input_t *input)
+{
+	return EOK;
+}
+
+static errno_t ds_input_ev_key(input_t *input, kbd_event_type_t type,
+    keycode_t key, keymod_t mods, wchar_t c)
+{
+	ds_display_t *disp = (ds_display_t *) input->user;
+	kbd_event_t event;
+
+	printf("ds_input_ev_key\n");
+	event.type = type;
+	event.key = key;
+	event.mods = mods;
+	event.c = c;
+
+	return ds_display_post_kbd_event(disp, &event);
+}
+
+static errno_t ds_input_ev_move(input_t *input, int dx, int dy)
+{
+	return EOK;
+}
+
+static errno_t ds_input_ev_abs_move(input_t *input, unsigned x, unsigned y,
+    unsigned max_x, unsigned max_y)
+{
+	return EOK;
+}
+
+static errno_t ds_input_ev_button(input_t *input, int bnum, int bpress)
+{
+	return EOK;
+}
+
+/** Open input service.
+ *
+ * @param display Display
+ * @return EOK on success or an error code
+ */
+errno_t ds_input_open(ds_display_t *display)
+{
+	async_sess_t *sess;
+	service_id_t dsid;
+	const char *svc = "hid/input";
+
+	printf("ds_input_open\n");
+	errno_t rc = loc_service_get_id(svc, &dsid, 0);
+	if (rc != EOK) {
+		printf("%s: Input service %s not found\n", NAME, svc);
+		return rc;
+	}
+
+	sess = loc_service_connect(dsid, INTERFACE_INPUT, 0);
+	if (sess == NULL) {
+		printf("%s: Unable to connect to input service %s\n", NAME,
+		    svc);
+		return EIO;
+	}
+
+	rc = input_open(sess, &ds_input_ev_ops, (void *) display,
+	    &display->input);
+	if (rc != EOK) {
+		async_hangup(sess);
+		printf("%s: Unable to communicate with service %s (%s)\n",
+		    NAME, svc, str_error(rc));
+		return rc;
+	}
+
+	input_activate(display->input);
+	printf("ds_input_open: DONE\n");
+	return EOK;
+}
+
+void ds_input_close(ds_display_t *display)
+{
+	input_close(display->input);
+	display->input = NULL;
+}
+
+/** @}
+ */
Index: uspace/srv/hid/display/input.h
===================================================================
--- uspace/srv/hid/display/input.h	(revision 5fae1237429d6d7f6e5c59d4a0b9c9e56446a466)
+++ uspace/srv/hid/display/input.h	(revision 5fae1237429d6d7f6e5c59d4a0b9c9e56446a466)
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2019 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup display
+ * @{
+ */
+/** @file Input events
+ */
+
+#ifndef INPUT_H
+#define INPUT_H
+
+#include <errno.h>
+#include <io/kbd_event.h>
+#include <io/pos_event.h>
+#include "types/display/display.h"
+
+extern errno_t ds_input_open(ds_display_t *);
+extern void ds_input_close(ds_display_t *);
+
+#endif
+
+/** @}
+ */
Index: uspace/srv/hid/display/main.c
===================================================================
--- uspace/srv/hid/display/main.c	(revision 87a7cdb3ff40f9795359f6da489d45a3fafee668)
+++ uspace/srv/hid/display/main.c	(revision 5fae1237429d6d7f6e5c59d4a0b9c9e56446a466)
@@ -50,4 +50,5 @@
 #include "display.h"
 #include "dsops.h"
+#include "input.h"
 #include "main.h"
 #include "output.h"
@@ -61,18 +62,4 @@
 	.ev_pending = display_client_ev_pending
 };
-
-static void display_kbd_event(void *arg, kbd_event_t *event)
-{
-	ds_display_t *disp = (ds_display_t *) arg;
-
-	ds_display_post_kbd_event(disp, event);
-}
-
-static void display_pos_event(void *arg, pos_event_t *event)
-{
-	ds_display_t *disp = (ds_display_t *) arg;
-
-	ds_display_post_pos_event(disp, event);
-}
 
 static void display_client_ev_pending(void *arg)
@@ -102,11 +89,9 @@
 		goto error;
 
-#if 0
 	rc = ds_input_open(disp);
 	if (rc != EOK)
 		goto error;
-#endif
-	rc = ds_output_create(display_kbd_event, (void *) disp,
-	    display_pos_event, (void *) disp, &output);
+
+	rc = ds_output_create(&output);
 	if (rc != EOK)
 		goto error;
Index: uspace/srv/hid/display/meson.build
===================================================================
--- uspace/srv/hid/display/meson.build	(revision 87a7cdb3ff40f9795359f6da489d45a3fafee668)
+++ uspace/srv/hid/display/meson.build	(revision 5fae1237429d6d7f6e5c59d4a0b9c9e56446a466)
@@ -34,4 +34,5 @@
 	'display.c',
 	'dsops.c',
+	'input.c',
 	'main.c',
 	'output.c',
Index: uspace/srv/hid/display/output.c
===================================================================
--- uspace/srv/hid/display/output.c	(revision 87a7cdb3ff40f9795359f6da489d45a3fafee668)
+++ uspace/srv/hid/display/output.c	(revision 5fae1237429d6d7f6e5c59d4a0b9c9e56446a466)
@@ -44,22 +44,4 @@
 #include "ddev.h"
 #include "output.h"
-
-#if 0
-static void (*kbd_ev_handler)(void *, kbd_event_t *);
-static void *kbd_ev_arg;
-static void (*pos_ev_handler)(void *, pos_event_t *);
-static void *pos_ev_arg;
-
-static void on_keyboard_event(widget_t *widget, void *data)
-{
-	printf("Keyboard event\n");
-	kbd_ev_handler(kbd_ev_arg, (kbd_event_t *) data);
-}
-
-static void on_position_event(widget_t *widget, void *data)
-{
-	pos_ev_handler(pos_ev_arg, (pos_event_t *) data);
-}
-#endif
 
 /** Check for new display devices.
@@ -140,14 +122,8 @@
 /** Create display server output.
  *
- * @param kbd_event_handler
- * @param karg
- * @param pos_event_handler
- * @param parg
  * @param routput Place to store pointer to display server output object.
  * @return EOK on success or an error code
  */
-errno_t ds_output_create(void (*kbd_event_handler)(void *, kbd_event_t *),
-    void *karg, void (*pos_event_handler)(void *, pos_event_t *),
-    void *parg, ds_output_t **routput)
+errno_t ds_output_create(ds_output_t **routput)
 {
 	ds_output_t *output;
Index: uspace/srv/hid/display/output.h
===================================================================
--- uspace/srv/hid/display/output.h	(revision 87a7cdb3ff40f9795359f6da489d45a3fafee668)
+++ uspace/srv/hid/display/output.h	(revision 5fae1237429d6d7f6e5c59d4a0b9c9e56446a466)
@@ -42,6 +42,5 @@
 #include "types/display/output.h"
 
-extern errno_t ds_output_create(void (*)(void *, kbd_event_t *),
-    void *, void (*)(void *, pos_event_t *), void *, ds_output_t **);
+extern errno_t ds_output_create(ds_output_t **);
 extern errno_t ds_output_start_discovery(ds_output_t *);
 extern void ds_output_destroy(ds_output_t *);
