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.

10 comments:

  1. Very nice and very handy. Keeps getting better.

    ReplyDelete
  2. Hi, on my Galaxy Note 3 with CM11, USB remote will crash if i click on edit button of a macro. Do you need some logs to support you ?
    (Crash: com.db4o.ext.DatabseClosedException
    Source: com.dbo4.internal.ObjectContainerBase.)

    I hope its not to hard to say, but as the keepassplugin works like a charm and keepass is a well known opensystem passwordsafe i think we dont need another passwortmanager, as far as you dont add some awesome features that keepass dont has :). For me i would need at least a import export tool to sync the passwords between desktop and phone.


    Keep up the good work and updates for this great product!

    ReplyDelete
    Replies
    1. I have this same problem on my stock/unrooted Nexus 5... it crashes when I click on "edit" of a macro and it crashes when I click on "record macro". It worked until I had two macros recorded.

      Delete
    2. Looks like there is a problem with database library, however I couldn't replicate it on any of my devices. Could you let me know if this version makes any differences?
      Download URL:
      https://drive.google.com/file/d/0B2RufT7QrvYGajRwV3VLRXdfT1U/edit?usp=sharing

      Delete
    3. It appears to be working on my Nexus 5 (I'm Anonymous from above). I'll check back if it quits or in a few days to say it's still fine.

      Delete
  3. modified version works. greets anno nüm.

    ReplyDelete
  4. Looks like database problem is (probably) solved. I'll update GooglePlay version now.

    ReplyDelete
    Replies
    1. I haven't had any issues with the one you posted in the comments (labeled 1.11)... looks like it's working fine.

      Delete
  5. I want to edit the Macros in a notepad. How can i do this?

    ReplyDelete
    Replies
    1. It's not possible now, but I'll try to add support for macros stored in text files in next version of the app.

      Delete