Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,770,562 Members 37,799 Now Online
XDA Developers Android and Mobile Development Forum

Enable Pen Mode - Any pen or pencil works as stylus!

Tip us?
 
RyokoN
Old
(Last edited by RyokoN; 3rd March 2014 at 12:26 AM.)
#1  
RyokoN's Avatar
Senior Member - OP
Thanks Meter 846
Posts: 405
Join Date: Mar 2013

 
DONATE TO ME
Phone Enable Pen Mode - Any pen or pencil works as stylus!

AOKP introduced pen mode for Z1 and I could enable it on stock ROM!
Xperia Z Ultra can use the pen or pencil made of wood or metal as stylus, but Z1's screen also supports it and Sony disabled it for some reason.

root is needed to enable this.

To enable pen mode, there's three methods.
One of them is enough.
● Create init.d script in /system/etc/init.d (requires init.d support):
Code:
#!/system/bin/sh
chown system:system /sys/devices/virtual/input/clearpad/pen
echo 1 > /sys/devices/virtual/input/clearpad/pen
● Add these lines at the bottom of /system/etc/hw_config.sh:
Code:
chown system:system /sys/devices/virtual/input/clearpad/pen
echo 1 > /sys/devices/virtual/input/clearpad/pen
● Use toggle app
I created pen mode enable/disable toggle app with Tasker.
http://d-h.st/mZl

Now you can use anything made of wood, metal or rubber.
I couldn't use a plastic pen, though...

I recommend changing one value in /system/usr/idc/clearpad_pen.idc for more accuracy.
Change
Code:
# Pressure
touch.pressure.scale = 0.2
to
Code:
# Pressure
touch.pressure.scale = 0.1
works for me.

In /sys/devices/virtual/input/clearpad/,
there is "grove" but I could only show circle with pen and I couldn't use with glove.
http://i.imgur.com/RibpIAi.png

Thanks championswimmer for finding this.
The Following 88 Users Say Thank You to RyokoN For This Useful Post: [ Click to Expand ]
 
ImAnurag
Old
#2  
ImAnurag's Avatar
Senior Member
Thanks Meter 387
Posts: 864
Join Date: Aug 2011
Location: New Delhi

 
DONATE TO ME
Quote:
Originally Posted by RyokoN View Post
AOKP introduced pen mode for Z1 and I could enable it on stock ROM!
Xperia Z Ultra can use the pen or pencil made of wood or metal as stylus, but Z1's screen also supports it and Sony disabled it for some reason.

To enable pen mode, create init.d script:
Code:
#!/system/bin/sh
chown system:system /sys/devices/virtual/input/clearpad/pen
echo 1 > /sys/devices/virtual/input/clearpad/pen
or add these lines to hw_config.sh:
Code:
chown system:system /sys/devices/virtual/input/clearpad/pen
echo 1 > /sys/devices/virtual/input/clearpad/pen
Now you can use anything made of wood, metal or rubber.
I couldn't use a plastic pen, though...


In /sys/devices/virtual/input/clearpad/,
there is "grove" but I could only show circle with pen and I couldn't use with glove.
http://i.imgur.com/RibpIAi.png

Thanks AOKP for infomation.
where to add the lines in hw_config.sh , at bottom ?

Anyone tried it ?
Xperia Z1 C6902 <14.2.A.1.136> | Xperia SP C5302 <12.0.A.2.254 >
Xperia SL LT26ii <6.2.B.1.96> | Nexus 7 2013 LTE <4.4.2 KOT49H>
The Following 2 Users Say Thank You to ImAnurag For This Useful Post: [ Click to Expand ]
 
secretfile
Old
#3  
secretfile's Avatar
Senior Member
Thanks Meter 129
Posts: 325
Join Date: Nov 2009
Location: Nis
Quote:
Originally Posted by ImAnurag View Post
where to add the lines in hw_config.sh , at bottom ?

Anyone tried it ?
I tried in hw and in init.d, but it doesn't work, also clearpad doesn't look like folder when i browse with root explorer it looks like file??
Device - Xperia Z1
Rom - Custom 4.4
 
celeritykid
Old
#4  
Senior Member
Thanks Meter 43
Posts: 102
Join Date: Jul 2010
Changed 0 to 1 in sys/devices/virtual/input/clearpad/pen
Too bad it didn't work with plastic
Attached Thumbnails
Click image for larger version

Name:	Screenshot_2014-02-18-18-36-02.png
Views:	1928
Size:	217.9 KB
ID:	2586269  
 
RyokoN
Old
#5  
RyokoN's Avatar
Senior Member - OP
Thanks Meter 846
Posts: 405
Join Date: Mar 2013

 
DONATE TO ME
Quote:
Originally Posted by ImAnurag View Post
where to add the lines in hw_config.sh , at bottom ?

Anyone tried it ?
Yes, bottom is safe to add.
 
RyokoN
Old
#6  
RyokoN's Avatar
Senior Member - OP
Thanks Meter 846
Posts: 405
Join Date: Mar 2013

 
DONATE TO ME
Quote:
Originally Posted by secretfile View Post
I tried in hw and in init.d, but it doesn't work, also clearpad doesn't look like folder when i browse with root explorer it looks like file??
clearpad folder looks like this:


Please try my toggle app, this will change pen's 0 to 1.
http://d-h.st/5az
The Following 7 Users Say Thank You to RyokoN For This Useful Post: [ Click to Expand ]
 
pemith
Old
#7  
pemith's Avatar
Senior Member
Thanks Meter 93
Posts: 198
Join Date: Mar 2013
Location: Kandy

 
DONATE TO ME
Quote:
Originally Posted by RyokoN View Post
clearpad folder looks like this:


Please try my toggle app, this will change pen's 0 to 1.
http://d-h.st/5az
it works perfectly mate....thank you
 
secretfile
Old
(Last edited by secretfile; 18th February 2014 at 12:31 PM.)
#8  
secretfile's Avatar
Senior Member
Thanks Meter 129
Posts: 325
Join Date: Nov 2009
Location: Nis
It was root explorer that cose problem with folder,
with es explorer i can see inside folder and there is pen file with content 1 but i tried with ball pen and it didn't work,
could this be because of screen protector?

Ok it works now strange there is part of screen where it doesn't detect pen.

OP - good job
Device - Xperia Z1
Rom - Custom 4.4
The Following User Says Thank You to secretfile For This Useful Post: [ Click to Expand ]
 
yaabaa1986
Old
(Last edited by yaabaa1986; 18th February 2014 at 01:36 PM.)
#9  
Senior Member
Thanks Meter 12
Posts: 116
Join Date: Oct 2011
Is a flashable zip possible for stock based roms?

Edit: the apk worked perfect, thanks mate...!

Sent from my C6903 using XDA Premium 4 mobile app
The Following User Says Thank You to yaabaa1986 For This Useful Post: [ Click to Expand ]
 
thanhhii
Old
#10  
thanhhii's Avatar
Senior Member
Thanks Meter 63
Posts: 263
Join Date: Nov 2012
Location: Bảo Lộc
@RyokoN
I have Changed 0 to 1 in sys/devices/virtual/input/clearpad/pen => needn''t to reboot => WORK
But after reboot NOT WORK and i check the value it back to 0 again?????

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes