IDE controls & keyboard shortcuts

Platform compatibility

Browser

Elan must be accessed through a Chrome-compatible browser: Chrome, Chromium and Edge.

Always use the browser in 'full screen mode' – it makes more space available and reduces the risk of accidentally refreshing the browser and losing work.

Apple macOS specific

It is recommended that you use Chrome even on Apple machines. (Safari works for most things but some compatibility issues have been reported.)

Where a keyboard shortcut is shown with the Ctrl control key, users of Apple's macOS should use the ⌘ Command key instead.

Customising the IDE

(If you haven't already done so, watch the video Selecting the language and paradigm in Start Here.)

Select the programming language

When the public Elan IDE is accessed - via https://codewithelan.org - it will be set up for programming in Python.

This may be changed via the languages button - and the dialog that it opens - to any of:

VB.NET is currently offered as an option only within the Quad View – for viewing only. We hope to make VB.NET an option for entering and editing code in a future release.

It is possible to create a link that will open Elan with the preferred language option already selected:

See also copy Url for this code

Quad view

The dialog returned by the languages button also offers a check-box for Quad View. If selected, this replaces the main code editor with four 'quadrants', which will typically be used to show the same code in four different languages at the same time. Please note that:

The programming paradigm

The button to the left of Languages shows the selected programming paradigm, one of three options:

The selected paradigm determines:

Changing the paradigm resets editor to a new file, so you will be warned that existing code might need to be saved.

Copy Url for this code

The action File > Copy Url for this code will generate a Url - copied into the system clipboard - that can be used as a shortcut into the configuration that has been selected via menu actions:

Also, if the editor contains code (other than the default code for new file) and that code is less than 20 instructions, then the code will be compressed and included as a parameter in the Url. This makes is possible to share simple programs with other users without the need for saving and loading a code file.

Entering and editing instructions

(If you haven't already done so, watch the videos Navigating around code and Entering new codein Start Here.) The read the following for additional commands.

Context menu

When you have selected an instruction by clicking on its keyword (turning its background blue), some immediate actions are available from its context menu which is opened either by clicking the right mouse button on the keyword, or by keying Ctrl+m. The commonest context menu shows these options, any one of which may then be clicked on to do the action:

The context menu shows only those actions which are relevant to that instruction in its context.

The following is a list all possible menu items with key equivalents where applicable:

doundokeyboardNotes
ghostunghostsee Ghosting
cut for internal useCtrl+xoption to paste within the editor. If pasted outside Elan, code will be in Reference Language
copy for internal useCtrl+cas above
copy for exportcopies as source code for the current language e.g. to paste into a document.
deleteCtrl+Delete or
Ctrl+Backspace
insert new code belowEnterinserts a new code prompt
insert new code aboveShift+Enterinserts a new code prompt
move upCtrl+↑moves selected instruction(s)
move downCtrl+↓>moves selected instruction(s)
set breakpointclear breakpointsee debugging
clear all breakpointsoffered only on an instruction that already has a breakpoint
make privatemake publicCtrl+p (toggle)applies to member instructions (object-oriented or functional paradigms)

Select and edit a field

To...Keyboard shortcutMouse gestureNotes
select any field within an instructionclick anywhere on the text, or placeholder, for that field.Text cursor will be placed at the end of the field
select the first field in a selected instructionTab
select the next field in the same instructionTabwill cycle through the fields and back to the whole instruction.
select the previous field in the same instructionShift+Tabwill cycle through the fields and back to the whole instruction.
select specific text within a field Shift+← or →click and drag across the desired characters
select all text within a fieldCtrl+a
position text-cursor at the start of a selected fieldHomeclick anywhere within the selected field
position text-cursor at the end of a selected fieldEndclick anywhere within the selected field
go from the last field to the next instructionEnter

Insert a new instruction...

If there is already a new code prompt where you want to insert an instruction then: Otherwise, select an instruction adjacent to where you want to add the new one and either:

Delete ...

To deleteKeyboard shortcutNotes
one or more (adjacent) existing instructionsselect the instructions then Ctrl+Delete, Ctrl+Backspace or Ctrl+x deleting a compound instruction will delete all its contained instructions
a just-created instructionBackspacethis works only if no fields have been entered or 'child' instructions added
a 'new code' prompt that is not neededdelete the same way as an instruction
all 'new code' promptsClick on the Trim button or Alt+tremoves all 'new code' prompts except in places where further instructions are required
(for example so as not to leave an empty loop)

Undo or redo a recent change

The editor retains previous versions of your code in its stack, but only when it has been parsed as valid. The code is saved internally, and also to file if auto-save is selected.
ActionUsing the keyboardUsing the mouse
Undo previous changesCtrl+zclick on undo button
Redo previous undosCtrl+yclick on redo button

Move instructions up or down within the same block

Cut and paste

Ghosting

Instead of being able to 'comment out' code that you wish to retain but not execute, Elan provides a method for 'ghosting' sections of code with much the same effect, while leaving the ghosted code fully formatted.

Loading,saving, and running programs

Load, Save, and Append

IntentionMenu actionNotes
load a demo programdemo then select desired program
load a program filefile > loadif the editor contains unsaved code, you will be warned
append a file to the current code in the editorfile > appendexternal code is always appended to the end of the current code, but may then be moved
auto save a program filefile > auto saveany subsequent edits will be saved to the file (whenever the code parses)
cancel auto-savingfile > cancel auto savethis action appears only after setting up auto save
save a program manuallyfile > manual savesaves the code to file but does not automatically save subsequent changes
create a standalone Html page incorporating your programfile > save as standalonethe saved .html file contains the compiled program, and will run automatically when opened

Running and Stopping programs

To...Keyboard shortcutMouse gestureNotes
run a programCtrl+rClick on 'run' buttondisabled if there are any parse or compile issues.
stop a program that is runningCtrl+sClick on 'stop' buttonEnabled only when the program is running

If your program is doing intensive processing between interactions with you through the IDE, then clicking on the 'stop' button may not have an immediate effect. This is an unavoidable side effect within the browser, but you will be returned to editing after a short period. Avoid repeatedly clicking 'stop' as that might cause the browser tab to be closed.

See also Debugging programs

Debugging programs

Run in debug mode, pause, and step

To...Keyboard
shortcut
Mouse
gesture
Notes
debug a program, or resume debugging a paused programCtrl+gClick on 'debug' buttondisabled if there are any parse or compile issues.
pause a program that is runningCtrl+uClick on 'pause' buttonenabled only when program is being debugged
step to the next instruction in a paused programCtrl+pClick on 'step' buttonenabled only then program is paused

Using breakpoints

Before clicking on debug you can set breakpoints at one or more instructions where you want execution to pause. A red flash symbol appears at every instruction that has a breakpoint defined..

When run using debug the program will automatically pause at every breakpoint, and the in-scope named values will be listed in the Info pane.

To...Keyboard
shortcut
Mouse
gesture
set a breakpoint on a selected instructionCtrl+m on a selected instruction keyword then select set breakpointright-click for context menu, then select set breakpoint
clear existing breakpointsCtrl+m on a selected instruction keyword, then select clear breakpoint or clear all breakpointsright-click for context menu, then select clear breakpoint or clear all breakpoints

Browsing values when paused at a breakpoint

Whenever the program is paused, all named values (variables, parameters and constant values) that are currently in scope have their values automatically listed in the Info pane. This list may be browsed as follows:

To...Keyboard
shortcut
Mouse
gesture
navigate to a specific line in the list when pausedTab, Shift+TabClick on the line
expand/collapse a specific name within the listEnterClick on the + or - at the start of the line

Accessibility

Change text size

To change the text size, hold down the Ctrl key and use the mouse scroll wheel, or change the magnification via the browser's zoom menu.

Colour scheme for CVD

There are two ways in which to change the colour scheme for users with CVD: