Exploring the Keyboard Commands

This section explains how to use features of Fungimol to discover and change the keyboard and mouse bindings. Unfortunately, all of the interaction here is entirely text-based.

First, we can easily discover the keyboard and mouse bindings. They are printed whenever an invalid key is pressed. For instance, if you press "0", you'll see something like the following in the text window. The text below is out-of-date, so for an accurate list of the keyboard bindings, you must run Fungimol and press "0".

The button 0 has no meaning here.
The meaningful buttons are:
Key                          Action
b                            InferBonds
n                            NewScene
c                            EditConfiguration
s                            StartStopTime
t                            ReportTimes
w                            NewTopLevel
l                            MakeLink
;                            IdentifyAction
Delete                       DeleteObject
Middle mouse button          TranslateOrScale
Left mouse button            DeselectAll and SelectCube
Right mouse button           Use the mouse to move the selection
,                            CreateAtom
.                            Configure and run ChangeAtomType
/                            InspectAtom
i                            SelectionInvisible
Shift e                      EdgeHex
Shift l                      DeleteLink
Shift ;                      IdentifyNear
Shift Middle mouse button    TranslateOrScale
Shift Left mouse button      SelectCube
Shift Right mouse button     Use the mouse to move the selection
Shift ,                      Configure and run CreateAtom
Meta or Alt ;                Configure and run AnyCommand
Control Right mouse button   Use the mouse as a trackball to move the selection
Control Middle mouse button  Use the mouse as a trackball to change the viewpoint
Control x                    DeleteSelection
Control c                    CopySelection and move the selection
Control s                    Configure and run AnyFileSceneWriter
Control r                    Configure and run AnyFileSceneLoader
Control m                    Configure and run PlayBrennerMovie
Control Left mouse button    DeselectAll and SelectUnderMouse and GrowSelectionConnected

The names of the commands listed are designed to be human-readable, so they don't match up exactly with the commands listed in the command summary. We can use the configuration editor to find out exactly what is going on, and change it if we choose. For instance, the multi-word binding for "Left mouse button" above is "DeselectAll and SelectCube", which does not match up with anything in the command summary because everything there has only one word. Let's use the configuration editor to find out what is really happening. First, press "c" in the graphics window, then you can have the following dialogue in the text window:

The configuration has these read/write fields:
Number  Field name           Field type        Field value
1       Scene Generator      SceneLoader       VectorSceneLoader
2       Scene Graph          SceneGraph        SubsetStorageScene
3       Timesteps Per Frame  Positive Integer  5
4       Top Level            TopLevel          XTopLevel
Give the number of a field to edit, or press 0 to exit: 4
This slot implements the protocol TopLevel.
The currently chosen factory is XTopLevel.
Do you want to change the factory and reset to the new factory's
default configuration? n
Editing the configuration...
The configuration has these read/write fields:
Number  Field name                          Field type             Field value
1       Busy device bug threshhold          Positive Integer       100
2       Input Devices                       Vector of InputDevice  Vector of length 2
3       Object Drawer                       ObjectDrawer           XObjectDrawer
4       Sleep between polls (microseconds)  Positive Integer       50000
5       Use MIT Shared Memory Extension     Boolean                true
Give the number of a field to edit, or press 0 to exit: 2
The vector currently has these contents: 
Position  Value
1         Keyboard and Mouse
2         Space Orb Configuration
These options are available:
f,0            Finish editing this vector
e              Edit an element of the vector
  Edit the given slot of the vector
p              Print out the vector again
Which of these do you want to do? 1
This slot implements the protocol InputDevice.
The currently chosen factory is Useless (this string should not be seen).
Editing the configuration...
The configuration has these read/write fields:
Number  Field name                     Field type           Field value
1       Key and Button Dispatch Table  KeyboardMouseAction  KeyboardMouseDispatcher
Give the number of a field to edit, or press 0 to exit: 1
This slot implements the protocol KeyboardMouseAction.
The currently chosen factory is KeyboardMouseDispatcher.
Do you want to change the factory and reset to the new factory's
default configuration? n
Editing the configuration...
The configuration has these read/write fields:
Number  Field name                         Field type            Field value
1       Bindings when Control is down      Vector of KeyBinding  Vector of length 9
2       Bindings when Meta or Alt is down  Vector of KeyBinding  Vector of length 1
3       Bindings when Shift is down        Vector of KeyBinding  Vector of length 7
4       Bindings with no shift keys        Vector of KeyBinding  Vector of length 16
Give the number of a field to edit, or press 0 to exit: 4
The default value for new elements has the type
KeyBinding and the value Mouse motion is bound to DoNothing.
The vector currently has these contents: 
Position  Value
1         b is bound to InferBonds
2         n is bound to NewScene
3         c is bound to EditConfiguration
4         s is bound to StartStopTime
5         t is bound to ReportTimes
6         w is bound to NewTopLevel
7         l is bound to MakeLink
8         ; is bound to IdentifyAction
9         Delete is bound to DeleteObject
10        Middle mouse button is bound to TranslateOrScale
11        Left mouse button is bound to DeselectAll and SelectCube
12        Right mouse button is bound to Use the mouse to move the selection
13        , is bound to CreateAtom
14        . is bound to Configure and run ChangeAtomType
15        / is bound to InspectAtom
16        i is bound to SelectionInvisible
These options are available:
f,0            Finish editing this vector
d              edit the Default value
i              Insert a copy of the default value into the vector
l              deLete an element from the vector
e              Edit an element of the vector
  Edit the given slot of the vector
p              Print out the vector again
Which of these do you want to do? 11
This slot implements the protocol KeyBinding.
The currently chosen factory is KeyBinding.
Editing the configuration...
The configuration has these read/write fields:
Number  Field name         Field type           Field value
1       Key                Button               Left mouse button
2       What it should do  KeyboardMouseAction  DeselectAll and SelectCube
Give the number of a field to edit, or press 0 to exit: 2
This slot implements the protocol KeyboardMouseAction.
The currently chosen factory is MacroKeyboardMouseAction.
Do you want to change the factory and reset to the new factory's
default configuration? n
Editing the configuration...
The configuration has these read/write fields:
Number  Field name  Field type                     Field value
1       Commands    Vector of KeyboardMouseAction  Vector of length 2
Give the number of a field to edit, or press 0 to exit: 1
The default value for new elements has the type
KeyboardMouseAction and the value DoNothing.
The vector currently has these contents: 
Position  Value
1         DeselectAll
2         SelectCube
These options are available:
f,0            Finish editing this vector
d              edit the Default value
i              Insert a copy of the default value into the vector
l              deLete an element from the vector
e              Edit an element of the vector
  Edit the given slot of the vector
p              Print out the vector again
Which of these do you want to do? 1
This slot implements the protocol KeyboardMouseAction.
The currently chosen factory is DeselectAll.
Do you want to change the factory and reset to the new factory's
default configuration? n
Editing the configuration...
The configuration has no fields that can be changed.
Nothing to edit, so we're done.
The default value for new elements has the type
KeyboardMouseAction and the value DoNothing.
The vector currently has these contents: 
Position  Value
1         DeselectAll
2         SelectCube
These options are available:
f,0            Finish editing this vector
d              edit the Default value
i              Insert a copy of the default value into the vector
l              deLete an element from the vector
e              Edit an element of the vector
  Edit the given slot of the vector
p              Print out the vector again
Which of these do you want to do? 2
This slot implements the protocol KeyboardMouseAction.
The currently chosen factory is SelectCube.
Do you want to change the factory and reset to the new factory's
default configuration? n
Editing the configuration...
The configuration has no fields that can be changed.
Nothing to edit, so we're done.
The default value for new elements has the type
KeyboardMouseAction and the value DoNothing.
The vector currently has these contents: 
Position  Value
1         DeselectAll
2         SelectCube
These options are available:
f,0            Finish editing this vector
d              edit the Default value
i              Insert a copy of the default value into the vector
l              deLete an element from the vector
e              Edit an element of the vector
  Edit the given slot of the vector
p              Print out the vector again
Which of these do you want to do? 
From here we can repeatedly press "0" and then "enter" in the text window until we get back to the top level and the scene window starts interacting again.

In this dialogue we discovered that the left mouse button is implemented with a MacroKeyboardMouseAction with two Actions in the macro, specifically DeselectAll and SelectCube. We could have edited the vector of Actions to change what the left mouse button does. For instance, if you wanted the left mouse button to select an infinite depth cube, you could have changed the factory in the second element of the vector from SelectCube to SelectFrustrum.


Copyright 2000 Tim Freeman <tim@infoscreen.com>