Mice, Keys, and Touch

(return)  (springs & pucks)

This list of mouse, keyboard, and touch-screen actions is a reference for the features of the Springs and Pucks page. The "gui" column here indicates a corresponding button or checkbox. The "client" column indicates availability in the network client. The "r/a" column indicates a corresponding option in the "remove/add items" menu.

Ideally, try the S&P page (and read the left panel there), watch a few videos, then back here for reinforcement. However, this reference page can also be a place to explore and gather. Almost every interface feature is explained, enough for a try. The "virtual game pad" and the "remove/add items" menu are mentioned here (with links).

Note that the interactions section of the videos page serves as an introduction to the mouse/keyboard usage, especially those in the "move, rotate, and play" group below. The videos are annotated, identifying the commands.


action gui client r/a description
click x Click directly over a puck to select it and attach a cursor spring. A click in an open area of the canvas resets any previous engagement. Use middle or right buttons for milder or stronger cursor springs.
drag x A drag is a click and hold followed by mouse movement. Drag over a puck to select it (or catch one in motion) and attach a cursor spring (also see shift-drag, ctrl-shift-drag, and alt-drag).
one finger x A single-finger touch is equivalent to a mouse drag. This can be used to select, aim, and shoot in the games. Release the touch to fling or shoot.
additional selection methods
shift-drag x Drag over pucks to select one or more and their connections.
shift-rmb-drag x Using the right mouse button (rmb), drag over pucks to de-select one or more and their connections.
alt-drag Using a box, select one or more pucks and their connections.
c x x Toggles COM (Center-Of-Mass selection and attachments)
alt - c x x Move the attachment point (of a rectangular puck) to be in middle of the shortest dimension. A second alt-c will move the attachment point to the nearest end.
e x Enable (toggle) wall and pin selection and editing.
move, rotate, and play
ctrl-drag x Directly move a puck or group (without a cursor spring).
triple touch x Three successive touches will toggle ball-in-hand ON/OFF. When ON, touch drags are like a ctrl-drag with a mouse, direct movement, no cursor spring.
ctrl-shift-drag x Rotate a selected puck (or group) about the center. For a single puck, this will aim and set the shot speed; release to shoot. Releasing over the puck will cancel the shot. Press the "alt" key before releasing, to shoot in the opposite direction.
alt - b,n x With "alt" held down, the "b" and "n" keys step back and forth through the shot history, useful for practicing a shot repeatedly.
b x Toggle fine-moves cursor positioning. This is mainly for careful aiming in the games, but can also offer fine control in positioning objects.
second finger x This uses a momentary second-finger touch after starting a single-finger touch (a drag). This is only available in three of the games: in Ghost Ball Pool this is equivalent to the "z" key (speed lock), in Monkey Hunt and Bipartisan Hoops this is equivalent to the "b" key (fine-adjust).
third finger x The third-finger touch is available in Bipartisan Hoops, so you can do a ball-in-hand maneuver to get vertical orientation for a bank shot. Works best if 2nd and 3rd touch are done together, toggling between COM and non-COM ball-in-hand.
ctrl - shift - l x Toggle the ctrl-shift lock so that future puck drags will act as if the "ctrl" and "shift" keys are held down, handy when frequently shooting (this lock is set in the Ghost-Ball pool game).
Note that if already locked, a selected group can be aimed and shot (like a single puck) if the "shift" key is held down before releasing the shot. The multi-select video shoots a bullet-shaped group of pucks.
z x Lock the shot speed. After using ctrl-shift-l to lock ctrl-shift, the "z" key can be used to lock the shot speed. With no puck selected, the "z" key can be used to unlock the shot speed.
mouse wheel x If the shot speed is locked (see "z" key), the mouse wheel can be used to adjust the shot speed. This can be useful for setting a very low shot speed.
ctrl-alt-drag x Rotate a selected puck (or each puck in a selection group) about their individual centers.
Puck Popper (demos 7 and 8)
w, a, s, d x The w-a-s-d group of keys controls the puck's jet. The "w" key fires. The "a" and "d" keys rotate. The "s" key turns the jets to oppose the current motion, useful in breaking. Subsequent "s" presses rotate the jet in 90-degree clockwise steps. Firing the jet, "w", resets this pattern.
i, j, k, l x The i-j-k-l group of keys controls your gun. The "i" key shoots bullets. The "j" and "l" keys rotate the gun clockwise and counterclockwise. The "k" key rotates the gun in 90-degree clockwise steps (shift-k steps counterclockwise).
spacebar x Turn on a shield for your puck.
shift - d - p Add a drone on a single navigation pin.
ctrl - q Put drones to sleep. Ctrl-q again to wake them.
? x The question-mark key will identify the puck that you control.
two thumbs x The Two-Thumbs virtual game pad (cell phone touch-screen) is started from the client page. Check out the videos and the corresponding discussion on the S&P page.
global, affects all pucks
f x x Momentarily stop translational motion. Forces on pucks, if present, may cause translations to resume.
r x Momentarily stop rotational motion. Torques on pucks, if present, may cause rotational motion to resume.
ctrl-backspace x Reverses the velocities (rotational and translational) of all pucks.
g x Toggles gravity on/off.
engine, canvas, and network
p x Toggles the state of the physics engine between paused and normal-stepping.
shift - p Toggles between WebRTC (P2P) and Socket.io. This changes the path the client events travel to get to the host. P2P is the shortest. Socket.io involves the node server, which is usually the scenic route.
alt - p Toggles screen erasing on/off.
o x Pause the physics engine. Additional "o" keys will single-step the engine. Use the "p" key to resume normal stepping.
m x Toggles multiplayer options and displays the connection and chat area in the left panel.
lagtest
cursor-lag testing If "lagtest" is in the chat field before checking "Local cursor" (inside "Multiplayer"), a circle is drawn to visualize the difference between the rendered cursor and system cursor. Cursor speed is used to calculate the radius at 2-frames out from the rendered cursor. Note that unusual, persistent lag can be corrected by pausing ("p" key) and restarting ("p" key again) the animation loop. This is done automatically after transitions that can occasionally cause a persistent lag (such as going in/out of full-screen display and changing browser tabs). Search for "lagTesting", "getLagTesting", and "restartAnimationLoop" in the code for more discussion.
capture and run
u x Take a capture.
shift - r x Run the caputure.
1 through 9 x x The number keys start (or restart) the corresponding demo or lettered variant.
four fingers x Four simultaneous touches will restart the current demo or game.
0 The zero key resets the canvas (clears off all pucks). If in full-screen mode, returns to normal view. Network connections are unaffected.
v x Enable full-screen view. Use "esc" to return to normal view.
n x Place objects on a full-sized canvas, take a capture, then display in full-screen view. Use "esc" key to exit from full-screen view.
shift - m x Modify the capture, for the selected table objects, using a JSON segment in the chat field.
page navigation
ctrl-shift - ← → ↑ With ctrl and shift held down, the left/right arrow keys step back/forward through a scroll-position history that is populated as you follow page links to targets on the same page. This is useful for returning to the starting link. The up-arrow key will scroll the page to the top.
copy, delete, create, arrange
ctrl - x Delete selected objects. By default, spring and joint connections are deleted first. A second ctrl-x will delete the pucks. Note that this can be directed at individual connections by first using the "enter" key and then the "tab" key to step through the individual connections. Then, ctrl-x.
ctrl - v Copy the selected object (or group) and paste at the cursor position.
ctrl - c Copy the selected spring for use in pasting (ctrl-s) onto a pair of selected objects.
ctrl - s Paste a copied spring onto a pair of selected objects.
alt - r x Add a revolute joint at the selection points of the pair of selected objects.
ctrl - alt - s x Add a spring at the selection points of the pair of selected objects.
alt - l x Align the selected group between the two most remote objects (outliers) relative to the system center.
alt - shift - l x Arrange the selected group (of at least 9 objects) into a semi-circle.
ctrl - l x Toggle the display of the EPL report (energy, momentum, angular momentum)
ctrl - alt - l x Toggle to the "speed" version of the EPL report.
menu items x This serves as encouragement to review the additional stuff in the remove/add items menu in the right panel of the main S&P page. One of my favorites there is "add springy chain." Here's a short video.
change characteristics
← → Left/right arrow keys change the width of selected rectangular objects or the radius of selected circular pucks.
s - ← → If the "s" key is held down, the left/right arrow keys change the strength and displayed width of selected springs. Hold down both the "alt" and "s" key for adjusting the width only.
↑ ↓ Up/down arrow keys change the height of selected rectangular objects or the radius of selected circular pucks.
s - ↑ ↓ If the "s" key is held down, the up/down arrow keys change the un-stretched length of selected springs.
- + The minus and plus keys change the surface friction (tackiness) of selected pucks.
[ ] The left and right bracket keys change the restitution (elasticity) of selected pucks.
< > The less-than and greater-than keys change the translational drag of selected pucks.
alt - < > With the "alt" key held down, the "<" and ">" keys change the rotational drag of selected pucks.
s - < > With the "s" key held down, the "<" and ">" keys change the damping (shock absorbers) of selected springs.
shift - s Toggles the spring type for new springs, and displays a corresponding report on existing springs.
network commands (connected chat)
help x List the network commands than can run from the multiplayer chat field (need to be connected to the server).
rr Generate a room report on the clients connected to this room.
dcir x Disconnect the clients in this room. If the host uses this, all clients, except the host, are disconnected. If a client uses this, only that client disconnects.
ping x Run a ping test to the server.
cmd x Display more detailed help on the "cmd" command (targeted chat).
lb Display more detailed help on the "lb" command (leaderboard queries).
noname x noname in the chat field (then click "create", "connect", or "chat") to go back to being anonymous.