The code area in Flock XR is where you build your program using code blocks.
You can use keyboard controls to move around the code area, select blocks, search for blocks, move blocks, duplicate blocks, and open block options.
This is useful if you are a keyboard only user or when you prefer using the keyboard instead of dragging blocks with a mouse or trackpad.
Open the code area
To move to the code editor, use this shortcut:
| Action | Mac | Windows |
|---|---|---|
| Open or focus the code editor | cmd | Ctrl + E |
When the code area is selected, you can start moving through your blocks with the keyboard.
Move through blocks
Use the arrow keys to move through blocks in the code area.
| Action | Mac | Windows |
|---|---|---|
| Move up through blocks | ↑ | ↑ |
| Move down through blocks | ↓ | ↓ |
| Move into a block | → | → |
| Move out of a block | ← | ← |
This helps you move between blocks in a stack, or move into blocks that contain other blocks.
Move between block stacks
A block stack is a group of blocks joined together.
| Action | Mac | Windows |
|---|---|---|
| Go to the next block stack | N | N |
| Go to the previous block stack | B | B |
Use these keys when your code area has more than one stack of blocks.
Add a block by name
You can add a block by searching for its name.
| Action | Mac | Windows |
|---|---|---|
| Select only the workspace | W | W |
| Add block by name | cmd | Ctrl + ] |
This is useful when you know the block you want and do not want to look through the toolbox.
For example press W to isolate the workspace then Ctrl + ] and type ‘say‘ to add a say block to the code area.
Search for a block in your code
If your program has lots of blocks, you can search inside the code area.
| Action | Mac | Windows |
|---|---|---|
| Search for a block | cmd | Ctrl + F |
| Go to the next search result | Enter | Enter |
| Go to the previous search result | Shift + Enter | Shift + Enter |
| Go to the selected block/close search | Esc | Esc |
This helps you find a block quickly in a larger project.
Open the block context menu
The context menu gives you extra options for a selected block. These options can include actions like adding comments, collapsing blocks, disabling blocks, enabling blocks, or deleting blocks. With the block selected:
| Action | Mac | Windows |
|---|---|---|
| Open context menu | cmd | Ctrl + Enter |
| Close context menu | Esc | Esc |
Use the context menu when you want to do something to the selected block.
Duplicate, detach, and move blocks
You can use keyboard shortcuts to change blocks in your code area.
| Action | Mac | Windows |
|---|---|---|
| Duplicate block | D | D |
| Detach block | X | X |
| Move block | M | M |
Move a block to a connection
After choosing to move a block, use the arrow keys to move it to a connection point.
| Action | Mac | Windows |
|---|---|---|
| Move to a connection | ↑ or ↓ | ↑ or ↓ |
| Place a moved block | Enter | Enter |
| Exit move | Esc | Esc |
A connection point is where a block can join another block.
Move a block anywhere
After choosing to move a block, you can also move a block more freely.
| Action | Mac | Windows |
|---|---|---|
| Move block anywhere | cmd | Ctrl + ↑ ↓ ← → |
Use this when you need to place a block somewhere else in the workspace.
Quick steps: move a block in the code area using keyboard controls
- Press
cmdon Mac or⌘+ ECtrl + Eon Windows to open the code editor. - Use
↑and↓to move through blocks. - Use
←and→to move out of or into a block. - Press
NorBto move between block stacks. - Press
Mthen arrow keys to move a selected block. - Press
Enterto place a selected block.
Quick steps: search for a block in your code area using keyboard controls
- Press
cmdon Mac or⌘+ FCtrl + Fon Windows. - Type the name of the block you want to find.
- Press
Enterto move to the next result. - Press
Shift + Enterto move to the previous result. - Press
Escto go to the selected block.
Tips for young learners
- Look for the selected or highlighted block. That shows where your keyboard is focused.
- Use one key at a time while you are learning.
- If you get lost, press
Esc, then select the code area again. - If you make a mistake, use undo.
| Action | Mac | Windows |
|---|---|---|
| Undo | cmd | Ctrl + Z |
| Redo | cmd | Ctrl + Shift + Z |
Troubleshooting
The arrow keys are not moving through my blocks
The code area might not be selected. Press cmd on Mac or ⌘ + ECtrl + E on Windows.
I cannot find the block I want
Use search.
| Action | Mac | Windows |
|---|---|---|
| Search for a block | cmd | Ctrl + F |
I changed the wrong block
Use undo.
| Action | Mac | Windows |
|---|---|---|
| Undo | cmd | Ctrl + Z |
I cannot remember the shortcuts
Open the keyboard controls menu.
| Action | Mac | Windows |
|---|---|---|
| Show or hide shortcut help | cmd | Ctrl + / |
Related articles
👉 Keyboard controls in Flock XR main page
👉 How to use the keyboard controls menu in Flock XR
👉 How to use keyboard controls for the Flock XR toolbox
👉 How to use keyboard controls for the Flock XR gizmos
👉 How to use keyboard controls to create an animated character in Flock XR
