The mtouch service starts the resource managers for touch functionality and loads the configuration


mtouch [-c configfile] [-d] [-q queuebool] [-r] [-U user] [-v]

Runs on:

QNX Neutrino


-c configfile
Specify the location of the configuration file for mtouch resource manager (driver). If you don't specify the -c option, mtouch uses /etc/system/config/mtouch.conf as the default.
Enable debug mode. This allows you run this driver without having the service running. Using this option is useful if you function in verbose mode and want to see the slog2info with the coordinate information from the touch driver.
Disable event queue for touch. This means that you won't see any touch events when you touch the display. By default, this is set to 1(enabled); to disable it, set it 0 (zero).
Enable resource managers so that you can access information associated with touch events without using the Screen API. For example:
mtouch -rd
ls /dev/mtouch/


This information that's associated with the touch driver (e.g., touch_display0) is presented as a data structure of type mtouch_event_t. The information includes:

  • event type
  • timestamp
  • sequence identifier
  • contact identifier
  • x coordinate
  • y coordinate
  • width
  • height
  • orientation
  • pressure
  • contact type
  • selected buttons
See mtouch_event for details.

To retrieve the touch event information, you can open resource manager and read the file descriptor. For example:

int fd, nCount;
mtouch_event_t touch_packet;
fd = open("/dev/mtouch/touch_display0", O_RDWR | O_NONBLOCK);
		nCount = read(fd, &touch_packet, sizeof(touch_packet));
		if (0 >= nCount) {
			delay (100);
		} else {
			printf("Timestamp: %llu  Sequence ID: %u  Contact ID:%d X:%u, Y:%u Event: ",

			switch (touch_packet.event_type) {
				printf("Touch event.\n");
				printf("Move event.\n");
				printf("Release event.\n");
	return 0;
Enable verbose mode. In this mode, per-event coordinates are printed that include the x, y coordinates of the input region and the coordinates that are mapped to the display. In addition, the width and height relate to size of the touched area, provided the hardware supports it. For example, a 1 represents a small area (such a your pinkie finger) and a larger area, such as a (such as a thumb or index finger). Here's what an event looks like where the user provided touch input at coordinates (around 20 (x-value) and 400 (y-value)) on the display:
Nov 09 15:38:16  5  9   200 touch_display[INFO]: x 21 y 400 width 1 height 1
Nov 09 15:38:16  5  9   200 touch_display[INFO]: x 22 y 410 width 1 height 1
Nov 09 15:38:16  5  9   200 touch_display[INFO]: x 19 y 413 width 1 height 1
Nov 09 15:38:16  5  9   200 touch_display[INFO]: x 23 y 402 width 1 height 1
Nov 09 15:38:16  5  9   200 touch_display[INFO]: x 20 y 401 width 1 height 1


The mtouch service starts the touch drivers that are specified in the mtouch.conf file. To run this service, you must first have Screen started. Other dependencies may vary based on your touch device.


Use a Human Interface Device (HID) that uses a USB-based controller:

  1. You need to ensure that the shared objects and configuration files that mtouch depends on are included in your system image. For example:

    • scaling.conf
    • mtouch.conf

    See the Shared libraries section of the Building Embedded Systems guide for more information on how to determine which shared objects you need.

  2. On your target system, you typically require the USB drivers to be started before touch can be used. For example:

    io-usb-otg -d hcd-dm816x-mg ioport=0x47401c00,irq=19
  3. Start screen.

  4. Start mtouch.