Check Your I/O Usage with Iotop for Android

Ever needed to check the I/O usage of apps? If so, you probably tried searching for an iotop … more

T-Mobile HTC One M8 Gets Selfie-Friendly Android 4.4.4 OTA

The T-Mobie variant of HTC One (M8) just now received an over-the-air update … more

Android L is for Lockdown

Root is, without a doubt, the (un)holy grail of the Android world. Those wonderful permissions that allow you as … more

XDA Xposed Tuesday: XHangouts Will Improve Your Hangouts

Ever since Google started supporting text messaging in Hangouts many people have … more
Post Reply

[KERNEL MOD] keytimer user setting script for mkasick Epic 4G keyboard patch

OP DRockstar

18th April 2011, 07:14 AM   |  #1  
OP Retired Recognized Developer
Flag Pasadena, CA
Thanks Meter: 564
 
307 posts
Join Date:Joined: Sep 2010
Donate to Me
More
After having shared this on the #epic channel, I decided to share it here... This is for kernel devs who've incorporated mkasick's sysfs keyboard patch, located here.

This kernel mod and accompanying script are meant to be used in conjunction with mkasick's epic keyboard patch, and will perform the following:

1) Allow the kernel developer to easily choose the initial timer_delay value for the patch

2) Allow the end user to adjust the setting, and have it persist past boot

3) Checks user input for the setting, and not allow settings to occur that will make the keyboard unresponsive, or unusable

Files:

keytimer_initscript.sh
keytimer

Instructions for kernel devs:

1) Take the script inside keytimer_initscript.sh, and add it to your custom initscript called from init.rc
Note: place after the init.d section, or theimpaler747 script will overwrite the keytimer script.

2) Place the keytimer script inside your initramfs /sbin

Instructions for users:

1) Have a kernel with this mod inside, like mine:
DRockstar.Clean.Kernel.EC05.v1.02.zip
Note: Other kernel devs have this now, so it should come to your favorite kernel soon!

Also: If your current kernel has the mkasick sysfs keyboard patch, but not my kernel mod, you can take the keytimer script, and place it /system/xbin, and chmod 755 /system/xbin/keytimer. Without my kernel mod, the setting won't persist through a reboot, but it will give you an easy way to change the setting.

2) Open Connectbot or Android Terminal, and type su

3) type command: keytimer
it will show usage and the current value, the default is 7.

example use to change to theimpaler747 value of 5:

keytimer 5

Accepted values are 1 through 16.
The change will be immediate, and will persist after reboot.

Hope you all like this one, enjoy it!

CODE:

keytimer_initscript.sh :

Code:
#!/system/bin/sh
# keytimer script to be called by init.rc, written by DRockstar for the Epic 4G
# assumes busybox is already installed
# kernel developers may just copy script to existing custom init script
# can be adjusted by accompanied keytimer script in /sbin

# keyboard patch sysfs call 7 for snappy keyboard performance
if [ ! -f "/data/local/timer_delay" ]; then
  echo 7 > /data/local/timer_delay
fi
cat /data/local/timer_delay > /sys/devices/platform/s3c-keypad/timer_delay
keytimer :
Code:
#!/system/bin/sh
# keytimer shortcut script by DRockstar

usage()
{
echo "keytimer: shortcut for Epic 4G keyboard response time"
echo "usage: keytimer , 7 is default, 1 - 16 accepted"
}

error()
{
usage
echo "error: $1"
exit
}

mount -t rootfs -o remount,rw / /

if [ "$1" = "" ]; then
timer="`cat /sys/devices/platform/s3c-keypad/timer_delay`"
usage
echo "current keytimer value is $timer"
exit
fi

case $1 in *[!0-9]*)
error "input is not a positive number"
esac

if [ $1 -gt 16 ]; then
error "only numbers 1 - 16 are accepted"
fi

echo $1 > /sys/devices/platform/s3c-keypad/timer_delay
echo $1 > /data/local/timer_delay

mount -t rootfs -o remount,ro / /
Last edited by DRockstar; 27th April 2011 at 04:08 AM.
The Following 6 Users Say Thank You to DRockstar For This Useful Post: [ View ]
19th April 2011, 02:32 AM   |  #2  
vocaltreat's Avatar
Senior Member
yucaipa
Thanks Meter: 47
 
271 posts
Join Date:Joined: Jan 2011
More
yeeeah
Good job DRockstar ....This is saweet
19th April 2011, 03:34 AM   |  #3  
Rodderik's Avatar
Recognized Developer
Thanks Meter: 1,312
 
1,300 posts
Join Date:Joined: Sep 2010
Donate to Me
More
good **** DRockstar....i already have it commited to my source for the next version

keep up the good work!
19th April 2011, 12:09 PM   |  #4  
OP Retired Recognized Developer
Flag Pasadena, CA
Thanks Meter: 564
 
307 posts
Join Date:Joined: Sep 2010
Donate to Me
More
OK, links fixed, with code also posted.

Posted instructions for those who just want to use keytimer script, in case your favorite kernel doesn't have the keytimer mod installed yet, but has the keyboard patch installed.

Thanks to Rodderik for server space, after fossnet server got toasted.

Peace!
19th April 2011, 05:20 PM   |  #5  
Recognized Developer
Thanks Meter: 829
 
470 posts
Join Date:Joined: Aug 2009
I'm pleased that folks are making good use of the sysfs patch, and making the user-side keytimer configuration much more approachable and useful. Thanks for doing this, it means a lot.
26th April 2011, 05:05 PM   |  #6  
blazinazn's Avatar
Senior Member
Thanks Meter: 74
 
561 posts
Join Date:Joined: Nov 2008
Quote:
Originally Posted by DRockstar

After having shared this on the #epic channel, I decided to share it here... This is for kernel devs who've incorporated mkasick's sysfs keyboard patch, located here.

This kernel mod and accompanying script are meant to be used in conjunction with mkasick's epic keyboard patch, and will perform the following:

1) Allow the kernel developer to easily choose the initial timer_delay value for the patch

2) Allow the end user to adjust the setting, and have it persist past boot

3) Checks user input for the setting, and not allow settings to occur that will make the keyboard unresponsive, or unusable

Files:

keytimer_initscript.sh
keytimer

Instructions for kernel devs:

1) Take the script inside keytimer_initscript.sh, and add it to your custom initscript called from init.rc
Note: place after the init.d section, or theimpaler747 script will overwrite the keytimer script.

2) Place the keytimer script inside your initramfs /sbin

Instructions for users:

1) Have a kernel with this mod inside, like mine:
DRockstar.Clean.Kernel.EC05.v1.01.zip
Note: Other kernel devs have this now, so it should come to your favorite kernel soon!

Also: If your current kernel has the mkasick sysfs keyboard patch, but not my kernel mod, you can take the keytimer script, and place it /system/xbin, and chmod 755 /system/xbin/keytimer. Without my kernel mod, the setting won't persist through a reboot, but it will give you an easy way to change the setting.

2) Open Connectbot or Android Terminal, and type su <enter>

3) type command: keytimer
it will show usage and the current value, the default is 7.

example use to change to theimpaler747 value of 5:

keytimer 5

Accepted values are 1 through 16.
The change will be immediate, and will persist after reboot.

Hope you all like this one, enjoy it!

CODE:

keytimer_initscript.sh :

Code:
#!/system/bin/sh
# keytimer script to be called by init.rc, written by DRockstar for the Epic 4G
# assumes busybox is already installed
# kernel developers may just copy script to existing custom init script
# can be adjusted by accompanied keytimer script in /sbin

# keyboard patch sysfs call 7 for snappy keyboard performance
if [ ! -f "/data/local/timer_delay" ]; then
  echo 7 > /data/local/timer_delay
fi
cat /data/local/timer_delay > /sys/devices/platform/s3c-keypad/timer_delay
keytimer :
Code:
#!/system/bin/sh
# keytimer shortcut script by DRockstar

usage()
{
echo "keytimer: shortcut for Epic 4G keyboard response time"
echo "usage: keytimer <number>, 7 is default, 1 - 16 accepted"
}

error()
{
usage
echo "error: $1"
exit
}

mount -t rootfs -o remount,rw / /

if [ "$1" = "" ]; then
timer="`cat /sys/devices/platform/s3c-keypad/timer_delay`"
usage
echo "current keytimer value is $timer"
exit
fi

case $1 in *[!0-9]*)
error "input is not a positive number"
esac

if [ $1 -gt 16 ]; then
error "only numbers 1 - 16 are accepted"
fi

echo $1 > /sys/devices/platform/s3c-keypad/timer_delay
echo $1 > /data/local/timer_delay

mount -t rootfs -o remount,ro / /

Sorry for asking this noob question but I just want to clarify. This is the stock Kernel with mkasicks fix to allow for the keyboard tweaks correct?

Nothing else is different about the kernel? If so, this is exactly what I was looking for.
27th April 2011, 04:22 AM   |  #7  
OP Retired Recognized Developer
Flag Pasadena, CA
Thanks Meter: 564
 
307 posts
Join Date:Joined: Sep 2010
Donate to Me
More
Updated the kernel download to v1.02... which fixed some apps like metamorph not working with the location I set for busybox.

I need to make a post for the kernel now... sources are now posted at github.com/DRockstar.

to answer the previous question, yes, this kernel is intended to be a simple rooted kernel, based off samsung stock, with only simple mods ... its feature are:

* Root and busybox with minimal system mods
* designed to allow OTA update after flashing back the stock kernel
* mkasick sysfs keyboard patch, with my keytimer script
* voodoo sound 7 by supercurio, controlled by voodoo control app in android market
* additonal custom scripts in /sbin for cleaning root, busybox, and flash kernels and recoveries

This kernel was built to replace the traditional one click root method for my all in one root and recovery script.

Sent from my SPH-D700 using Tapatalk

The Following User Says Thank You to DRockstar For This Useful Post: [ View ]
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Top Threads in Epic 4G Android Development by ThreadRank