[APP][Nov-13-2013] Capacitive Buttons v1.0.13

Vcek

Senior Member
Aug 27, 2011
1,167
338
0
Alexandria
No need for source code(tasker doesn't give code) , all it does sets /sys/class/leds/button-backlight/lut_coefficient to X on screen-on event. Maybe this file exists only on JB Firmwares. I can't remember I updated 2 months ago.

echo 10 > /sys/class/leds/button-backlight/lut_coefficient

with root permission

Sent telepathically from my brain.
 
Last edited:

denversc

Senior Member
Jul 1, 2012
428
320
0
Kitchener
Version 1.0.7 released. You can either install the APK from the link below (and in the OP), or wait for a few hours for the new version to become active in the Google Play Store.

Changes in v1.0.7
  • fixes bug where brightness setting does not persist when turning screen off then back on; only affects International One X (endeavoru) and HTC One X+ (evitareul) devices

APK Download URL for v1.0.7: http://code.google.com/p/hox-cap-butn-brightness/downloads/detail?name=CapButnBrightness-1.0.7.apk

NOTE: If you installed one of the two "test" versions that were released while investigating the fix that went into this version you must uninstall it before installing this official version. The reason is that the "test" versions are signed with a developer key where v1.0.7 is signed with the "official" key. If you forget to uninstall the test version first then installation of the official version will fail. If you have a previous official version installed (eg. v1.0.6) then you do not need to uninstall it first.
 

denversc

Senior Member
Jul 1, 2012
428
320
0
Kitchener
all it does sets /sys/class/leds/button-backlight/lut_coefficient to X on screen-on event.
I just took a peek at the kernel sources (see attached C source file) and it appears that there are actually a bunch of things possible with the capacitive button backlight, including setting the "off" timeout, blinking it, and setting the "lut" and "pwm" coefficients.

Any idea what "lut" and "pwm" mean here in this context? According to the source, the value of the lut_coefficient and pwm_coefficient must be between 0 and 100, inclusive. The "pwm" coefficient actually only applies to the "green" and "amber" LEDs now that I look at the source more closely, so it does not apply to the capacitive button backlight. However, the "lut" coefficient actually exclusively applies to the capacitive button backlight.

We might be able to actually have a sliding scale of brightness of the capacitive buttons using the lut coefficient. Hmm....
 

Attachments

denversc

Senior Member
Jul 1, 2012
428
320
0
Kitchener
We might be able to actually have a sliding scale of brightness of the capacitive buttons using the lut coefficient. Hmm....
Okay so I whipped together a new test version of the app, v1.0.7-SliderTest1, which has a horizontal slider at the bottom that allows you to control the intensity of the brightness of the capacitive buttons. APK and screenshot are attached to this post. Can someone test it out and report back their findings? I tested it on the North American HTC One X (evita) and it seems to work well. It works by writing values between 0 and 100 in increments of 10 to /sys/class/leds/button-backlight/lut_coefficient.

Reminder: This "test version" of the app is signed with a developer key so it will fail to install if you have an official version of the app installed. So you must first uninstall any official versions of the app before installing this test version.

Oh, and I should mention that it's 3am here in Canada so I'm off to bed :)
 

Attachments

TToivanen

Senior Member
May 16, 2012
2,923
1,850
0
Perhaps it only works with sense roms, cause I don't have any lut-coefficient file.

Sliding stutters quite a lot and only manages to flash the button lights like 2bps.

Someone on sense: please test this.

Sent from my HTC One X
 

omar302

Senior Member
Feb 15, 2006
1,481
553
143
Doha
I have an internation HOX with a Sense JB rom (IC 14.0.2), and similar to what TToivanen mentioned, the Sliding stutters, though the Buttons do dim initially, once they turn off & back on again, they are back to full brightness.
 

denversc

Senior Member
Jul 1, 2012
428
320
0
Kitchener
Perhaps it only works with sense roms, cause I don't have any lut-coefficient file.
Sliding stutters quite a lot and only manages to flash the button lights like 2bps.
I have an internation HOX with a Sense JB rom (IC 14.0.2), and similar to what TToivanen mentioned, the Sliding stutters, though the Buttons do dim initially, once they turn off & back on again, they are back to full brightness.
Looks like I've got some work to do to make this slider feature usable. At least there is one report of it sort of working. TToivanen, I'm actually quite surprised that the lut_coefficient file is not present on your device, as it's created by the kernel and I'd be quite surprised if the CM team decided for some reason not to create it. It's certainly possible though and if it's not there then there is no way to control the "brightness" of the capacitive button backlight (other than on and off)
 

lesscro

Senior Member
Jul 16, 2007
4,397
2,248
253
Paris
www.lesscro.com
Can we will expect more about this app ?

Like if i am on an app, only back button light full power than 2 others ?
Or when i am on Home, does Home button can be on and two others low light ?


Then i have lot of idea about this app...

And finally, this what i made to be cool with this app...

A tiny Hox... with basic light... maybe i can add 3 light bulb with various opacity...
If you are interested by Icon... Send Me a PM !

 
Last edited:

denversc

Senior Member
Jul 1, 2012
428
320
0
Kitchener
Can we will expect more about this app ?

Like if i am on an app, only back button light full power than 2 others ?
Or when i am on Home, does Home button can be on and two others low light ?
If I understand you correctly, you are basically asking about the ability to set the backlight of each of the capacitive buttons individually (eg. turn on the backlight behind the "home" key and off behind the "back" and "recent tasks" keys). The mechanism that the app uses to set the capacitive button brightness controls the backlight behind all of the keys at once and there is no mechanism, as far as I can tell anyways, to control the backlight behind individual buttons. So unfortunately, technically this feature is not possible.

And finally, this what i made to be cool with this app...

A tiny Hox... with basic light... maybe i can add 3 light bulb with various opacity...
If you are interested by Icon... Send Me a PM !

Thanks for making this image! It's very creative. I'll PM you and we'll see what we can come up with.
 
  • Like
Reactions: lesscro

denversc

Senior Member
Jul 1, 2012
428
320
0
Kitchener
So yeah... I got the slider working on CM10 too. Just had to install NCX-kernel. :)
Huh, so it was a kernel thing after all. I guess I was wrong. Thanks for the update. That will be worthwhile noting in the known issues list once the slider or equivalent feature is in the official version of the app.
 

TToivanen

Senior Member
May 16, 2012
2,923
1,850
0
And one more thing: the highest setting of the slider is even brighter than the brightness achieved by pressing full brightness button.

Sent from my HTC One X
 

denversc

Senior Member
Jul 1, 2012
428
320
0
Kitchener
I did a bit of work on the app today and I believe I got the "dim" setting working on your device. I refactored a bunch of the code to better support multiple devices and implemented the logic to use the lut_coefficient file to set the brightness to something other than full. I've attached a test version of the app for testing.

Would someone be able to test out this test version of the app? You should now see 3 buttons on the main UI (instead of 2) with a new button in the middle to set the brightness to "dim". You should see a distinct difference in the brightness when setting "dim"' verses "bright". Please let me know your experiences. If you can, please also test that all of the 3 settings stick across device reboots. Note that in contrast to a previous test version that had a slider to allow choosing from a range of brightness levels this test version of the app just hardcodes 20 for the "dim" setting.

Reminder: This "test version" of the app is signed with a developer key so it will fail to install if you have an official version of the app installed. So you must first uninstall any official versions of the app before installing this test version.
 

Attachments