Auto Keyboard

Using the Bluetooth Auto Keyboard | Custom Script Injection

Main Idea

This article will quickly explain how to use the Bluetooth autotype keyboard functionality on PolyCast5. This is probably one of the top features, so I figured it would be a good idea to explain it and what all it can do. I'll also go over how to use some bonus capabilities like perfect mimicking to copy human keystrokes and selective device pairing to remember and reconnect to different Bluetooth devices.

Basically, auto-typing works by pretending to be a typical Bluetooth keyboard. The only difference is that instead of a person typing, it is a computer. This is why it types super fast compared to our slow human fingers. Let's check out how to use it!



Writing a Keyboard Script

This sounds like something hard but it really isn't. This is basically just some simple instructions for PolyCast5 to read in order to perform whatever task you want it to.


Simply click on the 'Add/Edit Script' button on the PolyCast5 'Auto Keyboard' menu and connect to the web portal via the on-screen instructions. From there, you'll see a page like this:

From here, your first step is to create a category to start saving scripts under (the series of commands to run). This is just a useful organizational thing to make finding them easier. After that, select the category you just created and we can write our first script!


Like I said, a 'script' here is just the sequence of commands we want to execute over Bluetooth. If I wanted to type "PolyCast5 is cool!", my script would just be:

PolyCast5 is cool!

But what about something a bit more complex? What if I wanted to automatically open Notepad on Windows and then write "PolyCast5 is cool!" there?


Well, with a simple internet search I can find that clicking Win+S (holding the Windows button then clicking the 'S' key) would open up the Windows search bar at the bottom. From there, I could type 'Notepad' then hit enter to open it. Then if I start typing again, I could type whatever into Notepad. Great! So the script for that might look like this:

<win+s>notepad<enter>PolyCast5 is cool!

Now I can try it out! (Make sure to click 'Save' before exiting the web portal or clicking back on your PolyCast5.)


But wait, when running it I notice that sometimes it doesn't work like it should. Sometimes it starts typing before notepad is opened, or searches before the device has finished typing what to search. This is because the PC expects a person to type and search on a normal keyboard, and we type much slower. It simply wasn't designed to be able to bring everything up fast enough to work like this, because there isn't a need to for a typical human user. But fear not! We can fix this by adding short delays:

<win+s>notepad<delay=500><enter><delay=250>PolyCast5 is cool!

Now, there is a 500ms (0.5s) delay between searching 'Notepad' and clicking enter to open it as well as a 250ms (0.25s) delay after opening Notepad to allow it to finish opening before typing. This now works because it aligns with the minimum time the computer would expect a person to be able to do this without user experience loss. But of course, the total time to do this now is like a second, which is still much faster than a person. These delays may also vary slightly based on your machine, so you might have to tweak it a little bit.


If you'd like to see some other examples of scripts you can use, such as for iPhone or other computers, you can check them out here.

After writing whatever script you want, simply click 'Save' through the web portal. Then, like magic, it will will sync to your PolyCast5! Super cool.



Selective Bluetooth Pairing

Selective pairing is another super awesome feature of PolyCast5 that opens up some interesting possibilities. Basically, it allows PolyCast5 to remember devices it has previously paired to and then re-pair to them on command! This means if you connected to your friend's phone last week, you can re-pair to the device this week even if you paired to other devices between that time. (Assuming he/she didn't forget your device in phone settings.)


Though, you can of course also just use it to switch between your own devices.

Needless to say, this opens up some interesting pranking possibilities by pairing to someone's phone beforehand, then reconnecting to it later to run a given script/do something, then disconnecting again afterwards. This is actually quite a cybersecurity problem that can be exploited for people who have a messy list of Bluetooth devices and don't look carefully at what is allowed to connect to their device. If they never forget your device in settings, you can reconnect again whenever!


(Though I should mention that this PolyCast5 function is meant to be used ethically as a convenience for pairing between your own devices or with permission.)

Messy Bluetooth list - example target!

Pretty interesting! To help make switching between the devices easier, after connecting once you can also rename the given device on your PolyCast5 to something more human-friendly than the MAC address.



Recording and Reusing

But what if you want to do something complex and specific like automating something, gaming, or similar? Fear not! This section will show you how to record your real-time human keystrokes and auto-translate them into the PolyCast5 auto keyboard format to replay at will.


Typically, this would be annoying to set up. You would need to write a script for this (like our example) with all the correct timings, which would take forever to do with trial and error. Luckily, we can use cool tech to our advantage here. Simply run the python script below on your computer.

PolyCast5 Keystroke Recorder

PYTHON FILE • 8 KB

Download

With it, anything you type on your keyboard will be recorded and translated into the PolyCast5 auto keyboard format as a perfect mimic for you to copy and paste back into the web portal and use.

I promise these are two seperate recordings!
The recording used above

Awesome!


If you're unsure how to run this python file, go to the folder where it's located and open a terminal there.


You will need python installed (go to the site and download if not already done), as well as pynput which can be installed after python in the terminal with:

python -m pip install pynput 

After that, in your open terminal (which was opened in the same folder as the recorder script), you can enter the command below and it will start running.

python pc5_keystroke_recorder.py --outfile pc5_recorded_script.txt 

From there, you can click backtick ' ` ' to start/pause the recording. When you click ESC to stop recording, all the keystrokes you made will be saved into a new text file named pc5_recorded_script.txt in the same folder as your pc5_keystroke_recorder.py. You can then copy and paste that output into the web portal for PolyCast5 to use!


Note: You may have a large delay at the beginning from the time you start running it until you record. Simply delete it out of the result if needed.



Thanks for reading! I hope this was a helpful and informative article. If you have any questions, please feel free to leave a comment below.


Happy casting!

Back to blog

Leave a comment

Please note, comments need to be approved before they are published.