Thursday 19 November 2015

iOS API and Demo update

Updated iOS API and demo project are now available here. Previous post about iOS API.
Note: make sure you are using latest firmware (v0.98) if you are working with OS X 10.11.


API changes:

  • many improvements and bug fixes,
  • added all keyboard layouts that are available in Android API version (see full list),
  • added mouse interface,
  • added consumer control interface,
  • added gamepad interface,
  • updated demo project.


Things not yet ready:

  • readme for the API will be added soon. Most things are already covered in Android version,
  • password protection is still not supported - if your InputStick is password protected, you must remove password protection to use it with iOS devices.


Demo project:

Demo project is a simple remote-control application. Available functions:
  • "Connect with any device" - displays list of nearby Bluetooth devices, allows to select device to connect with,
  • "Connect with last device" - attempts to connect with previously used device,
  • "Disconnect",
  • "Keyboard" screen - intercepts characters from on-screen keyboard. Allows to choose keyboard layout (always make sure it matches layout used by USB host),
  • "Mouse" screen - move mouse cursor with one finger, use two fingers to scroll. Three mouse buttons: left, middle, right.
  • "Consumer control" screen - Volume control: up, down, mute. Playback control: play/pause, next, previous, stop. Launch system default application: browser, email client, calculator,
  • "Gamepad" screen - control gamepad X and Y axes and 4 buttons.


Main screen.

Scanning for nearby devices.


Keyboard screen.

Mouse screen.

Consumer control screen.

Gamepad screen.

Tuesday 17 November 2015

USB Remote v1.50

v1.50 update will appear on Google Play within next few hours. Please let me know (in comments section) if you'll find a bug.


General changes.

Position of tabs (tab host) can be adjusted (Settings -> General):

Tab host can be moved to the bottom of the screen.

Compatibility with Android 6.0 permissions system - application will ask for permission to access internal storage (read/write files), when running on the latest version of Android OS. If denied, functionality of macros and voice commands will be limited.
Important: it may be necessary to force stop the application after granting the permission: explanation and more details.


System keyboard screen.

System keyboard screen has been slightly redesigned: 

More customization options:
  • modifier keys are now also available in full-screen mode,
  • modifier keys can be disabled,
  • modifier keys can be auto-released after pressing any other key (example: toggle Ctrl button, press S key, Ctrl+s is sent to USB host, Ctrl toggle button goes back to off state),
  • long press or double click modifier key to press and release the key (for example: long press "GUI"button to press and release Windows key to open start menu).
  • mousepad can be resized when soft keyboard is hidden. You can adjust this in settings.

Modifier keys and mousepad in full-screen mode.

Mousepad is resized when soft keyboard is hidden.

Fixed bugs:
  • modifier keys now work properly again,
  • buttons no longer take focus - enter and arrow keys now work properly all the time.


Custom keyboard screen.

  • long press swap button ("blue arrows") key to go back to previous set of buttons.
  • modifier key + non-modifier key combos now work properly in every mode (Settings -> Keyboard (Custom) -> Press and hold action).


"Text" tab.

Redesigned UI:

Redesigned text tab.

  • "Edit" button: opens large edit screen. This should help when working with long text,
  • "Settings" button: allows to quickly access settings related to "text" tab,
  • "Erase" button: removes last input by pressing backspace key the same number of times as there were characters in last input. Keeps track of the last input only! If pressed again (or there is no previous input), backspace key will be pressed only once. Example: if "some text" was types, "Erase" will result in pressing backspace key 9 times. Pressing "Erase" again will result in pressing backspace key once, no matter what text was typed before.
  • "Real time" typing: text is types as soon as it is entered into  text filed. You can use features that are not available when "System keyboard" screen is used: swype, dictionary and text prediction, voice input. By default text stays in text field and must be removed manually (use "Clear" button). If you want the text to be automatically removed, see Settings -> Text -> Compatibility.

Dictation and Voice commands:

You can use "real time typing" mode for voice dictation in real time. Use voice recognition functionality available in your soft keyboard. In most cases Internet access is required. So far it looks like you can get best results using "Swype + Dragon keyboard".

  • Settings -> Text -> enable "Type in real time",
  • connect to InputStick,
  • go to "text" tab, click on text field,
  • use Swype + Dragon keyboard (recommended), start voice recognition.
How this works:
  • speak a sentence,
  • Swype + Dragon takes care of converting speech to text,
  • text is entered into text filed,
  • as soon as it appears there, it is typed into USB host using InputStick.

Voice dictation using Swype + Dragon keyboard.

It is possible to enable "voice commands" - when matching keyword is detected, pre-defined action is executed, instead of typing text. Example:
say "select" - Ctrl+A will be sent to USB host instead of typing "select".

To avoid accidental execution of commands, you should enable and specify "Activation keyword" which must appear before command keyword. Example:
  • activation keyword is set to "execute",
  • when you say "... select the file which ...", it will be typed as a text.
  • when you say "... execute select ...." - Ctrl+a is pressed.
Note: both words must be entered as a single input. So this will not work if you make a long pause between both words.Currently, activation keyword and command keywords must be a single word (no spaces, "my activation keyword" is not allowed etc.).

You can see list of active command keywords in settings.
Default set of command keywords:
  • "erase" - removes last input (or presses backspace key). Same result as pressing "Erase" button.
  • "select" - Ctrl+a
  • "copy" - Ctrl+c
  • "cut" - Ctrl+x
  • "paste" - Ctrl+v
  • "close" - Alt+f4     
  • "run" - Win+r
  • "print" - Ctrl+p
  • "save" - Ctrl+s,        
  • "enter" - enter
  • "escape" - escape
Custom command keywords:
You can define custom set of command keywords, which can be added to the default set, or used to completely override it. This allows to use non-English words or use words which are more easily recognized. Example: you can replace "paste" keyword with "wklej" (Polish language) or use "insert".
To use custom keywords, you must create file "commands.txt" and put it in USBRemote directory. Go to Settings->Text and choose if commands specified in this file will be added to the default set or will replace it entirely. By default, the file is ignored.

File format:
You can use: type, press, click, etc. macro actions. More details. Example of commands.txt file:
#erase last input:
#select all:
#left click:
#scroll up:
#start/resume playback:



Default macro storage location is now changed to file-system. For now, it is still possible to use "Internal storage" option, however some new functions cannot be used in such case.

New macro actions:

action: same result as pressing "Erase" button available on "Text" tab,
parameters: none,
example: <erase>
comments: only for voice commands.

action: display toast message with given text,
parameters: text to be displayed,
example: <toast>some message

action:plays notification sound,
parameters: none,
example: <beep>

action: vibrates for specified time period,
parameters: duration in milliseconds,
example: <vibrate> 100

action: none. Allows to use <loop> and <jump> actions,
parameters: none,
example: <label>start

action: repeats all actions between specified <label> and this instruction specified number of times,
parameters: label to jump to, number of repetitions,
example: <loop>start,5

action:displays dialog window with list of all defined labels. Allows to continue execution at selected label or with next instruction (when canceled),
parameters: none,
example: <jump>

action: declares that parameter with specified name can be used within this macro. Values of parameters will be substituted before executing the macro and must be specified using "Parameters" screen, <param> must be declared BEFORE it is used.
parameters: name of parameter, must start with % character,
example: <param>%password 

Flow control:

It is now possible to create loops and jump to previously declared labels. Example:

#play sound
#IMPORTANT: param must be defined before it is used!



#IMPORTANT: label must be defined BEFORE loop pointing to it

#user can manually select any label to jump to or cancel and continue with next action
#display toast message
When <jump> instruction is reached, execution is paused and user is asked to choose at which point execution should be resumed. If canceled, execution is resumed at next instructions. 

<jump> instruction allows user to select at which instruction execution of the macro will be resumed.
Result (assuming "Cancel" was chosen and %user = Kuba):
loop1 22222
loop1 22222


It is now possible to use parameters in macros (note: only if "file-system" is used for storing macros). Name of parameter must start with % character. Values are substituted before executing a macro. Parameters can be defined using "Parameters" screen ("Macro" tab -> %param).

Parameters screen.

You can save names and values of all declared parameters to a text file. Then, before executing a macro, go to "Parameters" screen and load matching file. Example:

File: BobPC.txt (load this file if you are working with Bob's PC)

File: AlicePC.txt (load this file if you are working with Alice's PC)

#always remember to define a parameter before using it!

before executing the macro, %password will be replaced with either "1234" or "abcd".

Warning: parameter files are not encrypted! Keep this in mind if you want to specify parameters containing passwords etc.