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

Search This thread

denversc

Senior Member
Jul 1, 2012
428
320
Kitchener
NOTE: Please use the DevDB thread for all devices instead of this device-specific thread: http://forum.xda-developers.com/showthread.php?t=2496347
Cap_Butn_Brightness_Title_Banner.jpg


This small application allows you to change the brightness of the capacitive buttons (back, home, and recent tasks) on many HTC devices and a few non-HTC devices, including the HTC One X (both dual-core and quad-core models), the HTC One X+, and the HTC One. Users have also reported success on other devices, including HTC One V, HTC One S, HTC Desire HD, and Evo 3g. Root is required in order for this application to work. This application works on any ROM, including CleanROM, ViperXL, Cyanogenmod, AOKP, and MIUI.

App review by Portal Administrator / Editor-in-Chief for XDA-Developers Will Verduzco: http://www.xda-developers.com/android/easily-dim-the-capacitive-buttons-on-many-htc-devices

Features
  • Intuitive UI to set the brightness of the capacitive buttons to bright, dim, or off
  • Home screen widget to cycle between brightness levels

Latest Versions
Latest Pro Version: 1.0.13
Latest Free Version: 1.0.13

Download
Google Play (Pro version): https://play.google.com/store/apps/details?id=org.sleepydragon.capbutnbrightness.pro
Google Play (Free version): https://play.google.com/store/apps/details?id=org.sleepydragon.capbutnbrightness
APK (v1.0.13): http://dl.bintray.com/sleepydragon/CapacitiveButtons/CapButnBrightness-1.0.13.apk
YouTube Video: https://www.youtube.com/watch?v=r9Zj-z02CR8

Differences in the Pro Version
The Pro version receives new features and bug fixes 2-4 weeks earlier than the free version. That's it! Oh, and also the free version has a link at the bottom of the main UI to upgrade to pro. The main motivation to pay for the pro version is to get official app updates easily and automatically via the Google Play Store. If you're happy with waiting for updates or using beta versions then you can live a full and happy life with the free version.

Officially Supported Devices
  • HTC One X (evita and endeavoru)
  • HTC One (m7)
  • HTC One X+ (evitareul)
  • HTC One S
  • HTC Sensation

Unofficially Supported Devices
  • HTC One V
  • HTC Desire HD
  • HTC Evo 3D
  • HTC Droid MAXX
  • HTC Droid DNA
  • HTC Butterfly S
  • LG Optimus G

Officially Unsupported Devices (devices that are known not to work)
  • Samsung Galaxy S2
  • Samsung Galaxy S3

Frequently Asked Questions
  • Which brightness setting is "stock"? It depends. On Sense based ROMs (eg. CleanROM, ViperXL) "Bright" seems to be the default. On AOSP-based ROMs (eg. CM10, AOKP) "Dim" seems to be the default. It all depends on how/if the ROM maintainer tweaked the default setting. The "default default" (ie. if you RUU to stock) setting is "bright". In v1.0.4, a "Default" button was added to allow reverting to stock brightness.
  • How do I get back to the default setting? The most reliable way is to click the "Default" button on the main screen of the application then simply reboot. Or, you can just set the brightness setting that is the default.
  • What happens if I uninstall the app? Nothing. Well, it doesn't change the brightness setting if that's what you're wondering. After a reboot, though, the brightness setting will revert back to the ROM's default setting.

Known Issues
  • "Dim" does not work on all ROMs and kernels
  • "Off" does not stick when "GV Integation" app installed

Source
This application is released under the GPL3 open-source license. Source code is published at https://code.google.com/p/hox-cap-butn-brightness

Reporting Bugs
Use the "Bug Reports" feature of this DevDB project or add a post to this thread. Please include the contents of the application's "Debug Information" page (available from the "Settings" screen) when reporting bugs, as it contains invaluable information for developers to use when investigating issues. There is a "Copy" button in the top-right corner of the screen for easy cut & paste.

Credits
Turge - for providing a MOD to perform the same task (http://forum.xda-developers.com/showthread.php?t=1694375)
gridlock489 - for providing higher-resolution images for the buttons in the main UI
slimdizzy - for testing on the HTC One X+ and letting me borrow his device to try things out
TToivanen - for testing on the International HTC One X (endeavoru)
lesscro - for providing the title banner that you see at the top of this post
skdubg - for testing on the HTC One X+, especially the new "dim" support

Change Log (brief - see full change log in the next post)
  • 1.0.13 (Nov 14, 2013) Fixed buttons turning off issue, skip dim in widget if not supported, HTC Sensation support added
  • 1.0.12 (Oct 24, 2013) Fixed "default" button error: "Changing permissions of file failed"
  • 1.0.11 (Oct 23, 2013) Fixed long-standing issues with UI lags and superuser permissions usage, animation added to home screen widget
  • 1.0.10 (Sept 10, 2013) Home screen widget added, HTC One brightness levels fixed
  • 1.0.9 (Sept 03, 2013) HTC One support added, support for devices without the "currents" file added
  • 1.0.8 (Jan 02, 2013) dim support for all devices, new home screen icon, debug information and credits screen added, fixed about screen scrolling
  • 1.0.7 (Dec 10, 2012) fixes bug where brightness setting does not persist when turning screen off then back on; only affects endeavoru and evitareul
  • 1.0.6 (Dec 06, 2012) added support for HTC One X+ and International HTC One X (endeavoru); added detected device name at bottom of "About" screen
  • 1.0.5 (Nov 25, 2012) fixed pixelated button images in main UI (thanks to gridlock489 for providing higher-resolution images)
  • 1.0.4 (Nov 03, 2012) visual indication when buttons pressed, better error message if not rooted, "Default" button added, some words translated
  • 1.0.3 (Oct 11, 2012) Brightness setting now sticks across reboots
  • 1.0.2 (Oct 03, 2012) Change theme to Holo (dark), replace button text off/dim/bright with pretty icons
  • 1.0.1 (Oct 02, 2012) Added to Google Play, new application icon, added "About" screen
  • 1.0.0 (Sept 29, 2012) Initial release

Old APKs:

Feel free to bake the free version of this app into custom ROMs or publish it in other places. No need to ask permission from me. However, I am quite interested personally in different places that this app is used. So if you do include it in a ROM or whatever feel free to post a note to this thread to let me know! The app is licensed under the GPL, which means you can even take it apart and include it in your own stuff... I just ask that you honor the spirit of the GPL (unlike HTC's 120-day policy... grrr!)

Threads for this app for other devices (obsolete - please use this thread instead):
 

Attachments

  • CapButnBrightnessPro-1.0.10-Screenshot1.jpg
    CapButnBrightnessPro-1.0.10-Screenshot1.jpg
    17.1 KB · Views: 772
  • CapButnBrightnessPro-1.0.10-Screenshot2.jpg
    CapButnBrightnessPro-1.0.10-Screenshot2.jpg
    43.6 KB · Views: 840
  • CapButnBrightnessPro-1.0.10-Screenshot3.jpg
    CapButnBrightnessPro-1.0.10-Screenshot3.jpg
    18.5 KB · Views: 764
  • CapButnBrightnessPro-1.0.10-Screenshot4.jpg
    CapButnBrightnessPro-1.0.10-Screenshot4.jpg
    39 KB · Views: 726
  • CapButnBrightnessPro-1.0.10-Screenshot5.jpg
    CapButnBrightnessPro-1.0.10-Screenshot5.jpg
    45.9 KB · Views: 700
  • CapButnBrightnessPro-1.0.10-Screenshot6.jpg
    CapButnBrightnessPro-1.0.10-Screenshot6.jpg
    24.4 KB · Views: 665
Last edited:

dragonesdenano

Senior Member
Jan 25, 2011
14,182
20,677
46
Lanus, Buenos Aires
It works in SkyDragon V3, ICS,
Thanks for the app, it s amazing.
Later will test on skydragon JB V3
:)

SkyDragon Sense, Dsensed, SeMistock & Stock Roms. Next Targe ~ ~ ~ > JB or Kelly Bean
 

denversc

Senior Member
Jul 1, 2012
428
320
Kitchener

Unfortunately, no. Unfortunately, the International One X (endeavoru) does not support the "dim" setting. The YouTube video in the OP and the screenshots from the thread you linked to was taken on a North American One X (evita), which does support the dim setting. I tried, but the capacitive button backlight on the One X (endeavoru) is either off or on... no dim. So instead of having a "bright" and "dim" button that do the same thing, I modified the UI to hide the useless "dim" button.

Good question though. I've added this note to the "known issues" list in the OP: HTC One X+ and International One X (endeavoru) do *not* support the "dim" setting; therefore, the middle button is omitted from the UI on these devices
 

shree.cse

Senior Member
Apr 30, 2010
2,878
1,541
Bangalore
Yeah, you're right. When ever we turn off the screen, the lights are back. Better to use a script, which should be placed in system/etc/init.d
If any one wants that, I will attach it here.
Sent from my HTC One X using Tapatalk 2
 

TToivanen

Senior Member
May 16, 2012
2,923
1,850
Hey denversc, please remove the chmod 444 part from the script.
That way users choice should persist

Sent from my HTC One X
 
  • Like
Reactions: howdid

denversc

Senior Member
Jul 1, 2012
428
320
Kitchener
Hey denversc, please remove the chmod 444 part from the script.
That way users choice should persist

The app is not actually running any chmod commands. I'm not sure exactly why the capacitive button backlight is turning back on when the screen turns back on. The way the app works is that it writes either "0" or "255" to the file /sys/class/leds/button-backlight/brightness to turn the capacitive button backlight off or on, respectively. So probably the OS writes 255 to this file every time the screen turns on. It might be difficult/impossible to "fix" this. Any ideas?
 

denversc

Senior Member
Jul 1, 2012
428
320
Kitchener
Yeah, you're right. When ever we turn off the screen, the lights are back. Better to use a script, which should be placed in system/etc/init.d

I'm not sure that an init.d script would make any difference. It may be worth a try though. Why do you think it would make it work better with init.d? I just don't understand how init.d scripts are called. Thanks.
 

shree.cse

Senior Member
Apr 30, 2010
2,878
1,541
Bangalore
I'm not sure that an init.d script would make any difference. It may be worth a try though. Why do you think it would make it work better with init.d? I just don't understand how init.d scripts are called. Thanks.

Try this
http://db.tt/YpQPUPjH
Just place it in system/etc/init.d using root explorer and check permissions and execute it from there.
Sent from my HTC One X using Tapatalk 2
 
Last edited:

TToivanen

Senior Member
May 16, 2012
2,923
1,850
The app is not actually running any chmod commands. I'm not sure exactly why the capacitive button backlight is turning back on when the screen turns back on. The way the app works is that it writes either "0" or "255" to the file /sys/class/leds/button-backlight/brightness to turn the capacitive button backlight off or on, respectively. So probably the OS writes 255 to this file every time the screen turns on. It might be difficult/impossible to "fix" this. Any ideas?

Sorry, I thought you grabbed the script entirely from the q/a thread.

The thing is, you need to set the permissions of /sys/class/leds/button-backlight/brightness/ to read only. That way system wont change it to 255 when screen is turned on.

An init.d script works this way:
1. Set rw-permissions to /sys/class/leds/button-backlight/brightness by chmod 0666
2. Change value to whatever needed
3. chmod 0444 to /sys/class/leds/button-backlight/brightness for ro permissions.

I'm not quite sure if you can use chmod commands or not but thought I'd share this.


Sent from my HTC One X
 

denversc

Senior Member
Jul 1, 2012
428
320
Kitchener
Sorry, I thought you grabbed the script entirely from the q/a thread.

The thing is, you need to set the permissions of /sys/class/leds/button-backlight/brightness/ to read only. That way system wont change it to 255 when screen is turned on.

An init.d script works this way:
1. Set rw-permissions to /sys/class/leds/button-backlight/brightness by chmod 0666
2. Change value to whatever needed
3. chmod 0444 to /sys/class/leds/button-backlight/brightness for ro permissions.

I'm not quite sure if you can use chmod commands or not but thought I'd share this.

Ahh I see what you mean. I can definitely add that logic into the app to see if it fixes this issue. I'll post a test version of the app here in the thread when it's ready (probably late afternoon tomorrow).

One question about init.d scripts... do they run only when the device initially powers on or do they also run every time it wakes up from deep sleep, or every time that the screen powers on?

For now, I've added this issue to the "known issues" list in the OP: capacitive buttons backlight turns back on when the screen turns back on, even if "off" is selected in the app; a fix involving init.d scripts and/or chmod is currently under investigation
 

denversc

Senior Member
Jul 1, 2012
428
320
Kitchener
Here is a version of the app to test to see if it fixes the issue where the capacitive button backlight turns on when turning the screen on. It doesn't use an init.d script but it does run chmod 666 before setting the brightness and chmod 444 afterwards. The idea is that this will prevent the OS from turning the backlight back on since the file that it attempts to write to is read-only.

The APK of the test version of the app is attached to this post. You must uninstall any old versions of the app before installing this one, as it is signed with a "developer" key instead of the "official" key. As a result, you will also need to uninstall this test version of the app before installing an official version (for the exact same reason). Not doing so will simply cause the install of the APK to fail.

Please let me know if this fixes the issue.
 

Attachments

  • CapButnBrightness-1.0.6-ScreenOnFixTest1.apk
    400 KB · Views: 25

muid02

Senior Member
Jul 1, 2012
866
124
Dhaka
I am trying it with slim bran and it doesnt get brighter. Its the same.

Sent from my HTC One X using xda app-developers app
 

TToivanen

Senior Member
May 16, 2012
2,923
1,850
Denver, this version keeps the lights off when the screen is locked/unlocked like intended.
But I can't keep the lights on. After screen on they are off again.

Did you add chmod commands only to the the lights off script?

E: I assume you did, took a look at src.

Sent from my HTC One X
I am trying it with slim bran and it doesnt get brighter. Its the same.

Sent from my HTC One X using xda app-developers app

Not sure what you mean by getting brighter.
The purpose of this app is to turn softkey lights on and off.

Sent from my HTC One X
One question about init.d scripts... do they run only when the device initially powers on or do they also run every time it wakes up from deep sleep, or every time that the screen powers on?

They are executed when device boots.

Sent from my HTC One X
 
Last edited:
  • Like
Reactions: *elmo*

bedobela

Senior Member
Aug 29, 2008
273
19
Sfintu Gheorghe
Great. I can confirm too that this works on Maximus 11. I have been looking for this app since the ICS times. I love how the buttons don't light up because you know where they are anyway and at least in my case when looking at a completely black image, you can see some light on the lower part of the screen from the buttons. Now that is disabled and the screen is gorgeous.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 23
    NOTE: Please use the DevDB thread for all devices instead of this device-specific thread: http://forum.xda-developers.com/showthread.php?t=2496347
    Cap_Butn_Brightness_Title_Banner.jpg


    This small application allows you to change the brightness of the capacitive buttons (back, home, and recent tasks) on many HTC devices and a few non-HTC devices, including the HTC One X (both dual-core and quad-core models), the HTC One X+, and the HTC One. Users have also reported success on other devices, including HTC One V, HTC One S, HTC Desire HD, and Evo 3g. Root is required in order for this application to work. This application works on any ROM, including CleanROM, ViperXL, Cyanogenmod, AOKP, and MIUI.

    App review by Portal Administrator / Editor-in-Chief for XDA-Developers Will Verduzco: http://www.xda-developers.com/android/easily-dim-the-capacitive-buttons-on-many-htc-devices

    Features
    • Intuitive UI to set the brightness of the capacitive buttons to bright, dim, or off
    • Home screen widget to cycle between brightness levels

    Latest Versions
    Latest Pro Version: 1.0.13
    Latest Free Version: 1.0.13

    Download
    Google Play (Pro version): https://play.google.com/store/apps/details?id=org.sleepydragon.capbutnbrightness.pro
    Google Play (Free version): https://play.google.com/store/apps/details?id=org.sleepydragon.capbutnbrightness
    APK (v1.0.13): http://dl.bintray.com/sleepydragon/CapacitiveButtons/CapButnBrightness-1.0.13.apk
    YouTube Video: https://www.youtube.com/watch?v=r9Zj-z02CR8

    Differences in the Pro Version
    The Pro version receives new features and bug fixes 2-4 weeks earlier than the free version. That's it! Oh, and also the free version has a link at the bottom of the main UI to upgrade to pro. The main motivation to pay for the pro version is to get official app updates easily and automatically via the Google Play Store. If you're happy with waiting for updates or using beta versions then you can live a full and happy life with the free version.

    Officially Supported Devices
    • HTC One X (evita and endeavoru)
    • HTC One (m7)
    • HTC One X+ (evitareul)
    • HTC One S
    • HTC Sensation

    Unofficially Supported Devices
    • HTC One V
    • HTC Desire HD
    • HTC Evo 3D
    • HTC Droid MAXX
    • HTC Droid DNA
    • HTC Butterfly S
    • LG Optimus G

    Officially Unsupported Devices (devices that are known not to work)
    • Samsung Galaxy S2
    • Samsung Galaxy S3

    Frequently Asked Questions
    • Which brightness setting is "stock"? It depends. On Sense based ROMs (eg. CleanROM, ViperXL) "Bright" seems to be the default. On AOSP-based ROMs (eg. CM10, AOKP) "Dim" seems to be the default. It all depends on how/if the ROM maintainer tweaked the default setting. The "default default" (ie. if you RUU to stock) setting is "bright". In v1.0.4, a "Default" button was added to allow reverting to stock brightness.
    • How do I get back to the default setting? The most reliable way is to click the "Default" button on the main screen of the application then simply reboot. Or, you can just set the brightness setting that is the default.
    • What happens if I uninstall the app? Nothing. Well, it doesn't change the brightness setting if that's what you're wondering. After a reboot, though, the brightness setting will revert back to the ROM's default setting.

    Known Issues
    • "Dim" does not work on all ROMs and kernels
    • "Off" does not stick when "GV Integation" app installed

    Source
    This application is released under the GPL3 open-source license. Source code is published at https://code.google.com/p/hox-cap-butn-brightness

    Reporting Bugs
    Use the "Bug Reports" feature of this DevDB project or add a post to this thread. Please include the contents of the application's "Debug Information" page (available from the "Settings" screen) when reporting bugs, as it contains invaluable information for developers to use when investigating issues. There is a "Copy" button in the top-right corner of the screen for easy cut & paste.

    Credits
    Turge - for providing a MOD to perform the same task (http://forum.xda-developers.com/showthread.php?t=1694375)
    gridlock489 - for providing higher-resolution images for the buttons in the main UI
    slimdizzy - for testing on the HTC One X+ and letting me borrow his device to try things out
    TToivanen - for testing on the International HTC One X (endeavoru)
    lesscro - for providing the title banner that you see at the top of this post
    skdubg - for testing on the HTC One X+, especially the new "dim" support

    Change Log (brief - see full change log in the next post)
    • 1.0.13 (Nov 14, 2013) Fixed buttons turning off issue, skip dim in widget if not supported, HTC Sensation support added
    • 1.0.12 (Oct 24, 2013) Fixed "default" button error: "Changing permissions of file failed"
    • 1.0.11 (Oct 23, 2013) Fixed long-standing issues with UI lags and superuser permissions usage, animation added to home screen widget
    • 1.0.10 (Sept 10, 2013) Home screen widget added, HTC One brightness levels fixed
    • 1.0.9 (Sept 03, 2013) HTC One support added, support for devices without the "currents" file added
    • 1.0.8 (Jan 02, 2013) dim support for all devices, new home screen icon, debug information and credits screen added, fixed about screen scrolling
    • 1.0.7 (Dec 10, 2012) fixes bug where brightness setting does not persist when turning screen off then back on; only affects endeavoru and evitareul
    • 1.0.6 (Dec 06, 2012) added support for HTC One X+ and International HTC One X (endeavoru); added detected device name at bottom of "About" screen
    • 1.0.5 (Nov 25, 2012) fixed pixelated button images in main UI (thanks to gridlock489 for providing higher-resolution images)
    • 1.0.4 (Nov 03, 2012) visual indication when buttons pressed, better error message if not rooted, "Default" button added, some words translated
    • 1.0.3 (Oct 11, 2012) Brightness setting now sticks across reboots
    • 1.0.2 (Oct 03, 2012) Change theme to Holo (dark), replace button text off/dim/bright with pretty icons
    • 1.0.1 (Oct 02, 2012) Added to Google Play, new application icon, added "About" screen
    • 1.0.0 (Sept 29, 2012) Initial release

    Old APKs:

    Feel free to bake the free version of this app into custom ROMs or publish it in other places. No need to ask permission from me. However, I am quite interested personally in different places that this app is used. So if you do include it in a ROM or whatever feel free to post a note to this thread to let me know! The app is licensed under the GPL, which means you can even take it apart and include it in your own stuff... I just ask that you honor the spirit of the GPL (unlike HTC's 120-day policy... grrr!)

    Threads for this app for other devices (obsolete - please use this thread instead):
    4
    Thanks to everyone who has given feedback about issues in v1.0.8, especially those who included the "Debug Information" screen contents :)

    I have been keeping a list of bug reports and feature requests in Google Code: https://code.google.com/p/hox-cap-butn-brightness/issues/list. So rest assured that even if I don't respond to your post individually your information is being valued highly.

    The top 3 priority issues for me at the moment are:
    1. Issue 18: Notification LED turns on with capacitive buttons backlight
    2. Issue 19: "Dim" and "Bright" are the same brightness on some devices
    3. Issue 23: Buttons backlight times out after setting brightness, when it did not time out before
    These 3 issues are somewhat mysterious to me and I don't have an ETA for a fix. Kernel sources for Jelly Bean might shed some light on this odd behaviour though, so it might be a while before they are fixed completely. There could be some test builds over the next few weeks with fixes to try out.
    3
    Attached is another (sorry for posting so many!) test version of the app, v1.0.7-DimTest5, that perfectly supports the "dim" setting across screen power off then back on, at least on the HTC One X+, which has the same quad-core Tegra3 chipset as your endeavoru International One X. Thank you TToivanen for testing all these test versions and providing your feedback! If you or anyone else can load this test version of the app and run the two quick tests below that would be very useful:

    1. Click each of the 3 brightness buttons in the main UI; verify that the brightness level immediately changes accordingly
    2. Click each of the 3 brightness buttons in the main UI, press the power button to turn off the screen, then press the power button again to turn the screen back on; verify that the capacitive button backlight is the same brightness that was selected prior to turning the screen off

    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.
    3
    Here is a version of the app to test to see if it fixes the issue where the capacitive button backlight turns on when turning the screen on. It doesn't use an init.d script but it does run chmod 666 before setting the brightness and chmod 444 afterwards. The idea is that this will prevent the OS from turning the backlight back on since the file that it attempts to write to is read-only.

    The APK of the test version of the app is attached to this post. You must uninstall any old versions of the app before installing this one, as it is signed with a "developer" key instead of the "official" key. As a result, you will also need to uninstall this test version of the app before installing an official version (for the exact same reason). Not doing so will simply cause the install of the APK to fail.

    Please let me know if this fixes the issue.
    2

    Unfortunately, no. Unfortunately, the International One X (endeavoru) does not support the "dim" setting. The YouTube video in the OP and the screenshots from the thread you linked to was taken on a North American One X (evita), which does support the dim setting. I tried, but the capacitive button backlight on the One X (endeavoru) is either off or on... no dim. So instead of having a "bright" and "dim" button that do the same thing, I modified the UI to hide the useless "dim" button.

    Good question though. I've added this note to the "known issues" list in the OP: HTC One X+ and International One X (endeavoru) do *not* support the "dim" setting; therefore, the middle button is omitted from the UI on these devices