2- Writing shortcuts
There are a few universal extremely useful shortcuts to know as a developer, or even as a writer. You should already know that you can navigate text using the arrow keys on your keyboard. You can also navigate words by holding the Ctrl key and pressing the left or right arrow.
Also, using the start and end keys, you can quickly jump to the start or end of a line of text.
Well, you can combine those keys with the Shift key to select text. For example, if you hold Ctrl, Shift and press the left arrow key, you’ll select the word preceding your typing cursor. When editing expressions, this makes it easy to navigate through portions of your lines. Using the Ctrl and arrow key combination, the cursor will only move until it meets a space or a dot!
Knowing the shortcuts above is the first step to navigating and working productively with the keyboard. The less time you spend jumping back to your mouse, the faster you’ll code. Let’s now talk a bit about keyboard navigation in Construct 2.
3- Navigating with the keyboard
To me, this isn’t the most unified aspect of C2. The keyboard shortcuts work well enough functional, but the editor has been built around the idea of drag and drop first and foremost. Below, I have tried to list some methods I use in my daily work to avoid using the mouse too much.
First of all, to enable the keyboard navigation, you must select a single event or component with the mouse: a condition, an action or a single line. If you select a whole block or list of events, you won’t be able to navigate with the keyboard.
Once you have selected a component, you can start navigating with the arrow keys, enter and spacebar:
- Using the left and right arrows, you can jump to the action or condition sides of an event.
- Using the up and down arrows, you can navigate the current type of selected component up and down. If a line is highlighted, you’ll move from line to line. If an action or a condition is selected, you’ll move from action to action or from condition to condition.
- With the spacebar, you can fold or unfold nested events (an event with sub-events). You need to select a whole line to do so.
- With enter, you can edit the currently selected action or condition.
The copy-paste block
When you copy and paste a block of events, the events you paste get selected. Thus you cannot navigate with the keyboard unless you use the mouse. But there is a trick to avoid jumping to the mouse:
- Press B to create a blank sub-event
- Press delete to delete the sub-event
You can now navigate again with the keyboard. Adding a condition or an action is an alternative to this process.
One last note for this section: adding a comment with the Q key will cancel any selection in the event sheet editor, forcing you to select something again with the mouse. There is no alternative there until the software gets updated.