Tuesday 22 July 2014

USB Remote v1.1

Update via GooglePlay should be available within next few hours.

What's new in v1.1?

- Macros
- Change Log
- Dvorak keyboard layout

It is now possible to create (record) and execute simple macros using USB Remote app. Just like it happened before with Media Remote and Barcode Scanner apps, instead of releasing separate app, the functionality has been added to USB Remote.

First, a few important remarks:
  • Because of Bluetooth latency timing won't be precise
  • There are no editing features in this release. It won't be possible to modify macro after recording.
  • After running new version of USB Remote you should notice that new tab is visible: "M" macros. You can enable/disable this tab at any moment: Settings -> Choose visible tabs.

Here are definitions of basic concepts, just to keep things clear:

Macro - a set of actions, arranged in a specified order.

Action - there are following types of actions:

Keyboard - single USB keyboard report (state of keys at a given moment).
KeyPress - pressing given key, followed by its immediate release.
String -  typing given text.
Mouse -single USB mouse report (state of buttons, x,y and wheel displacement).
MouseClick - pressing and releasing given mouse button n-times.
Consumer - single USB consumer report (media buttons, volume control).
Delay - period of time to wait before executing next action.
Sync - wait until buffers of all interfaces (keyboard, mouse, consumer) are empty.

To better illustrate how sync action works:

Example: Macro - 1:

String: "type some text" -> Mouse: Left,0,0,0 (press LMB: left mouse button).

Since USB endpoints are independent and can be polled by USB host at any time, executing this macro will result in LMB being pressed at the same time key "t" is pressed.

Example: Macro - 2:

String: "type some text" -> Delay: 300ms -> Mouse: Left,0,0,0.

We can never be sure if 300ms is enough for USB host to receive all text, before LMB will be pressed.

Example: Macro - 3:

String: "type some text" -> Sync -> Mouse: Left,0,0,0.

Now we can be sure that LMB won't be pressed until all text is typed.

Example: Macro - 4:

String: "type some text", Sync, Delay: 100ms, Mouse: Left,0,0,0.

If USB host needs some time after text is typed (for example: to do spell checking or auto-save), it may be a good idea to add additional delay action. Otherwise it may happen that pressing mouse button will be ignored.

Creating a macro:


1. Recording settings:

Skip delay if shorter than - any delay shorter than current value, will be completely removed. Use this to remove unnecessary delays and perform actions as fast as possible. NOTE: sometimes it is necessary to put delay between actions, to give USB host enough time to process them. Use blue "Timing" button to manually insert delay/sync actions.

Reduce delay if it is longer than - any delay longer than this value will be reduced to match this value. This allows you to eliminate only long delays, while leaving shorter ones, which may be necessary to give USB host enough time to process keyboard and mouse input.

Automatically insert Sync - sync actions will be automatically inserted when different interface is used (example: moving mouse after typing text).

By default both values are set to 1s. This leaves only short delays (giving USB host enough time to process input) and eliminates long delays, which usually are unnecessary.

If both values are set to Never, all actions will be recorded in real time.

Setting can be modified when recording is in progress.

2. Start recording:

Go to "M" macros tab, click "Record macro" button. Start recording using red "Record" button. At any time you can pause recording (this will affect next delay action) and resume it by pressing "Record" button again.

3. Perform keyboard/mouse/consumer actions:

All keyboard/mouse/consumer actions performed using all other tabs will be recorded.

TIP: if you want to enter long text (for example: commands), use text field and "Type" button from "Ab" text tab. This will help to avoid missclicks and typing mistakes.

If you want to manually insert delay or sync action at a given moment, use blue "Timing" button.

4. Stop recording:

After recording all actions, go back to "M" macros tab and click on "Stop" button. You will be asked if you want to edit your macro now (change name).

Note: all delay and sync actions which are not followed by any other type of action will be removed. Example:
String: "type some text" -> Sync -> Delay: 100ms will be transformed into: String: "type some text".
Sync -> Delay: 100ms will result in empty macro (can't be saved)

Executing a macro:

To execute, select a macro and press "Play" button. At any moment you can cancel execution by pressing "Stop" button.

Youtube video:

In this video I demonstrate two very simple macros:

1. Run command prompt (Win + "cmd" + enter), type "exit" to close it.
Settings: skip delays shorter than 1s, reduce delay if longer than: 1s.

2. Run notepad (Win + "notepad" + enter), type "hello there".
Settings: skip all delays. Delays were added manually.

BTW: Next application that will get update is InputStickUtility. After that, GooglePlay version of Password manager will be available.

Saturday 12 July 2014

USB Remote v1.01

Yesterday I've released new version of USB Remote on GooglePlay. What's new?

- bug fixes,
- added Portuguese and Slovak keyboard layouts,
- user will be asked to download InputStickUtility if it is not installed,
- mouse can be also used from "Keyboard" tab (activated in settings). Can be laggy on older / low-end devices. May not be visible on low-res devices.

I hope that this dialog message will help to clarify that additional software (and hardware) is required. Basing on number of app installations, it looks like a lot of people not familiar with InputStick try to use this app (which in such case is of no use at all).

If your device's screen is big enough, you can now enable mouse support in "Keyboard' tab. The problem is that because the tab is already populated with a lot of UI elements, refresh rate is much slower than in "Mouse" tab. Depending on how powerful your hardware is, it may work relatively OK (Motorola Moto G, quad-core) or there will be noticeable lag (Motorola Razr, dual-core).

Also, if anyone wants me to add support for particular keyboard layout, please let me know by leaving a comment.

Wednesday 2 July 2014

Encryption - now available

I assume you are already familiar with my previous post.

First, some info about new firmware version: 0.91:
  • supports AES-128 (CBC mode) based data encryption,
  • can be password protected,
  • "Restore Defaults" functionality - erases all user settings (includes password protection).

Version 0.91 is not really "safe" yet. There are two "vulnerabilities" that I've left there intentionally:
  • "Restore Defaults" procedure works immediately. Normally it would take a while (more info here).
  • It is possible to access bootloader and replace firmware even without knowing password.
The reason for all of this is that password protection can permanently lock the device. Since this is a very first public release of firmware that supports the password protection mechanism, it is not possible to rule out that there may be some serious bugs (both in firmware and InputStickUtility app). I don't want anyone to be left with permanently locked device or to spend a lot of time going through restore procedure.

If there are no serious problems found, these "features" will be removed form next version.

Now, new InputStickUtility app:

New buttons (bottom row, starting from left) : Security, Firmware Upgrade, Info:


App password (key) is stored in InputStickUtility application. If you believe that your device is properly protected, you can consider to store the password also in plain text form.

Encryption key is stored in InputStick flash memory. If you will use the device with some other Android device, you'll have to provide its password. That is why it may be a good idea to store also the plain text version: it won't be used on a daily basis, so most people will probably forget it eventually.

Obviously, both passwords must match.

In case if you forget the password (and it is not stored in plain text form or the Android device got lost or destroyed) you can use "Restore Defaults" option. As mentioned before, in this version it will work immediately.

Security settings will be available only when firmware version of the device is at least 0.91.

Firmware Upgrade:

Here you can upgrade your device to new firmware version. It will erase all user settings (this includes encryption key) form the InputStick device.


Displays basic info about the device.

Select device activity:

I also modified "Select device" activity a bit: now it won't disappear immediately after selecting device.