Jump to content

Pro1x Shortcut to backlit keyboard ?


Recommended Posts

None that I know of.

(On the Pro1 (not Pro1X) there in settings is a Slider section for stock Android ("Buttons" for LineageOS) where you we can disable backlight, other than that I do not know of any settings related to the keyboard backlight)

  • Like 1
Link to post
Share on other sites

In the past I used an app called ButtonLED to use the backlights of the hardware buttons as a notification lights. (Yes, years ago there were phones with hardware keys that had backlights). The app was able control the lights even without root if I remember correctly. Probably it will not work anymore at all or with Pro1(-X) but there might be similar apps still available.

It is possible to regognize the opening of the keyboard with Key Mapper for example. Then you could use some automation app to perform the backlit via other app (if there is an app for that).

I am just throwing some ideas.

Edited by FlyingAntero
  • Like 2
Link to post
Share on other sites
Posted (edited)

@EskeRahn, thanks for your reply. I saw this option and i would use Key Mapper (For example) to trigger (Left Ctrl + *) to switch Off/On the backlit when opened. No way for the moment. The only way i found (for now) is to set an Action via Nova Launcher to directly access in "Buttons" section. So i would like something more precise 😄

Edit: I will NOT ask to @Slion if something could be done. 

@FlyingAntero, thanks for your reply too. I will take a look more deeply in Key Mapper cause i don't really what are the possibilities with it.

Edited by zegoo
  • Like 1
Link to post
Share on other sites
Posted (edited)

Do you know why when I type one character, two are displayed?
I'm trying to script a simple function to run with an alias to read /sys/class/leds/button-backlight/brightness and modify it to turn the keyboard on/off via Termux and all at once , my characters are doubled.😤

 

Edit 1: Code 30 I think 🙄. I made a full reinstall Termux from F-Droid.

 

For those which could be interested i made that:

In my Home a script called toggle_keyboard_backlight.sh

#!/data/data/com.termux/files/usr/bin/bash
# toggle_keyboard_backlight.sh


# Read current value with su -c
current_brightness=$(su -c cat /sys/class/leds/button-backlight/brightness)

# Switch between 0 and 255
if [ "$current_brightness" -eq "0" ]; then
    su -c "echo 255 > /sys/class/leds/button-backlight/brightness"
else
    su -c "echo 0 > /sys/class/leds/button-backlight/brightness"
fi

 

And don't forget to chmod +x

And i had an alias in my bash.bashrc

alias kb='~/toggle_keyboard_backlight.sh'

And don't forget to 'source' it. 

Edited by zegoo
Link to post
Share on other sites
1 hour ago, zegoo said:

Do you know why when I type one character, two are displayed?
I'm trying to script a simple function to run with an alias to read /sys/class/leds/button-backlight/brightness and modify it to turn the keyboard on/off via Termux and all at once , my characters are doubled.😤

It is not a situation I have experimented with, so can not say.
You might try some software like like e.g. KeyEvent that shows the make and break codes for pressing and releasing each key.

  • Like 1
Link to post
Share on other sites
1 hour ago, zegoo said:

Do you know why when I type one character, two are displayed?
I'm trying to script a simple function to run with an alias to read /sys/class/leds/button-backlight/brightness and modify it to turn the keyboard on/off via Termux and all at once , my characters are doubled.😤

One clarification. Under what conditions is this happening?  When you run the script?  When you are using the script editor? When you are using anything in Termux? Or is this something that is happening everywhere, whenever you type on the keyboard?

I don't have any good answers, btw, but I would think anyone with answers would need to know that.

  • Like 1
Link to post
Share on other sites
Posted (edited)
20 minutes ago, Hook said:

One clarification. Under what conditions is this happening?  When you run the script?  When you are using the script editor? When you are using anything in Termux? Or is this something that is happening everywhere, whenever you type on the keyboard?

I don't have any good answers, btw, but I would think anyone with answers would need to know that.

@Hook, It was when i tried to save a file in nano with Ctrl+x. IDK why it happens but i have to full exit Termux to recover a working environment. In others Apps, there were not any issue with the Keyboard. So i decided to reinstall Termux from scratch. And, or now, to double char anymore. Wait & See.

 

Edit: This issue is back. I must exit Termux and clear the cache to get back my keyboard working with Termux as before. Very strange.

Edited by zegoo
  • Like 1
Link to post
Share on other sites

I cannot reproduce this with my Pro1-X. Not using Termux, though.

I'm running Debian 11 in a (rooted) chroot of LOS 20.0 and use ConnectBot as my terminal emulator. Your script works fine (with some trivial changes to match my environment).

As, also for you, the keyboard behaves normally in other apps, it seems to me that you are somehow triggering a bug in the terminal emulation of Termux.

  • Like 1
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

Terms