Scaling configuration file

Scaling configuration file

The scaling configuration file is a free-form ASCII text file is used by the mtouch service. The file can contain extra tabs and blank lines for formatting purposes. Keywords in the file are case-sensitive. Comments can be placed anywhere within the file (except within quotes). Comments begin with the # character and finish at the end of that line.

By default, the mtouch service expects scaling configuration file to be named scaling.conf and located at /etc/system/config. This file is board-specific and therefore part of the Board Support Package (BSP) for the board you want to use.

If your scaling configuration isn't located at the above location or isn't named scaling.conf, you use can use the scaling parameter in your touch configuration file to specify a different location and name. For more information, see the mtouch chapter in this guide.

You can define a mode for each of the touch coordinates using the scaling.conf file. You can define one mode per configuration. The mode recommended is the scale mode configured with the resolution of your display. For example, the entry in the scaling.conf file looks like this:

The mode defaults to direct for the following reasons:

The most common modes that are used are direct and scale. These are the modes supported:

Touch coordinates are scaled and shifted based on calibration data. This is a mechanism to provide manual calibration. This option allows you to provide four points for the four corners. Based on those points, a simple algorithm is used to do calibration. These points should be near the four corners but not on the extreme corner, but rather about half an inch out from the corner.
Here are the parameters you can use to scale and shift:
  • disp_x=[X1:X2:X3:X4]
  • disp_y=[Y1:Y2:Y3:Y4]
  • mtouch_x=[mX1:mX2:mX3:mX4]
  • mtouch_y=[mY1:mY2:mY3:mY4]
For example, to scale based on calibration data:

For information about other ways to calibrate touch on your system, see Calibrating touch.”

The touch coordinates are scaled and then shifted based on the physical dimensions of the touch display.
You can specify how the coordinates are scaled using these parameters which are comma-delimited:
  • width_mm=w_scale
  • height_mm=h_scale
You can specify how the coordinates are shifted using these parameters, which are comma-delimited:
  • border_left_mm=bl_coord
  • border_right_mm=br_coord
  • border_top_mm=bt_coord
  • border_bottom=btcoord
For example, to scale based on physical dimensions of the display:
the touch coordinates are reported exactly as they come in from the driver.
For example, to perform no scaling to match a display resolution of 1280x768:
The touch coordinates are ignored if they fall outside the specified(centered) rectangle. The coordinates are also rebased at the upper left corner of the rectangle. The offset represents the offset of the upper left corner of the rectangle relative to the upper left corner of the display.
You specify the offsets using the parameters, which are comma-delimited:
  • offset_x=x_offset
  • offset_y=y_offset
For example, to scale to a centered rectangle on a 1920x1080 touchscreen on resolution on the display of 1312 x 800:
Note: If you scaling for VMware, here's how the offsets are calculated: example, offset_x = (1920 / 2) - (1312 / 2), offset_y = (1080 / 2) - (800 / 2)
The touch coordinates are scaled by the Touch service to the resolution of the client's display.
For example, to scale to resolution on the display:
Touch coordinates are scaled based on the physical specifications of the touch panel. This shouldn't be confused with the physical dimensions of the touch display. This parameter is useful for reducing the size of the usable area. For example, if your display had a bezel on it or you wanted the outer edge of the touchscreen to be ignored, the coordinates you define allows you to create a small touch area that reports data only within that defined area. You would know the values by running the driver in mode:direct.
Here are the parameters you can use to define the coordinates of the area:
  • offset_bottom_tp=bottom_spec
  • offset_top_tp=top_spec
  • offset_left_tp=left_spec
  • offset_right_tp=right_spec
For example, to scale based on the touch panel specifications: