<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://wiki.radxa.com/mw/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.radxa.com/mw/index.php?action=history&amp;feed=atom&amp;title=Rock5%2Fguide%2FTouch_Screen_Portable_Monitor</id>
		<title>Rock5/guide/Touch Screen Portable Monitor - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.radxa.com/mw/index.php?action=history&amp;feed=atom&amp;title=Rock5%2Fguide%2FTouch_Screen_Portable_Monitor"/>
		<link rel="alternate" type="text/html" href="https://wiki.radxa.com/mw/index.php?title=Rock5/guide/Touch_Screen_Portable_Monitor&amp;action=history"/>
		<updated>2026-06-14T03:10:08Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.23.3</generator>

	<entry>
		<id>https://wiki.radxa.com/mw/index.php?title=Rock5/guide/Touch_Screen_Portable_Monitor&amp;diff=9504&amp;oldid=prev</id>
		<title>Yanw: /* FAQ */</title>
		<link rel="alternate" type="text/html" href="https://wiki.radxa.com/mw/index.php?title=Rock5/guide/Touch_Screen_Portable_Monitor&amp;diff=9504&amp;oldid=prev"/>
				<updated>2023-04-12T11:01:31Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;FAQ&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 11:01, 12 April 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 42:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 42:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===FAQ===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===FAQ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;how to rotate the screen.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; Modify the value of SF_PRIMARY_DISPLAY_ORIENTATION in device/rockchip/rk3588/BoardConfig.mk&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#160; &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#160; - SF_PRIMARY_DISPLAY_ORIENTATION := 0&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#160; + SF_PRIMARY_DISPLAY_ORIENTATION := 270&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The touch screen cannot rotate with the screen.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The touch screen cannot rotate with the screen.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; Add a patch to the framework/native directory,the content is as follows&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; Add a patch to the framework/native directory,the content is as follows&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Yanw</name></author>	</entry>

	<entry>
		<id>https://wiki.radxa.com/mw/index.php?title=Rock5/guide/Touch_Screen_Portable_Monitor&amp;diff=9474&amp;oldid=prev</id>
		<title>Yanw: Created page with &quot;This page is how rock5 created the IDC file for Touch Screen Portable Monitor  ===What is idc?=== idc (Input Device Configuration) is an input device configuration file, which...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.radxa.com/mw/index.php?title=Rock5/guide/Touch_Screen_Portable_Monitor&amp;diff=9474&amp;oldid=prev"/>
				<updated>2023-04-03T10:04:51Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;This page is how rock5 created the IDC file for Touch Screen Portable Monitor  ===What is idc?=== idc (Input Device Configuration) is an input device configuration file, which...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This page is how rock5 created the IDC file for Touch Screen Portable Monitor&lt;br /&gt;
&lt;br /&gt;
===What is idc?===&lt;br /&gt;
idc (Input Device Configuration) is an input device configuration file, which contains device-specific configuration attributes that affect the behavior of the input device. For touch screen devices, an idc file is always required to define its behavior.&lt;br /&gt;
&lt;br /&gt;
===How to edit IDC files===&lt;br /&gt;
&lt;br /&gt;
Confirm the VID and PID of the Touch Screen.&lt;br /&gt;
&lt;br /&gt;
   $ lsusb&lt;br /&gt;
   Bus 002 Device 005: ID 27c0:0858&lt;br /&gt;
&lt;br /&gt;
Name the IDC file according to the ID.&lt;br /&gt;
   $ ls /system/usr/idc&lt;br /&gt;
   Vendor_27c0_Product_0858.idc&lt;br /&gt;
&lt;br /&gt;
Edit IDC file&lt;br /&gt;
&lt;br /&gt;
   $ cat Vendor_27c0_Product_0858.idc&lt;br /&gt;
   touch.deviceType = touchScreen&lt;br /&gt;
   device.internal= 1&lt;br /&gt;
   touch.orientationAware = 1&lt;br /&gt;
   keyboard.layout = Vendor_27c0_Product_0858&lt;br /&gt;
   keyboard.orientationAware = 1&lt;br /&gt;
   cursor.mode = navigation&lt;br /&gt;
   cursor.orientationAware = 1&lt;br /&gt;
&lt;br /&gt;
The specific attribute configuration of the file can refer to https://source.android.com/docs/core/interaction/input/input-device-configuration-files&lt;br /&gt;
&lt;br /&gt;
===How to load IDC file===&lt;br /&gt;
Create an IDC file under the device/rockchip/rk3588 directory of the SDK.&lt;br /&gt;
&lt;br /&gt;
  $ vim  Vendor_27c0_Product_0858.idc&lt;br /&gt;
&lt;br /&gt;
Add in the device.mk file.&lt;br /&gt;
  PRODUCT_COPY_FILES += $(LOCAL_PATH)/Vendor_27c0_Product_0858.idc:$(TARGET_COPY_OUT_SYSTEM)/usr/idc/Vendor_27c0_Product_0858.idc&lt;br /&gt;
&lt;br /&gt;
Recompile the firmware.&lt;br /&gt;
  $ source build/envsetup.sh&lt;br /&gt;
  $ lunch ${PRODUCT_NAME}-userdebug&lt;br /&gt;
  $ ./build.sh -Au&lt;br /&gt;
&lt;br /&gt;
===FAQ===&lt;br /&gt;
The touch screen cannot rotate with the screen.&lt;br /&gt;
  Add a patch to the framework/native directory,the content is as follows&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
  diff --git a/services/inputflinger/reader/mapper/TouchInputMapper.cpp b/services/inputflinger/reader/mapper/TouchInputMapper.cpp&lt;br /&gt;
  index decbea4c3e..42c4612159 100644&lt;br /&gt;
  --- a/services/inputflinger/reader/mapper/TouchInputMapper.cpp&lt;br /&gt;
  +++ b/services/inputflinger/reader/mapper/TouchInputMapper.cpp&lt;br /&gt;
  @@ -17,7 +17,7 @@&lt;br /&gt;
  #include &amp;quot;../Macros.h&amp;quot;&lt;br /&gt;
   &lt;br /&gt;
  #include &amp;quot;TouchInputMapper.h&amp;quot;&lt;br /&gt;
  -&lt;br /&gt;
  +#include &amp;quot;cutils/properties.h&amp;quot;&lt;br /&gt;
   #include &amp;quot;CursorButtonAccumulator.h&amp;quot;&lt;br /&gt;
   #include &amp;quot;CursorScrollAccumulator.h&amp;quot;&lt;br /&gt;
   #include &amp;quot;TouchButtonAccumulator.h&amp;quot; &lt;br /&gt;
  @@ -668,6 +668,29 @@ void TouchInputMapper::configureSurface(nsecs_t when, bool* outResetNeeded) {&lt;br /&gt;
     if (viewportChanged) {&lt;br /&gt;
         mViewport = *newViewport;&lt;br /&gt;
 &lt;br /&gt;
  +         char buffer_orientation[270];&lt;br /&gt;
  +        memset(buffer_orientation, 0, sizeof(buffer_orientation));&lt;br /&gt;
  +        property_get(&amp;quot;persist.sys.panel.flip&amp;quot;, buffer_orientation, &amp;quot;270&amp;quot;);&lt;br /&gt;
  +        int cmpRet = atoi(buffer_orientation);&lt;br /&gt;
  +        ALOGE(&amp;quot;persist.sys.hwrotation= %d&amp;quot;,cmpRet);&lt;br /&gt;
  +        if (cmpRet == 0)&lt;br /&gt;
  +        {&lt;br /&gt;
  +            mViewport.orientation = DISPLAY_ORIENTATION_0;&lt;br /&gt;
  +        }&lt;br /&gt;
  +&lt;br /&gt;
  +        else if (cmpRet == 90)&lt;br /&gt;
  +        {&lt;br /&gt;
  +            mViewport.orientation = DISPLAY_ORIENTATION_90;&lt;br /&gt;
  +        }&lt;br /&gt;
  +        else if (cmpRet == 180)&lt;br /&gt;
  +        {&lt;br /&gt;
  +            mViewport.orientation = DISPLAY_ORIENTATION_180;&lt;br /&gt;
  +        }&lt;br /&gt;
  +        else if (cmpRet == 270)&lt;br /&gt;
  +        {&lt;br /&gt;
  +            mViewport.orientation = DISPLAY_ORIENTATION_270;&lt;br /&gt;
  +        }&lt;br /&gt;
  +&lt;br /&gt;
         if (mDeviceMode == DEVICE_MODE_DIRECT || mDeviceMode == DEVICE_MODE_POINTER) {&lt;br /&gt;
             // Convert rotated viewport to natural surface coordinates.&lt;br /&gt;
             int32_t naturalLogicalWidth, naturalLogicalHeight;&lt;br /&gt;
  --&lt;/div&gt;</summary>
		<author><name>Yanw</name></author>	</entry>

	</feed>