All Discussions
  • General
  • [Tool] LG Classic Flip - Customize Launcher Hotkeys

Started by Biden2020prez · Feb 13, 2023
Biden2020prez


CustomLG-Hotkeys

Modify the launcher hotkeys on the LG Classic Flip to ANY CUSTOM APP Activity!

Why?

Because the LG Classic Flip only supports pre-configured apps for the launcher shortcut keys. This means we can't set a shortcut to any third party apps. But using ADB we can fully customize these hotkeys!

What?

CustomLG-Hotkeys will fully customize which activities you want to launch using the shortcut keys. Say goodbye to limitations!

How?

Just download the file at the bottom of this post, extract it, and open customhotkeys.bat. Navigate on your phone to the screen you want to open from the shortcut key, then continue. Choose what key you want to set, and... That's it! Done!

What does it do?

CustomLG-Hotkeys works using the following logic:

  1. It pushes a bash script to /data/local/tmp. The bash script uses dumpsys window windows | grep -E 'mCurrentFocus|mFocusedApp' to find the current activity (with sed to narrow it down to exact text).
  2. It instructs the user to navigate to the screen he wants to set as the shortcut key.
  3. It runs the script and saves the output.
  4. It gives the user the option to choose a key.
  5. It runs settings list system commands to set the package and class name of the keys.
  6. It force stops the launcher app so the settings can take effect.

License

This is free to use, distribute, sell, brick your phone, or do whatever else you want with it.

Github Repo / Contributions

Found a bug? Want to fix something? Add a feature? All contributions are welcome, just leave an issue in the Github Repository of this project. https://github.com/biden2020prez/CustomLG-Hotkeys

Download


CustomLG-Hotkeys.zip

FliphoneBochur

This code is great! My one suggestion would be to set the menu choices as arrow presses (meaning, press the arrow key corresponding to the direction key you're setting). I tried looking up how to do it, and I couldn't figure it out. Maybe you know?

Biden2020prez

FliphoneBochur I was thinking that too. I don't think it's possible in batch scripting, but I can probably use a 3rd party binary or powershell for it. Not sure if it's worth it.


FliphoneBochur

Check this out. Tell me if it works. I tried it and it registered as capital letters, but you could try playing around with it and let me know.

Biden2020prez

FliphoneBochur I think they have similar opinions...

It does not seem possible with batch files. The apparent workaround it to write or find a console application which you could run from your batch file, but… does it pay of to bother about it? I don't think so? The batch files have considerable value if they can work in any system, without additional utilities, especially those written only for the purpose of extending batch functionality.


I was able to make a batch file that can detect arrow key press, but it's using powershell to do so. Not a huge deal, but makes it a bit slower. I may or may not use it.

FliphoneBochur

Biden2020prez Could you please email it to me? I think I saw the same method on stack overflow. Thanks!

Biden2020prez

Biden2020prez There can be some other ways. For example, using ADB I can ask the guy to press the key on his phone. Or I can use msvcrt from python. But I don't think it's such an important feature that's worth overcomplicating this.

3474336863

Biden2020prez please post it in Google drive, Also post your other project from github.

FliphoneBochur

Biden2020prez This is free to ... sell

And keep all the profits? How much is the going rate?

Biden2020prez

FliphoneBochur lol. Just saying that I have no rules and I dont need credit. going rate is free and open source.

@Biden2020prez So we should be able to set a hotkey to launch the AppLauncher app!
How.simple would it be if we know the Key, Package, and Activity beforehand? How many lines of code?

Biden2020prez

Using my batch script you can easily set for the applauncher. To include the code in your launcher, it would be pretty simple. My batch script just runs two settings put system commands, and the rest is just to detect the top activity.

From what I recall, apps only need WRITE_SECURE_SETTINGS for secure and global, not system. however, my batch script also force stops the launcher for the settings to take effect. I don't know if you're app can do that. After a reboot you should be fine.

Maybe you are interested in making an app that can set all the shorcut keys to any app 🙂 🙂?

Biden2020prez

If someone can test this on an LG Exalt that'd be great

Biden2020prez

I added the arrow key function. Was a headache getting it working. In terms of showing the arrows keys in the batch script, I found a way to do it, but it messes some things up, so I may not include that. I am too tired from all this so I'll put it together as a release another time.

samtee

what does this do for me

SamFried

Its possible to get it to work on the kyocera too?

samtee

how can i put back to normal

Biden2020prez

samtee Settings > Phone Settings > Key Shortcuts > reset

Biden2020prez Do you think this can be used to program the soft keys on the top to other apps than the preset ones?

Biden2020prez

dovi No. those are stored in the launchers app data and cant be changed

Atusb

Biden2020prez Thank you. this is great to make a shourtcut to lgsettings.apk