Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,780,205 Members 39,936 Now Online
XDA Developers Android and Mobile Development Forum

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

Tip us?
 
DRockstar
Old
(Last edited by DRockstar; 27th April 2011 at 04:08 AM.)
#1  
Retired Recognized Developer - OP
Thanks Meter 564
Posts: 307
Join Date: Sep 2010
Location: Pasadena, CA

 
DONATE TO ME
Default [KERNEL MOD] keytimer user setting script for mkasick Epic 4G keyboard patch

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 / /
Have I done something useful? Feel free to buy me a Red Bull!
The Following 6 Users Say Thank You to DRockstar For This Useful Post: [ Click to Expand ]
 
vocaltreat
Old
#2  
vocaltreat's Avatar
Senior Member
Thanks Meter 47
Posts: 271
Join Date: Jan 2011
Location: yucaipa
Default yeeeah

Good job DRockstar ....This is saweet
Can i get a HOT TUB!
While your at it sign up for dropbox...its a must have!!!
Make My Dropbox Bigger
__________________________________________
ROM
ViperROM [SynErgY] EXT4-RFS Dual EB13 5.0


Kernel
Rodderiks Genocide EC05 Kernel 1.1 |1.4GhzOC|UV|VoodooSound7|VoodooColor
Questions? Hit me up at vocaltreat@devphone.org

Please remember to hit that thank button when someone helps you, Its just common courtesy
 
Rodderik
Old
#3  
Rodderik's Avatar
Recognized Developer
Thanks Meter 1,312
Posts: 1,300
Join Date: Sep 2010

 
DONATE TO ME
good **** DRockstar....i already have it commited to my source for the next version

keep up the good work!
Devices: EVO 4G LTE (pre-ordered), Epic 4g, Sprint 7" Galaxy Tab, HP TouchPad (CM9), Nook Color (CM7), Transform, Intercept

Epic 4G Kernel: Genocide EC05 Kernel v2.0|1.4GhzOC|RomManager|CustomUV|DUALBOOT
Galaxy Tab: [SPRINT][CDMA]Samsung Galaxy Tab (SPH-P100) Mega Development Starter Thread

http://devphone.org
 
DRockstar
Old
#4  
Retired Recognized Developer - OP
Thanks Meter 564
Posts: 307
Join Date: Sep 2010
Location: Pasadena, CA

 
DONATE TO ME
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!
Have I done something useful? Feel free to buy me a Red Bull!
 
mkasick
Old
#5  
Recognized Developer
Thanks Meter 827
Posts: 470
Join Date: 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.
 
blazinazn
Old
#6  
blazinazn's Avatar
Senior Member
Thanks Meter 74
Posts: 561
Join Date: Nov 2008
Quote:
Originally Posted by DRockstar View Post
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.
 
DRockstar
Old
#7  
Retired Recognized Developer - OP
Thanks Meter 564
Posts: 307
Join Date: Sep 2010
Location: Pasadena, CA

 
DONATE TO ME
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
Have I done something useful? Feel free to buy me a Red Bull!

The Following User Says Thank You to DRockstar For This Useful Post: [ Click to Expand ]
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes