1. Are you ready for the Galaxy S20? Here is everything we know so far!

Basic question about brightness increments

Discussion in 'Android Development' started by nikos2wheels, May 24, 2017.

  1. nikos2wheels

    nikos2wheels Lurker
    Thread Starter

    I have a question about the brightness increments. When I connect my bluetooth keyboard to my Android phone (Nexus 5x) it takes only 10 increments to increase the brightness from minimum to maximum. When I use another method (mapping the volume keys to increase/decrease the brightness) it takes 16 increments to increase the brightness from minimum to maximum. I understand there is a key event associated with buttons Brightness Up (key code=221) and Brightness Down (key code=220). Why buttons from different controllers result in different increments?
     



    1. Download the Forums for Android™ app!


      Download

       
  2. bayk

    bayk Member

    Keyboard keys and volume are different events. Your device process them differently.
    [​IMG]
     
  3. nikos2wheels

    nikos2wheels Lurker
    Thread Starter

    Thanks for the reply. The goal is to have a key that does the equivalent of "Mute" for brightness. One press of a key and it sets the brightness to minimum, another press and it sets the brightness back to maximum.

    I looked in Android key codes but such a code doesn't exist. I thought it can be achieved by sending multiple "Brightness Down/Up" key codes with one stroke. Does anyone have other suggestions?
     
Loading...
Similar Threads - Basic question brightness
  1. App Update
    Replies:
    0
    Views:
    235
  2. PearMobile Ltd
    Replies:
    1
    Views:
    217
  3. Jim Robson
    Replies:
    2
    Views:
    991
  4. maheshkulkarni
    Replies:
    0
    Views:
    428
  5. RhinoCan
    Replies:
    18
    Views:
    2,071
  6. m4p
    Replies:
    3
    Views:
    696
  7. firestorm31z
    Replies:
    8
    Views:
    493
  8. asadaso
    Replies:
    3
    Views:
    717
  9. Android News
    Replies:
    0
    Views:
    608
  10. Android News
    Replies:
    0
    Views:
    381

Share This Page

Loading...