[Xposed Framework Modules] Vohukain:
Keyboard and OneHand Mode (Auto switch)

Check out my previously post so you know what I'm talking about. I made the keyboard switch now working with Tasker and AutomateIt. You need also Secure Settings or Keyboard Swap for Tasker plugin. I used Secure Settings. Basically I made a toggle (widget) which changes my keyboard when I press it (in my case Thumb Keyboard-->AOSP Keyboard-->Thumb Keyboard-->AOSP Keyboard... and so on). Then I made a rule with AutomateIt which "press" that toggle when I press OneHand Mode toggle. So when I go to OneHand Mode, my keyboard switch from AOSP to Thumb. When I leave OneHand Mode my keyboard switch from Thumb to AOSP. I have enabled OneHand layout by default in Thumb Keyboard settings. So now I have automatic OneHand layout in OneHand Mode. That is very cool!

Here is the quide if somebody wants to try. It is pretty safe to do but little bit complicated if you haven't used Tasker before. Needs root and OneHand Mode of course (sherlock ;))

- Install Tasker, AutomateIt and Tasker plugin Secure Settings (or Keyboard Swap for Tasker). Also you need atleast two keyboard and you need to enable them both from Android settings

- Open Secure Settings and enable System+ Actions. You need to reboot your phone after that.

- Open Tasker and go to "TASKS" tab

- Make a new Task by pressing "+" icon and name it as "Toggle". Then do this:

Press "+" icon again to make new action

Select "Variables"

Select "Variable Add"

Name it as "%TOGGLE"

Set the value to "1" (it can be 1 at default also)

Set the Wrap Around to "2"

Accept action by pressing in the left up corner "<" icon and Tasker logo

Make new action (to the same task) by pressing "+" icon

Select "Task"

Select "Perform Task"

Name it as "OneHand Mode In"

Go to the If section and press "+" icon

Put the name as "%TOGGLE" and the value as "0"

Accept action by pressing in the left up corner "<" icon and Tasker logo

Make new action (to the same task) by pressing "+" icon

Select "Task"

Select "Perform Task"

Name it as "Normal Mode In"

Go to the If section and press "+" icon

Put the name as "%TOGGLE" and the value as "1"

Accept action by pressing in the left up corner "<" icon and Tasker logo

Press the icon in the right down corner and select what ever icon you want to choose for this task. This icon will be in your homescreen

After you have chosed icon press in the left up corner "<" icon and Tasker logo

- Make new task by pressing "+" icon

Name this task as "OneHand Mode In"

Make new action by pressing "+" icon

Select "Plugins"

Select "secure settings"

Pres the "pencil" icon in the Configuration section

Select "System+ Actions"

Select "Input Method"

Select the keyboard which you want to use in OneHand Mode (I selected Thumb Keyboard)

Save this by pressing the "old floppy disk" icon

Accept action by pressing in the left up corner "<" icon and Tasker logo

Accept task by pressing in the left up corner "<" icon and Tasker logo

- Make new task by pressing "+" icon (same thing again for normal mode)

Name this task as "Normal Mode In"

Make new action by pressing "+" icon

Select "Plugins"

Select "secure settings"

Pres the "pencil" icon in the Configuration section

Select "System+ Actions"

Select "Input Method"

Select the keyboard which you want to use in normal mode when the OneHand Mode is disabled (I selected AOSP Keyboard)

Save this by pressing the "old floppy disk" icon

Accept action by pressing in the left up corner "<" icon and Tasker logo

Accept task by pressing in the left up corner "<" icon and Tasker logo

- Close Tasker (IMPORTANT: DO NOT USE BACK BUTTON, JUST CLOSE TASKER)

- Go to apps menu and then go to widget tab

- Find and select "Task" (not "Task Shortcut")

- Long press "Task" and select the "Toggle" that you created ealier

- I don't remember anymore that does the toggle widget go to the home screen automaticly or does the Tasker open. If the Tasker open then press in the left up corner "<" icon and Tasker logo. After that close Tasker

Now, check that if the toggle widget works. Press the toggle and open browser and start typing. Check if the keyboard is changed. Then press toggle again and check keyboard again. If everything is working good you can continue. If not maybe this video will help you. It is long video but you can start looking it at 5:00. I used that tutorial to make this working.

-Now we can make the OneHand Mode toggle to "press" the toggle we just made. Open AutomateIt and disable/delete the 6 default rule if you want to. Then:

- Select "Add rule"

- Select "Application Status Trigger" in the Common section

- Select the blue icon which has magnifying glass in it in Application section

- Find and select "OneHand Mode" (it is the Xposed Module).

- Press "Next"

- Select "Run Shortcut Action" in the More... section

- Select the blue icon which has magnifying glass in it in Shortcut Info

- Find and select "Task Shortcut" (Tasker icon)

- Select the "Toggle" (which you made earlier)

- If the Tasker opens just press in the left up corner "<" icon and Tasker logo. You should be back in AutomateIt then.

- In AutomateIt app. Press "Next"

- Save you rule by pressing "Save" or the "old floppy disk" icon. (If you don't want so see any annoying pop up text change the "Show rule popup when launched" from "default" to "no", remember to SAVE)

It is done! Now when you press OneHand Mode toggle it also "press" the toggle which changes keyboard. Super cool!

TIP: You can use All in one Gestures to make a gesture for OneHand Mode. For example I have to to only swipe from down to up to enable/disable OneHand Mode. And yes, the keyboard changes also when I swipe. :highfive: