Virtual touch buttons for android. We get customizable on-screen Home, Back and Menu buttons on any Android device (Floating Soft Keys). Method number two. On-screen keys

When I once again got a smartphone with hard-wired navigation keys, with no way to customize them or activate Nexus-style on-screen keys, I decided that I had to do something about it. After rummaging through Android's internals for a couple of hours, I turned off the annoying backlight, swapped the Back and Review keys, then turned on the on-screen buttons and found peace.

Intro

Let me be clear: I'm a big fan of the idea of ​​on-screen navigation keys. All these houses, arrows and squares drawn right at the bottom of the screen. Yes, they take up some space (which, however, in most cases is not really needed), yes, perhaps they spoil appearance apps, but damn, they're dynamic.

On-screen navigation buttons rotate with the screen, disappear when not needed, change color, and integrate seamlessly into the home screen interface. If we discard the very idea of ​​the uselessness of the existence of three buttons at once (after all, Apple people make do with one and do not feel disadvantaged) and quite convenient navigation systems like PIE or the “MIUI navigation bubble”, then on-screen buttons are the best that has been invented before so far.

So here it is. For some reason, my wonderful, wonderful idea that there is nothing better than on-screen buttons is not shared by very many smartphone manufacturers. And they don’t even just not separate, but they don’t separate in a completely monstrous way, forcing you to use a smartphone with touch buttons (AAA!), equipped with dynamic backlighting (AAA-2!) and a “Back” button on the right side of the screen (AAA-3: decisive blow ).

The situation is extremely unacceptable, and given that the kind firmware developer did not provide any settings for activating on-screen keys and settings for controlling touch buttons, I had to make do on my own. There were two options for further action:

  • bring touch buttons to the desired state, namely, turn off the backlight and move the “Back” key to the left side (let it look like a “square”, it’s even more interesting);
  • disable touch buttons completely and activate on-screen buttons.

I don’t like third-party tools, so the decision to do everything myself came naturally.

Method number one. Setting up touch buttons

First, let's try turning off the button backlighting. For this we need root, a terminal emulator and a directory /sys at the root of the file system. This is exactly the combination. We are dealing with the Linux kernel, and in systems based on it, everything important information about the hardware, as well as the “toggle switches” that control it, are usually located in the sysfs file system connected to the directory /sys.

Actually, sysfs is not even file system, more precisely, it is file-based, but operates with so-called synthetic files. But they are not stored on disk, it is a kind of interface for communicating with drivers: I read the file - received data about the hardware, wrote it down - changed some setting. And to record, you still need root rights.

So, we get root, launch the terminal emulator (or better yet). And we write the following:

# su # cd /sys

# find -name \*button\* ./leds/button-backlight

Bingo! This is a directory /sys/class/leds/button-backlight. Let's go into it and see what's inside:

# cd /sys/class/leds/button-backlight # ls brightness device max_brightness power subsystem trigger uevent

I bet my Nokia 3310 that the file brightness is the current brightness of the buttons, and max_brightness- maximum. Let's check our guess by writing the value 100 into the first file (well, like 100%, although what scale there is is unknown):

# echo 100 > brightness

Great, the buttons are lit and are not even going to go out.

Moment of truth - write the value 0 to the max_brightness file:

# echo 0 > max_brightness

The buttons went out, forever, like the light bulb in my entrance last night.

But just like a light bulb, they can come back on if you reboot. That is, the command is valid only in the current session. Fortunately, this is not a problem, we will put our command in a script on the memory card:

# mkdir /sdcard/boot # echo "echo 0 > /sys/class/leds/button-backlight/max_brightness" > /sdcard/boot

And we, in turn, will put it into startup using . We launch the application, select the first three checkboxes, using the Select folder option, select the boot directory on the memory card.


Half the task is completed, all that remains is to swap the positions of the “Back” and “Browse” buttons. To do this, you need to change the button layout. In Android it is located in several directory files /system/usr/keylayout/. There are quite a lot of them, but if you discard files like Vendor_2378_Product_100a.kl And qwerty.kl(they store layouts of full-fledged Qwerty keyboards, which Android supports out of the box), then there will be at most five left.

One of them is exactly what we need. Smartphones often use the file ft5x06_ts.kl, specific to the FT5x06 touchscreen controller (the buttons are touch sensitive, right?), but in my case it turned out to be the file Vendor_2378_Product_100a.kl.

If you open this file, you can see the three lines you are looking for:

Key 158 BACK VIRTUAL key 139 MENU VIRTUAL key 102 HOME VIRTUAL

All that remains is to swap the numbers 158 and 139 (any file manager with support for root rights). After the reboot, the new layout will take effect.

Method number two. On-screen keys

Everything is even simpler here. Android has a special debug variable qemu.hw.mainkeys, which allows you to control the visibility of on-screen navigation keys. If it has a value of 0, the keys will be shown on the screen, 1 - the opposite effect.

We write a variable with the desired value to a file /system/build.prop, and that is all:

# su # mount -o remount,rw /system # cp /system/build.prop /system/build.prop.bak # echo qemu.hw.mainkeys=0 > /system/build.prop

conclusions

These are the kind of criminal steps you sometimes have to take to make your smartphone a little more convenient. As for me, I settled on the third option: “turned off” the buttons plus installed LMT Launcher. It seems to me that this is the most convenient way of control.

Mechanical buttons on a smartphone are a thing of the past, from those times when people boasted about the number of voices in polyphony and colors in the display. We didn't have it then touch screens and other achievements of progress, on my Alcatel the Home button was completely replaced by a joystick.

But now is a different time, the concept of controlling gadgets is moving away from all kinds of unnecessary clicks, touch interfaces make the main control element your own finger, sliding in a certain gesture across the display. Following the abandonment of mechanical keyboards, manufacturers began to abandon physical control keys, replacing them with on-screen ones. And the new generation of smartphones even unlocks without pressing the power button; Moto X just needs to be taken in your hand, and LG G2 you just need to tap on the screen.

But what to do if you have not yet splurged on a new gadget, but want to experience the beauty of controlling a device according to the latest technology?

Gravity Screen - On/Off

This application will help out those who want the phone screen to become active as soon as it gets into the owner's hand and turn off once it is on the table or in the pocket.

It collects data from the proximity sensor and gyroscope, locking and unlocking the screen at the right time. I tried it and decided to leave it. this is very convenient when the phone lights up as soon as you take it in your hand, it does not go out, analyzing the slightest movements of your hand when you read information from the screen, and turns off as soon as you put it in your pocket or put it on the table. You just need to get used to not pressing the power button for old times sake.

Basic Features The apps are free and include settings for trigger angles and sensitivity. For a little more flexibility you have to pay about $2.

Refusal of a physical button in favor of gestures also brings a little goodness to the user’s life. Especially in the context of tirelessly growing screen diagonals. And Swipe Home Button will help with this.

Making a gesture with your finger is much easier than grabbing your phone to reach the menu button. In the settings you can assign actions such as: pressing Home buttons, opening some application or notification curtain.

Unfortunately, the application does not have a back button. Due to the nature of Android, this requires Root, and the developer apparently does not want to go that route. If you have a cool suggestion based specifically on gestures, share it in the comments!

For those for whom it is not important to control the movement of a finger, but an on-screen button in an accessible place is enough, there are options like: Back Button or Handy Soft Keys. But I didn't like them.

How do you “manage” your gadget?

Problems with hardware often turn out to be much more complex and expensive than problems with software. It’s very disappointing if the screen falls off, but, as a rule, I can easily replace it. But the buttons can be a lot more fiddly. If you find yourself in a similar situation (click on Home, Back or Menu does not lead to any consequences), then the application will come to the rescue. After installing it, you will receive a panel consisting of 4 buttons: Home, Back, Menu And Resize. Make a note of what you need root access on the device.

After installing the application and launching it for the first time, you will receive a panel with buttons that will be located in the center of the screen. Its location can be changed; you can also adjust the size of the buttons, the distance between them and the transparency of the panel itself.

For button Home you can customize its behavior when pressed for a long time: either it will launch Google Now, or work as a button Power. Besides Floating Soft Keys allows you to change button icons. If you want to choose a vertical panel layout, then to do this you simply need to uncheck the box next to the horizontal layout option in the menu. There you can also activate the application to turn on when loading.

He behaves very smartly. If the panel overlaps any buttons or options running application, then it automatically changes its location on the screen, but there is one drawback. After the application that caused the panel to change its position is closed, the panel itself will not be able to return to its old location. This will have to be done manually.

It would be nice if the developers upgraded the existing buttons big amount functions and added volume control to them. But for now these are just dreams. If you are interested in such a practical thing as, and are already planning to download the application, then you

A lightweight utility that greatly simplifies working with the device.


Introduction:

Which button does each user use most often per day? This is either the Home button or the Back button. The application under the name was created in order to expand the functionality of the Back button by linking to it the ability to control gestures, which will automate some other system functions. It is worth understanding that the usual Back button will remain in the same place, and the application adds its own, which, at the same time, will not take up much space.



Functional:


To use the application Root rights is not required, but instead you need to activate the service for the application in the “Accessibility” section. The functionality of the application turned out to be quite simple, but the fact that it works and does not at all interfere with the usual work with the device already deserves some praise. On the main screen there are 3 types of actions that you can perform with the button: hold, swipe up and swipe down. For each action, you can choose one of 5 actions:
1. No action.
2. Home
3. Recently launched applications
4. Notifications
5. Hide the button
Gestures are performed as follows: place your finger on a button, and then swipe up or down, and a border of a certain color will appear on the button itself. Naturally, if you simply click on the button, it will work exactly the same as the system Back button.


Results:


In the settings you can turn off the application, as well as remove notifications that allow you to hide or show the button. Let's summarize: it is quite capable of making using the device much easier and more convenient, especially if you get used to such actions. Enjoy!

Everything always breaks unexpectedly. Dropping a phone on a tiled floor is an unfortunate accident; drowning it in a bathtub is a banality that occurs more often than it seems at first. Statistics of requests to service centers contains many complaints about accidents from the “it fell and broke” series, even more often than drownings. At the same time, you should not expect that the very first fall will take away the touch substrate or even the screen itself - in most cases, the consequences of unfortunate accidents do not look so destructive. Among other things, this is a sudden inoperability physical buttons"back, home and menu." If this problem happened to your phone, but you still don’t have money for repairs, don’t worry. There is a relatively simple solution to this common problem. Now we will teach you how to enable on-screen buttons on your smartphone if the physical ones no longer work.

For everything to work, you need to get Root rights. Administrator access to the depths of system files is sometimes difficult to obtain. But with the advent of apps that get the necessary access for you, you no longer need to read multi-page instructions. Just install the Kingo Root program on your computer and connect your phone. The only thing you need to do while the program is being installed is to enable “USB Debugging” in the phone settings, “Security” section. That's all. By clicking the big Root button in the interface Kingo Root, activate administrator rights.

Step two looks a little more difficult. You will need to download from Google Play(or a little... alternative sources) Root program Explorer. Install it on your smartphone. Run this application, find the System directory, and in it - build.prop. If such a file is not visible in the system directory, it doesn’t matter. There is an ellipsis in the upper corner of the program - tap on it to open a submenu. In the program settings, check the “Show hidden files" The loss will be discovered immediately.

In the left corner Root Explorer There is one more item we need - r/w. Tap it once and confirm your choice. This action will enable the ability to edit system files. Now touch build.prop and keep your finger on it. Top Menu will change and from the drop-down list (in the same ellipsis) you will find the sub-item “open in a text editor”.

Scroll open file to the very bottom - all these long lists of settings are not needed yet. At the very bottom, add the line qemu.hw.mainkeys=0. Save the file and restart your phone.

Done, three on-screen buttons have appeared at the very bottom of the screen - similar to what you can see on the screen of any tablet. And after repairing the physical buttons, it will be possible to hide the virtual ones back by replacing the line qemu.hw.mainkeys=0 with qemu.hw.mainkeys=1 and rebooting the device again.