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

Search This thread

AndroPlus

Senior Member
Mar 13, 2013
1,720
3,992
Kyoto
androplus.org
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.
https://drive.google.com/open?id=0B0j3VJ1Xp5N8ZWtYVlRRYWNPSWM

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.
https%3A%2F%2Fforum.xda-developers.com%2Fimg.xda-cdn.com%2F3psQZNR6iMeCfoBbGC_5CsqK-qI%3D%2Fhttps%253A%252F%252Fforum.xda-developers.com%252Fimg.xda-cdn.com%252F6Xmqv68Q_UGmFCvylGTImd3CaEE%253D%252Fhttp%25253A%25252F%25252Fi.imgur.com%25252FdhlBCBa.png

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.
 
Last edited:

ImAnurag

Senior Member
Aug 10, 2011
1,067
476
New Delhi
GizmoBolt.com
Sony Xperia 10 II
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...
dhlBCBa.png


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 ?
 

celeritykid

Senior Member
Jul 10, 2010
108
43
Changed 0 to 1 in sys/devices/virtual/input/clearpad/pen
Too bad it didn't work with plastic
 

Attachments

  • Screenshot_2014-02-18-18-36-02.png
    Screenshot_2014-02-18-18-36-02.png
    217.9 KB · Views: 3,292

secretfile

Senior Member
Nov 27, 2009
329
128
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 :)
 
Last edited:
  • Like
Reactions: victormotac

yaabaa1986

Senior Member
Oct 16, 2011
120
13
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
 
Last edited:
  • Like
Reactions: victormotac

thanhhii

Senior Member
Nov 4, 2012
263
63
Bảo Lộc
Change permission of file to rw-r-rw then you can edit it. Add the lines as specified and save and close the file. Change permissions back to normal rw-r-r.

Sent from my C6903 using Tapatalk

I can edit but after reboot it not work!
The code add still in hw_config but not work

Sent via Honami 6903
 

funky0308

Inactive Recognized Themer
Aug 27, 2012
7,029
5,681
Osijek
Ohh...it's working, it just needed few seconds to start accepting pen...

Nice new feature ;)

Tnx mate...

Sent from my C6903 using Tapatalk
 

Top Liked Posts

  • There are no posts matching your filters.
  • 108
    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.
    https://drive.google.com/open?id=0B0j3VJ1Xp5N8ZWtYVlRRYWNPSWM

    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.
    https%3A%2F%2Fforum.xda-developers.com%2Fimg.xda-cdn.com%2F3psQZNR6iMeCfoBbGC_5CsqK-qI%3D%2Fhttps%253A%252F%252Fforum.xda-developers.com%252Fimg.xda-cdn.com%252F6Xmqv68Q_UGmFCvylGTImd3CaEE%253D%252Fhttp%25253A%25252F%25252Fi.imgur.com%25252FdhlBCBa.png

    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.
    7
    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:
    dza0Wfz.png


    Please try my toggle app, this will change pen's 0 to 1.
    http://d-h.st/5az
    7
    And I get no credit for finding it, and adding it to XperiaSettings app first :crying: :crying:

    Haha. Just kidding.
    Nice to see someone wrote up all the instructions and got the tasker app for stock too. :cowboy: I was about to open a thread to mention this can be done on stock too, but I had work and forgot about it. Thank you for posting this.

    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, 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 at the bottom of 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...

    [UPDATE]
    I created pen mode enable/disable toggle app with Tasker.
    http://d-h.st/mZl

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


    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.
    4
    I update my app's toggle method, it uses "cat /sys/devices/virtual/input/clearpad/pen" now.
    http://d-h.st/mZl

    I recommend changing one value in /system/usr/idc/clearpad_pen.idc for more sensitivity.
    With default settings, it made broken lines (due to screen not rsponed to touch) when I write something but 0.1 is fine for me.
    Change
    Code:
    # Pressure
    touch.pressure.scale = 0.2
    to
    Code:
    # Pressure
    touch.pressure.scale = 0.1
    3
    this is a video I made showing the phone while using this mod! thank you so much! it is awesome !

    https://www.youtube.com/watch?v=bdXi07KpWHE
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone