Brass Plugins: Mime
Configuring Mime Gestures
Locate the "Mime" entry in the Brass "Available
Plugins" list and double click it. Click "Plugin Config"
in the summary window that appears. The gesture configuration screen
appears:

The configuration dialog is split into 2 parts. The top part, "Actions",
is where you do all your configuration. The bottom part, "Information",
is where Mime displays information to help you with your configuration.
The Actions Pane
The Mime configuration is designed around the same principle as
the rest of Brass. On the left you have a list of available but
inactive options, and on the right you have a list of configured
and active options. Let's go through this step by step.
The Available Actions Tree
Within the left hand tree are all the actions you can configure
for Mime. At the top level of the tree are the criteria items. In
the screenshot above, that's "Builtin - All Apps" and
"Internet Explorer". These tell you which applications
the actions below apply to. If you click on a criteria item, an
extended description of it (as well as its detailed criteria) appears
in the "Action Description" pane below.
Underneath each criteria item in the tree are action items; in
the screenshot above, these are "AddToFavourites", "Find"
etc. These are the items that do the actual work and can have gestures
configured for them. If you click on an action item, a description
of what it does appears in the "Action Description" pane
below.
The Configured Gestures Tree
Within the right hand tree are all the active gestures you have
configured for Mime. At the top level of the tree are the criteria
items, exactly as in the Available Actions tree. These group together
the action items at the second level of the tree.
Underneath the action items at the third level of the tree are
the mouse gestures configured for the action (these have a little
mouse icon to the left of them).
Think of this tree as working in reverse. When you make a gesture
at the third level of the tree, the action at the second level of
the tree is executed when the criteria at the first level of the
tree is met.
As with the Available Actions tree, clicking on a criteria or action
item causes a description to appear in the "Action Description"
pane below.
In addition, clicking on a gesture item causes a "long"
description (instead of "LD" in the tree, "Left Down"
will be shown) of the gesture to appear in the "Action Description"
pane, and a visual representation of the gesture to be drawn to
the "Selected Gesture" pane.
Configuring a Gesture
Let's walk through configuring a gesture. We're going to enable
Notepad to prompt us with a "Open New File" dialog when
we make a "mouse right, mouse down" gesture.
First, click on the "Built In - All Apps" criteria item
in the "Available Actions" tree. Look at the "Action
Description" pane - it clearly says the criteria is "Any
application". Last time I checked Notepad was an application,
so we're good to go :-)
Expand the "Built In - All Apps" criteria and locate
the "OpenAnywhere" action. Click on it then click the
right arrow button to add it to the "Configured Gestures"
tree.

As soon as you click the arrow button, the "Draw Gesture"
screen appears.

This is where you draw your new gesture. Hold the right mouse button
down on the grey canvas in the middle, move the mouse around and
a trail is drawn behind the cursor. When you release the right mouse
button, Mime converts your gesture into a nice uniform pattern.

Ok, I may have gone a little crazy with that gesture :-). Try it
out for yourself. You're not committed to using a gesture until
you click OK, and every time you click the right mouse button the
canvas is wiped. Play around for a little bit to get a feel for
it.
As you create your gesture, notice how a letter gets added the
the "Gesture:" field underneath the canvas. As soon as
you change direction, a new letter gets added, "L" for
left, "R" for right, "U" for up and "D"
for down. Each one of these letters represents a gesture "segment".
A new segment is added only when you change the gesture direction.
In the screenshot above, look at the very long horizontal line
at the bottom of the canvas. Even though it's double the length
of any other line, it is still considered one single gesture segment
and thus only has one "R" associated with it.
Creating gestures is pretty intuitive after the first couple of
tries, so keep playing. Notice the blue arrows that are added to
your gesture pattern - these indicate the direction of the gesture.
A flat line would be a little hard to understand, as you wouldn't
know if you're going left or right.
If you do create a gesture where you go back over yourself (for
example "Left, Right"), it will be a little hard to understand.
The gesture will look something like this:

Note how the first gesture arrow ("R" for right, as shown
in the "Gesture" text field) is overlayed with the green
line of the gesture going left. In these cases there is no easy
way to visually distinguish between gesture directions, so you'll
have to look at the gesture then review the text representation
in the "Gesture" field.
Gesture Interpretation Strictness
While we're creating our Notepad gesture (remember that?!), now
is a good time to look at the "Gesture Interpretation"
slider. This slider controls how strict Mime will be when interpreting
a gesture, and how much distance must be travelled with the cursor
before a new gesture segment is registered.
Let's assume I've drawn a gesture like this in the gesture canvas:

Nothing unusual there, apart from the fact that I don't have a
particularly steady hand. When Mime interprets this gesture, it
draws lines around each part of the movement. If a part of this
gesture falls outside the lines, a new gesture segment is considered
to be created. This next image is the same gesture, but with the
green lines representing a very forgiving interpretation and the
red lines representing a very accurate interpretation.

In 2 places, marked by the purple arrows, the gesture represented
by the blue line falls outside the strict interpretation represented
by the red lines. But the entire gesture falls completely inside
the forgiving interpretation represented by the green lines. Depending
on the interpretation, we have 2 very different gestures:

The left hand gesture is the recongised pattern when strict interpretation
has been applied. The right hand gesture is the recognised pattern
when forgiving interpretation has been applied.
In a single sentence: Gesture interpretation
strictness controls how far the cursor must travel in any one given
direction before a new gesture segment is registered.
Play around with the slider until you find a setting you're comfortable
with. If you slide the thumb all the way to the right hand side
("Forgiving") then draw a gesture, notice how far you
have to move the mouse before a new gesture segment is recognised
and added to the "Gesture:" text field. Slide the thumb
all the way to the left hand side ("Accurate") and notice
how little you have to move the mouse before a segment is recognised.
Most people will find the best setting is with the thumb somewhere
around 1/3rd of the way from the left of the slider. If you have
shaky hands or need a bit more leeway, you'll want to move the thumb
closer to 2/3rds.
Back to the Notepad Gesture
After all, that's what we were doing when we started! In the "Create
Gesture" dialog for "Builtin - All Apps" - "OpenAnywhere",
make a "mouse right, mouse down" gesture. Click OK, and
your new gesture will be added to the "Configured Gestures"
tree.

That's it, your gesture is configured and ready for use! Click
OK to close the "Gesture Configuration" screen, then go
to the main Brass window to make sure Mime is in the active plugins
list.
Load Notepad (Start - Run - Notepad.exe), move your mouse anywhere
in the Notepad window. Hold down the right mouse button, move the
mouse right then down. A trail will be drawn behind your cursor
and feedback icons representing each gesture segment will appear
on screen:

When you release the right button, Notepad will display the "Open
File" dialog!
At this point you may be wondering why your feedback icons (the
blue button-style images in the screenshot above) appeared way in
the top right of your screen. We'll talk about how to change this
shortly.
One final note. You are not limited to having just one gesture
per action. If you'd like to configure another gesture for the "Built
In" - "OpenAnywhere" action simply select it from
the "Available Actions" tree, click the right arrow button,
draw a new gesture and click "OK". Your second gesture
will be added underneath the first.
Now you've learned one way to add gestures to
an application (or to all applications). In the
advanced users guide, you can learn how to create your own custom
actions and criteria.
Gestures with Parameters
Some actions are a little more complex. "Open File" is
pretty easy - every time you make that gesture, the file browser
dialog appears. But what if you wanted to associate a gesture with
opening a specific file?
A great example here is Internet Explorer. You can click the "Home"
button or make the "Home" gesture, but wouldn't it be
cool if you could make a gesture that takes you to the Brass website?
Or the BBC News home page? Or even your personal website?
Course it would! Mime can do this too. Some actions accept a parameter
when a gesture is associated with them. In the IE example, the parameter
might be "http://www.bbc.co.uk", or "http://www.32bits.co.uk".
You'll know when a gesture accepts a parameter for 3 reasons. Firstly,
the description of the parameter will show up in the Mime "Available
Actions" tree against the action:

Secondly, there will be a little hint in the "Action Description"
pane:

Thirdly, when you add or edit the gesture the parameter edit box
will be enabled and a description of what you need to supply will
be shown:

When you've added a gesture action with a parameter, the parameter
shows up in the "Configured Gestures" tree as well, so
you know what gesture does what:

The really, really powerful part of this might not be immediately
obvious. At the end of the example Notepad section above you learnt
how to add more than one gesture to an action. With actions that
require parameters, you can add as many versions of them as you
want! A screenshot is definitely the best way to show you this:

Here you can see the single action (GoToWebpage) has been added
3 times, each time with a different parameter and gesture. Now I
can access my favourite websites through gestures!
An Important Note About Parameters
Parameters are attached to actions, not to gestures. So
if you have multiple gestures configured for the same action, they
all use the same parameters. If you have 2 of the same action with
different parameters, it is treated as a different action. This
is why, in the screenshot above, you can see that there are multiple
"GoToWebsite" entries - one for each parameter.
Think of it this way - "Available Actions" is your local
grocery store of actions. When you buy an item and take it home
with you then change the item, it's not the same as any other item
you'd get from the store. For example, if you buy a pad of paper
and then draw all over the front page, that pad of paper is going
to be different to any other pad of paper you get from the store.
Buying an item is like adding a gesture, and drawing on the front
page is like changing the parameters. If this seems a little confusing,
play around with the configuration screen for a while. You'll see
how it works very quickly.
Lots of criteria plugins have parameters available, just keep an
eye out for which ones you can use. Some really cool stuff is possible
- how about gestures that do different things depending on the current
web page you're viewing or the MP3 that's playing!!!
Deleting a Gesture
Deleting a configured gesture is very simple. Select the gesture
item you want to delete from the "Configured Gestures"
tree, and click the "Remove" button. You can also click
the button with the arrow pointing to the left to achieve the same
result.
If you want to delete all gestures for an action, select the action
item in the tree and click the "Remove" button. Similarly
if you want to delete all the gestures and actions in a criteria,
select the top level criteria in the tree and click "Remove".
Editing a Gesture
If you simply want to change the gesture associated with an action,
click on the gesture in the "Configured Gestures" tree
and click "Edit". The "Draw Gesture" diaog will
appear with a fresh canvas for you to draw the new gesture on.
Now you know how to create and manage gestures. It's time to talk
about gesture precedence!
|