The scaling configuration file is a free-form ASCII text file that's 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:
1280x720:mode=scale
The
mode defaults to
direct for the following
reasons:
- if you don't define a mode or if the scaling.conf
file doesn't exist
- if no matching display resolution can be found
The most common modes that are used are direct and scale.
These are the modes supported:
- calib
- 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:
1024x600:mode=calib,disp_x=[102:922:922:102],disp_y=[60:60:540:540],
mtouch_x=[172:1108:1108:172],mtouch_y=[110:110:658:658]
For information about other ways to calibrate touch on your system,
see Calibrating touch.
- dim
- 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=bt_coord
- For example, to scale based on physical dimensions of the display:
1024x600:mode=dim,width_mm=154,height_mm=90,border_left_mm=5,
border_right_mm=5,border_top_mm=5,border_bottom_mm=5
- direct
- 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:
1280x768:mode=direct
- rect
- 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:
1312x800:mode=rect,offset_x=304,offset_y=140
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)
- scale
- The touch coordinates are scaled by the Touch service to the
resolution of the client's display.
- For example, to scale the resolution on the display:
1024x600:mode=scale
- spec
- 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:
768x1280:mode=spec,offset_bottom_tp=324,offset_top_tp=20,
offset_left_tp=27,offset_right_tp=27