I love Tasker, but I’m sure you understand how annoying text input can be. When it comes to typing longer names, data point or list of variables to process JSON files in Tasker I often refrain to AirDroid screencasting and Join to copy and paste clipboard across. All in an attempt to speed up the boring bits. Thanks to Xiaomi MiiiW (review), I can switch between my PC and Android phone in an instance, so all I’m missing are some useful shortcuts. While I show this on Xiaomi keyboard, this hack will work with all Bluetooth keyboards.

Filling in the blanks

I know certain apps come with PC interfaces (WhatsApp Web, etc), but especially at work when computer activity is a subject to security and scrutiny of your superiors, this might be strongly frowned upon. These shortcuts open up a serious window for productive slacking, reducing the time you will spend glaring on your phone or responding to messages.

I played with interactive shortcuts before. In my Smart NavBar Tutorial, I was able to control music, clipboard, alarms, or even smart lights on per-room setting. This time I’m playing with hardware. Xiaomi MiiiW (how do you pronounce this?) comes with built-in shortcuts. These are activated with Fn button and you can:

F1-2 : control brightness

: control brightness F3 : recent apps

: recent apps F4 : not active

: not active F5 : refresh

: refresh F6 : search

: search F7-9 : playback controls

: playback controls F10-12 : volume control

: volume control Windows Key : Google Assistant

These will activate with Fn+ combination or when the keyboard functions are locked ( Fn+Esc ). To my knowledge, the default keys F1-12 are completely useless, and we can use it to map pretty much anything we want. So this is my plan, to improve the current shortcuts rooster and introduce new, useful actions.

Since I have a very cheap but very practical 3D printer Ender 3 (review), I will design labels that can be added to the keyboard, which you can also customise to your liking.

3D printing

This step is optional, but it will definitely add some flair to your keyboard and if you show up at a LAN party… Ok, it’s not 1995… Using Fusion360 I designed a lip that goes over the top buttons without obstructing the keys or the position of the mobile phone.

The lip comes with 7mm x 7mm slots, that can be populated with 6.5mm x 6.5mm buttons. A total of 12 buttons is needed to customise the keyboard. I made this modular, as I want you to be in charge of the button order and functions.

If you have basic skills in a 3D design you will be able to use .SVG files to extrude the icons on top of the files.

Buy Creality Ender 3 Buy it using these links to support NotEnoughTech. Creality AliExpress Banggood

Printing buttons

The buttons are tiny, so the label cannot be too complicated. If the resolution of the label is thinner than the extruder capabilities, it will be omitted. There are 2 routes to take:

Print as one, paint later

Print the base, pause, change filament, print out the icon with a different colour

If you want to paint the buttons, the white filament is recommended. Prime the button first, then use acrylic paint to paint the icons to your liking. Use wash and drybrush techniques to bring out the details. Allow the paint to dry and use acrylic varnish to seal the button and prevent the paint from rubbing off.

You can skip painting entirely if you have two contrasting in colour filaments. Print out the base of the button, and use Cura – Extensions – Post Processing – Modify G Code to add script at line 14 (if you use my .STL). You can pause the print and move the extruder to x:0 y:0 , retract the filament and change it to a different colour. The printer will wait until you are done.









Tasker

Thanks to Tasker and the latest LogCat event I can intercept button presses on Xiaomi Mi9 (review). The F1-12 are identified as 131-142 and can be intercepted with:

#Component BaseMiuiPhoneWindowManager #Filter keyCode:131 down:true

Due to Component name being ROM specific, you will have to look up your actual name using LogCat. If you never used the LogCat Event before here is the visual guide:

AutoInput as an alternative

IMPORTANT! Read this if you are not able to find LogCat entries for keyCode events.

In case of my Pixel 3 running on both Android 9 and Android 10, I was not able to detect these entries. You can still enable the same functionality with Event - AutoInput Key . In addition to that, you could create a Bluetooth profile to enable and disable accessibility setting for AutoInput when the keyboard is connected|disconnected. You can achieve this with AutoTools Security Setting (Accessibility Services).

AutoInput uses the same system to intercept key presses. Shortcuts with Shift , Alt and Ctrl will be available but unless you can see custom Fn functions in your LogCat, you are out of luck for these.

TASKER PROFILE: Profile: MS Keyboard AI Settings Restore: no State: BT Connected [ Name:MIIIW Dual-mode Keyboard Address:* ] Enter: MS Enable AI access+ A1: AutoTools Secure Settings [ Configuration:Set Accessibility Services: true Accessibility Services: com.joaomgcd.autoinput/com.joaomgcd.autoinput.service.ServiceAccessibility Timeout (Seconds):60 ] Exit: MS Enable AI access- A1: AutoTools Secure Settings [ Configuration:Set Accessibility Services: true Timeout (Seconds):60 ]

On to the shortcuts

Obviously, use it with key input and search for keyCode . I suspect the keyCode for F1-12 will be the same for everyone, regardless of the keyboard used. If you want to map other keys, you will have to intercept it one by one.

We know how to trigger Tasker on keystrokes, so let’s create some fun shortcuts. Leave me a comment in this Reddit thread if you come up with other fun shortcuts.

Buy Xiaomi MiiiW Keyboard Buy it using these links to support NotEnoughTech. Banggood

Conclusion

If you have a spare Bluetooth keyboard laying around, you can use it with your phone to become a power user. If you are thinking about a keyboard that can be used for both PC/Mac and mobile phones, consider Xiaomi MiiiW Keyboard. It’s pretty great, just don’t tell your boss you got one! Let me know if you have fun projects in mind in this Reddit thread.