Scaling configuration file
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
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.
- dim
- The touch coordinates are scaled and then shifted based on the physical dimensions of the touch display.
- direct
- the touch coordinates are reported exactly as they come in from the driver.
- 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.
- scale
- The touch coordinates are scaled by the Touch service to the resolution of the client's display.
- 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.